In a similar manner as we can use the create an object by name feature in Construct 3, I was wondering if it would be possible to set up the same mechanism for instance variables.
I am working towards making my events more streamlined however I hit a wall when it comes to checking a function parameter and then ading to an instance variable based on that parameter.
For example, say an object has woodCapacity and meatCapacity, upon adding an item (wood) to the object and then adding an item (meat) to the object I would like to be able to set the action as add self.(item.name & "Capacity") however to my current knowledge this is not possible. I am sure there is some fundamental mechanism with coding that may make this difficult (or perhaps impossible?) to add but boy oh boy would it reduce the amount of code required.
I believe there are other ways around this such as setting a value within a dictionary or array that you set the woodCapacity or meatCapacity to and then when this value is updated also update the capacity value, but would it be possible to make a direct reference to a variable so this wouldn't be necessary?
Also, if there is another way to achieve the same result I am grateful to hear about.