playMaker

Author Topic: Set FSM Array Item action doesn't work for global variables.  (Read 2877 times)

Silicon Power

  • Full Member
  • ***
  • Posts: 186
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #1 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

Silicon Power

  • Full Member
  • ***
  • Posts: 186
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #2 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!
« Last Edit: July 24, 2018, 06:26:37 AM by Silicon Power »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #3 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #4 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.
Available for Playmaker work

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #5 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.

Silicon Power

  • Full Member
  • ***
  • Posts: 186
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #6 on: July 28, 2018, 04:57:05 PM »
Thanks a lot for help guys. I figured it's not possible.
« Last Edit: July 28, 2018, 04:59:13 PM by Silicon Power »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set FSM Array Item action doesn't work for global variables.
« Reply #7 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