playMaker

Author Topic: Disabled FSM still runs?  (Read 2703 times)

kavery

  • Full Member
  • ***
  • Posts: 149
Disabled FSM still runs?
« on: July 24, 2019, 06:51:10 PM »
I have an FSM that is set to disabled. Nothing activates it. Its has a box collider. When I run the game it still shows being active! And does the actions. Never seen this.

Unity 2018.4
PM 1.9.0 p18

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Disabled FSM still runs?
« Reply #1 on: July 25, 2019, 02:03:43 AM »
Hi,

p18 are you sure? is it not 1.9.0P17 instead?

Is it disabled at the start of the scene or do you disable it on the fly?

 can you check from which state it started to execute action when it's disabled?

Are you sure it's not disabled/enabled multiple times per frame, like conflicting logic that turn it on and off concurrently?

Bye,

 Jean


kavery

  • Full Member
  • ***
  • Posts: 149
Re: Disabled FSM still runs?
« Reply #2 on: August 02, 2019, 01:38:07 AM »
Hmm I'm having it again.

1.9 p18, Unity 2018.4.5

I thought maybe what happened was it was being de-activated by itself at runtime after running a couple states, but 'reset after exiting' was turned on. Still wouldn't make sense that it would be active. 

But now I'm having it again and that's not the case. Very simple trigger state, FSM clearly off (I can toggle it on, and off at will - no on every frame entanglement), but the state is live, and it indeed triggers when collided! So strange.

One more important point, if I check on the fsm component, and check it off again (through action or manually with mouse) it disables and does not trigger.

I deleted the FSM and rebuilt it, does not have the problem. The problem FSM was a duplicate of another GO, I stripped the states and kept only the first 2 states.
« Last Edit: August 02, 2019, 01:50:29 AM by kavery »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Disabled FSM still runs?
« Reply #3 on: August 08, 2019, 01:58:35 AM »
Hi,

 first of all, please do not use the system events for your own logic, the FINISH event should never be used inside an action or called programmatically, it's only here to be used as a transition on a state when all action have finished.

so can you replace that with your own event like "HAS TRIGGERED" or something and see if it does that again?

Also, is this fsm truly off when the app starts? could it be that it's on and you turn it off slightly too late? can you explain your procedure?


Bye,

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Disabled FSM still runs?
« Reply #4 on: August 18, 2019, 03:35:50 PM »
Hi,

 first of all, please do not use the system events for your own logic, the FINISH event should never be used inside an action or called programmatically, it's only here to be used as a transition on a state when all action have finished.

I use it in a dirty way, to circumvent a whole state.  :-[
This has worked perfectly thus far. That's because I'm lazy to create a new event for this when I know the state is obviously, by its name, doing a verification and potentially other things inside itself if the condition is met/not met.
Typically, I do a verification of some kind at the top of the state, and if the condition is not verified or if it is, it activates FINISHED and avoids all the rest of the state's actions.
However that's a personal thing, only to be done if you really know your FSMs by heart.


On the topic, the action Finish FSM is a nasty piece of ******.
Ok. Right now I can't check what happens, but I know there's a disconnect between the [DISABLED] status and the ticked box relative to the FSM as a component on the game object.
I also observed in 1.8 that I could not reactivate a FSM deactivated that way; iirc, I had to use the Activate component action in deactivate mode to make things work properly. I'll have to check that later on, don't take my word on it. I just know I encountered issues on this; both regarding the UI showing what is active or not, and the FSM being somehow locked into a disabled mode with no possibility to reactivate it later on.
Will redo a test quickly later on.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Disabled FSM still runs?
« Reply #5 on: August 19, 2019, 02:22:24 AM »
Hi,

 first of all, please do not use the system events for your own logic, the FINISH event should never be used inside an action or called programmatically, it's only here to be used as a transition on a state when all action have finished.

I use it in a dirty way, to circumvent a whole state.  :-[
This has worked perfectly thus far. That's because I'm lazy to create a new event for this when I know the state is obviously, by its name, doing a verification and potentially other things inside itself if the condition is met/not met.
Typically, I do a verification of some kind at the top of the state, and if the condition is not verified or if it is, it activates FINISHED and avoids all the rest of the state's actions.
However that's a personal thing, only to be done if you really know your FSMs by heart.


On the topic, the action Finish FSM is a nasty piece of ******.
Ok. Right now I can't check what happens, but I know there's a disconnect between the [DISABLED] status and the ticked box relative to the FSM as a component on the game object.
I also observed in 1.8 that I could not reactivate a FSM deactivated that way; iirc, I had to use the Activate component action in deactivate mode to make things work properly. I'll have to check that later on, don't take my word on it. I just know I encountered issues on this; both regarding the UI showing what is active or not, and the FSM being somehow locked into a disabled mode with no possibility to reactivate it later on.
Will redo a test quickly later on.

Hi,

 You are likely going to pay the hard price for this later :) this obfuscate the logic of your state.

FinishFsm is supposed to be used inside a running template via the action RunFsm. nowhere else. Can you confirm you are using it in this context?

Bye,

 Jean


Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Disabled FSM still runs?
« Reply #6 on: August 19, 2019, 10:06:06 AM »
You are likely going to pay the hard price for this later :) this obfuscate the logic of your state.

I make the state obvious about what it does so it kinda helps. If I'm less lazy I'll add a state later on and completely ruin my beautiful work of art. Each graph becomes a canvas for the expression of my higher enthusiastic self.

Quote
FinishFsm is supposed to be used inside a running template via the action RunFsm. nowhere else. Can you confirm you are using it in this context?

I can confirm my Lord. The explanation has been given!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Disabled FSM still runs?
« Reply #7 on: September 09, 2019, 02:33:42 PM »
Hi.
I have encountered a issue with a disabled fsm.

I had to test something without the fsm being active, so i disabled before starting the game.

but when i played it got activated.

I do know the reason in my case tho.

I have some events in my animations that are using 'Set State'
this seems to reactivate the fsm.

In my case it was only for testing and the fsm will never be activated so its fine.

But it could be that for example with a button OnClick event (set in the component) this could also happen.

i will do some more testing later and update.