playMaker

Author Topic: Reset All local variables to 0/blank?  (Read 4073 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
    • View Profile
Reset All local variables to 0/blank?
« on: August 08, 2014, 07:47:25 AM »
Would it be possible to have an action to reset all local variables on the current FSM?

Since I've started using a Pool Manager to spawn/despawn some objects, I've noticed bugs occurring because any FSM variables aren't reset - so I end up with objects increasing in size each time they're spawned again, or if I've got an object with a float to set it's opacity over time, it starts off invisible.

Right now I'm manually going through and resetting local variables on the start state, but this is quite laborious, and could lead to missing something and therefore bugs!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #1 on: August 08, 2014, 03:04:22 PM »
Hi,

 have you tried to disable enable it, there is a check box "Reset on disable" that is on by default that will do for your case I think.

 Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #2 on: August 08, 2014, 06:40:26 PM »
Hi,

I already have Reset On Disable checked. It restarts the FSM to the start state fine, but local variables values remain are carried over.

So when I have a float add, the second time the spawned, the float value will be double what is intended.

Reset on Disable does not reset local variable values.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #3 on: August 09, 2014, 01:24:48 AM »
Hi,

 uhm, odd, I can reproduce here, I have submitted a bug report, we'll see. I'll keep you up to date and create a custom action if it turns out we need this.


Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #4 on: August 09, 2014, 06:40:43 AM »
thanks Jean.

It wasn't too much of a problem when I was dealing with objects with 1 local variable, but I discovered a few with a lot - that's a lot of setting floats otherwise :)

dt1000

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #5 on: January 14, 2015, 09:49:35 PM »
Did you ever fix this?
I am having the same issue!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #6 on: January 16, 2015, 03:50:59 AM »
Hi,

 Let me ping Alex on this.

 Bye,

 Jean

dt1000

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #7 on: September 26, 2015, 04:20:57 AM »
Any progress with this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Re: Reset All local variables to 0/blank?
« Reply #8 on: September 29, 2015, 04:54:12 AM »
Hi,

 Reset on disable only affects the active state, not the variables.

Unfortunatly, I haven't found a good way to set it up. I would need a proxy to save data on awake, so it would be a tricky setup.

 currently, when I have to deal with this, I force values on start states, so that I know that everytime I enter this state, my fsm variables get set to the right values.

I can let you "reset" a given number o variables to null, blank or 0, but that's not the same as reverting values to their original values set during editing.

Bye,

 Jean

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 1115
    • View Profile
    • Fat Pug Studio
Re: Reset All local variables to 0/blank?
« Reply #9 on: February 22, 2018, 06:10:53 AM »
Quote
I can let you "reset" a given number o variables to null, blank or 0

Yes, please  ;D

Oh, i see there's an action for that, will try it out.
« Last Edit: February 22, 2018, 07:18:15 AM by krmko »