Hello Everyone!
I searched here and the ecosystem but couldn't find it. I'm looking for a robust method to
get/set several variables from an external script (object) to an FSM. What I'm trying to doI like to have the important and essential variables of a game object in one place, and in a nice list, so they can be tweaked and balanced more easily, think Character Sheet. However, they are needed in different FSMs and get/set.
Problems & Assumptions- I am aware of the "Get/Set Property" method, but it only allows for one property per action. It would have to be repeated many times to get/set several variables. Also, variable names in the FSM need to be created manually.
- I could use one FSM as a variable "holder", and use get/set FSM variables to communicate with other FSMs, but they make for a chaotic list, but at least they are consistent across them.
- Using global variables somehow strikes me as a bad idea.
Current: HackI made a simple variable holder script, think Character Sheet, that keeps all the important high level variables in one place (think Running Speed, Damage etc). Then I reference this component as an object (drag/drop component into variable list), then I use get/set property multiple times until I got the various variables I need. I don't like this method, because it looks hacky and seems not very efficient.
Solutions Ideas- An action that can fetch and write (get/set) a number of variables at once from an object (script/component).
- Wrapping my script in such a way that playmaker accepts it as one action, and once in the FSM format, use the FSM-to-FSM communication to spread them around
Can someone point me to a resource that does this, give me a pointer how to solve this (I'm a non-programmer), or a solution that would be good, or reassure me that my solution I use already is good enough? (any feedback welcome)
Thanks in advance!