playMaker

Author Topic: Store local FSM variable name as String ??  (Read 2092 times)

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Store local FSM variable name as String ??
« 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?
Unity 2019.4.9f1
Playmaker 1.9.7f1

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: Store local FSM variable name as String ??
« Reply #1 on: April 23, 2018, 07:04:06 PM »
Bump?
Unity 2019.4.9f1
Playmaker 1.9.7f1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Store local FSM variable name as String ??
« Reply #2 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 :)

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: Store local FSM variable name as String ??
« Reply #3 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...:



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, 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!
Unity 2019.4.9f1
Playmaker 1.9.7f1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Store local FSM variable name as String ??
« Reply #4 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.