playMaker

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

jess84

  • Hero Member
  • *****
  • Posts: 515
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: 15500
  • Official Playmaker Support
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
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: 15500
  • Official Playmaker Support
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
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
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: 15500
  • Official Playmaker Support
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
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: 15500
  • Official Playmaker Support
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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • 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 »
Available for Playmaker work

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: Reset All local variables to 0/blank?
« Reply #10 on: June 27, 2021, 01:22:30 PM »
Sorry for necroing this, but... has there been any progress in supporting resetting local variables to their default/edit mode values?

Needing to set every single variable at the Start state is freakingly inconvenient and prone to errors.

Btw...

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.

...what action do you mean to? I didn't find anything relevant with the words "reset" or "variables" on the Ecosystem.
Unity 2019.4.9f1
Playmaker 1.9.7f1

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Reset All local variables to 0/blank?
« Reply #11 on: June 27, 2021, 01:39:05 PM »
Install the beta, it has that option.
Available for Playmaker work

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: Reset All local variables to 0/blank?
« Reply #12 on: June 27, 2021, 02:02:48 PM »
Oh damn! Thanks!
Unity 2019.4.9f1
Playmaker 1.9.7f1

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Reset All local variables to 0/blank?
« Reply #13 on: June 27, 2021, 04:40:51 PM »
I mean, they'll reset to defaults if that's what you're looking for, no option for blanking out.
Available for Playmaker work

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: Reset All local variables to 0/blank?
« Reply #14 on: June 27, 2021, 08:48:03 PM »
Yeah, I'd like they reset to the values they have on the variables tab, before entering Game Mode.

Is that what it does, right?
Unity 2019.4.9f1
Playmaker 1.9.7f1