I have an inventory system I made. I added options for items to be able to be “Used” “Eaten” and “Equipped” and the method I’m using to add all those options is saying “can you use it?” if not then ask “can you eat it?” if not then “can you equip it?” and so forth. Would there be different way to do this other than nesting with branches like this?
Well yeah, either way. If you want to check three values, there’ll always be some branches. Alternatively, if an object may only have one of those true, set a single interface that will call the needed function. Then you send a message, and the object does what it can, no checking needed.
I added the Enum to the structure, this seems the best way. but is there a node that allows me to execute a different path if it is equal to one thing vs the other
i.e.
if backpack to down path a,
if weapon go down path b,
if armor go down path c,
with each path being like a branch but with multiple nodes other than “true” and “false” or would I end up having to do multiple branches for each enum var?
I wouldn’t be able to use an interface as far as I know. the “items” are a structure with all of the item info in it stored in an array. I don’t think I could use an interface there.
im getting the info from one of the elements in that array and breaking the structure to get the info on how to equip the item.
Thank you so much! both of you guys. this is the node I needed.
This is much appreciated!
Edit: This is so much easier to manage and find parts rather than using branch after branch