playMaker

Author Topic: Reset on disable causing problems [SOLVED]  (Read 3637 times)

homeworld

  • Playmaker Newbie
  • *
  • Posts: 39
Reset on disable causing problems [SOLVED]
« on: December 22, 2017, 12:05:01 PM »
Hi! I've made a system where my enemies are disabling themselves when culled, to save on performance. But to re-enable them when needed, i have to uncheck the 'reset on disable' setting in most FSMs related to them; this causes this to happen:



The FSM just skips past the first few states, and stops at the one that has an "int changed" action for every frame. This is very unexpected, because as far as i'm aware, there's no reason why this should happen, as the "reset on disable" setting shouldn't affect this in any way.

I could make a workaround, but i'm really counting on fsms working as intended, and i'm really unsure why this is happening. I'm running Unity 2017.3.0f2 with the latest Game Maker. I'm attaching a scene illustrating the problem:
http://danbkp.myqnapcloud.com/Web/reset_scene.unitypackage

 (i hope it works, this is the first time i've exported a unity package)
« Last Edit: December 22, 2017, 02:23:52 PM by homeworld »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Reset on disable causing problems
« Reply #1 on: December 22, 2017, 12:27:14 PM »
This works exactly as it should doesn't it.

A Fsm with Reset on Disable unchecked does not reset to the start state when activated but continues at the state the Fsm was when is was deactivated!

Your start state is only being run once on level load and when you deactivate the Fsm it is at the "hp changed?" state and there it wil still be when you reactivate the Fsm.

If your start state needs to be run every time then why not just check Reset on Disable?

Or am i misunderstanding and do you mean that some actions in the state are being run but not all of them?
« Last Edit: December 22, 2017, 12:40:53 PM by LordHorusNL »

homeworld

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Reset on disable causing problems
« Reply #2 on: December 22, 2017, 01:00:43 PM »
The problem is that the state doesn't play even on first run; the uppermost FSM in that screenshot was never disabled!

Thanks for reading though!

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Reset on disable causing problems
« Reply #3 on: December 22, 2017, 01:49:29 PM »
I see what you mean, i tried your project and get the same result, it almost seems like the Fsm you are using has been corrtupted in some way. (Unity 2017.2)

However when i make a new Fsm in your project and copy the states over, it works just fine.

So i would try that and just copy over the states to a brand new Fsm for now.

*Edit*

It really just bypassed the start state entirely, this is the same fsm and it just skips over to the hp changed state without it even being connected to the "main" loop, very odd indeed.



Deleting all the states and remaking them also seems to work.
« Last Edit: December 22, 2017, 02:10:06 PM by LordHorusNL »

homeworld

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Reset on disable causing problems
« Reply #4 on: December 22, 2017, 02:23:25 PM »
Very strange;

Indeed, I went ahead and copied the contents of that FSM into a brand new one, and it worked just fine; i guess it must've been corrupted somehow like you said, it's been in the project for a long time!

Anyway, i hope nobody else gets this problem, thanks for helping me with the issue!

Farwest

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
Re: Reset on disable causing problems [SOLVED]
« Reply #5 on: August 02, 2021, 10:50:25 AM »
Unfortunately I have the same problem, I am on 1.9.0.p4.

If Reset on Disable is unchecked, many states are ignored except the last, not even making the first run at all. I came to this thread when I was looking for a workaround, such as an action that I can manually switch Reset on Disable but I couldn't find that yet too. 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Reset on disable causing problems [SOLVED]
« Reply #6 on: August 04, 2021, 07:10:36 AM »
Hi.
I got some actions i made to enable/disable the reset (see attachment below)

But did you try to copy the fsm as stated in homeworld's last post?

As i think even you use these actions you might still have issues.