I have an inventory grid with 40 game objects acting as slots. they are named inv_01....40 etc.
I want an fsm to get these and store them in that fsm as their respectively named game objects.
I'd like to be able to build a string with an int, and loop it until reaching 40, each time finding that named game object and storing it in its fsm game object variable. but I don't want 40 separate states with a uniqueley, personally, individually set game object destination.
The problem is I can't set a game object using its string name. I have to manually create 40 fsm game object variables, name them accordingly (that's all fine), then have a string switch with 40 outputs, each going into an event that sets THAT game object to THAT pre-designated variable from a dropdown list.
what I want is:
find game object [built string "inv_X"]
and save to fsm game object [built string "inv_X"]
in other words, saving to that game object based on the string chosen. kind of like a "for each, save to its" thing. even if i had to create and name the fsm game object variables ahead of time, i'd like to be able to call and set them by a string. because currently it's like this:
find game object [built string "inv_X"]
int switch = if 1, send to
store it in 'GAMEOBJECT_01"
loop
find game object [built string "inv_X+1"]
int switch = if 2, send to
store it in 'GAMEOBJECT_02"
loop
find game object [built string "inv_X+2"]
int switch = if 3, send to
store it in 'GAMEOBJECT_03"
or what i've done before, which is a single state with 40 find game object actions, each with an incremented game object variable from the dropdown list.
so I need 40 states instead of 1 that just says "get it of name X, store it in gameobject X with same name." then looping that single state up to a max int.
does this make sense? is this possible? it would save a crapload of time to be able to use a string to set a similarly named game object variable. rather than manual dropdown selecting the game object for 40 different states.
Here's a fake picture of the action that would save me one billion years if it really existed. A Set version, and a Find version is what I wish I had.
And the second picture is a faked version of what I'm trying to simplify. if I could just save built the needed string, then use it in those places, in each loop, my life would be great. I could just Get Last Event, and use that string, then loop it. Unless there's a better way?
As it is I have to do the garbage in the third image, manually...setting...every...single...game object variable.