Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Abelius on April 20, 2018, 07:23:23 AM

Title: Store local FSM variable name as String ??
Post by: Abelius on April 20, 2018, 07:23:23 AM
Hi there,

Having the possibility of storing the name of a local FSM variable into another local FSM string variable in the same FSM would be very useful to me (for a saving system).

Is this currently possible?
Title: Re: Store local FSM variable name as String ??
Post by: Abelius on April 23, 2018, 07:04:06 PM
Bump?
Title: Re: Store local FSM variable name as String ??
Post by: djaydino on April 24, 2018, 04:51:38 PM
Hi,
I don't think that you can get the names of a variable.

What are you trying to do, maybe there is some other solution :)
Title: Re: Store local FSM variable name as String ??
Post by: Abelius on April 25, 2018, 09:10:56 AM
Hi there! Thank you for the reply.  :)

I'm using EasySave2 to save some local Fsm variables on an external file. Thing is, this plugin uses string 'tags' to locate an individual data in that said savegame, so I can't use the same tag name for two different local Fsm variables that are called the same in different Fsm's.

Therefore, I'm building a custom string tag prior to each Fsm save action. Like this...:

(http://i67.tinypic.com/2lk8ept.png)

As you can see, I'm using the name of the owner object to make the tags unique, and I (manually) add the name of the variable to save as the second part of the string tag.

What I'm interested in doing is substituting that manual input with another string pointing to the local variable name to be saved.

The advantage of being able to select the variable from a dropdown list is that if I need to change its name (for reasons I admit I don't foresee atm), its "linked" string variable value would also change.

Tbh, I realize this is not a huge feature to have. But I was curious in case I was missing some already supported way to do it.

Btw, there was also another guy here (http://hutonggames.com/playmakerforum/index.php?topic=18510.0), asking a very similar question but with a much more complex situation than mine. It may be that he genuinely needs that feature to exist, idk.

Thank you for reading!
Title: Re: Store local FSM variable name as String ??
Post by: djaydino on April 25, 2018, 01:51:17 PM
Hi.
Does these "owners" have the same kind of variables?
Are these "owners" prefabs made in runtime?
are you only saving a bool for these "owners" or other things.

Can you give some more info on these "owners" so we can look for a different solution.

for example to use  arrays or hashtables. and save those.