Hi,
I'm working on a simple puzzle where the player adds objects to a bottle to prepare a drink. The recipe is completed once all the objects are added. While I could manage this by creating multiple inventory items to represent each new bottle state (e.g., Bottle with Coke, Bottle with Lemon, etc.), this seems overly complex.
Is there a simpler way to achieve this? I'm not crafting a new object but using an ingredient with the bottle each time. I considered using Inventory variables, but I'm unsure how they work and if they suit this scenario.
Any advice would be appreciated.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
If there's only once instance of this occuring (i.e. the Player can only perform this on one Bottle), the easiest way is just to rely on Global Bool Variables: "Added coke", "Added lemon" etc.
Otherwise, if you had e.g. multiple Bottles that could each be added to separately, you'd use Inventor properties to have this information be part of the item itself.
To do this, you'd first have to create a new Bottle category, and then Bool properties inside that Category (of the same names as the variables in the other method). You'd then place the Bottle item in the Bottle category, so that it has access to those variables.
Getting/setting inventory properties is a bit fiddly without custom scripting, as you need to use a Global variable as a go-between. The Inventory: Property to Variable can transfer a variable's value to a property, and vice-versa.
To set a specific property (e.g. "Added coke") you'd need to create a Global bool Variable that's always set to True, and then use this Action to transfer its value to the property.