Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Silicon Power on July 23, 2018, 06:19:24 PM

Title: Set FSM Array Item action doesn't work for global variables.
Post by: Silicon Power on July 23, 2018, 06:19:24 PM
Hello. Set FSM Array Item works nice but it doesn't work on Global Variables! can you please fix this? I really need to set a string to a global array variable.
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: jeanfabre on July 24, 2018, 04:50:05 AM
Hi,

 is it not actually because your index is out of range or some other issues? watch out for the meaning of this action, it means you want to "SET" not "ADD", so if your array is empty, setting index 0 won't work.

 make sure you add an event for each potential issue this action throws, this way you will make sure you are setting it up properly.

I tested here and it all works.

 Bye,

 Jean
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: Silicon Power on July 24, 2018, 05:53:26 AM
Hi,

 is it not actually because your index is out of range or some other issues? watch out for the meaning of this action, it means you want to "SET" not "ADD", so if your array is empty, setting index 0 won't work.

 make sure you add an event for each potential issue this action throws, this way you will make sure you are setting it up properly.

I tested here and it all works.

 Bye,

 Jean
I mentioned it just add string value in global variables windows but I need that value to global variables in project windows. I need when I stop game global variable keep that string!
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: jeanfabre on July 24, 2018, 11:56:24 AM
Hi,

 Sorry, I am not following what you are after.

 can you make a small videos showing what you want to achieve. What's the difference between the global variabbles window and the global variables in the project windows? maybe just screenshots will help.

 Bye,

 Jean
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: Fat Pug Studio on July 26, 2018, 12:50:58 AM
Oh, he needs global variable to store the value when the game is stopped as far as i can understand. Variables don't store values permanently, you need to store them in some other fashion, array, hash table, playerprefs, external file.
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: Plancksize on July 26, 2018, 10:16:18 AM
Hi,

 is it not actually because your index is out of range or some other issues? watch out for the meaning of this action, it means you want to "SET" not "ADD", so if your array is empty, setting index 0 won't work.

 make sure you add an event for each potential issue this action throws, this way you will make sure you are setting it up properly.

I tested here and it all works.

 Bye,

 Jean
I mentioned it just add string value in global variables windows but I need that value to global variables in project windows. I need when I stop game global variable keep that string!

If I'm understanding it right, you want to keep the value in the editor after runtime?
If so, the easiest way for that would be to store that string as a PlayerPref. Those will be kept after runtime.
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: Silicon Power on July 28, 2018, 04:57:05 PM
Thanks a lot for help guys. I figured it's not possible.
Title: Re: Set FSM Array Item action doesn't work for global variables.
Post by: jeanfabre on July 30, 2018, 05:57:09 AM
Hi,

 So was it the case that you wanted your data to persist from play time to edit time?

 Bye,

 Jean