playMaker

Author Topic: Fsm getting stuck on simple state  (Read 4802 times)

sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
Fsm getting stuck on simple state
« on: February 06, 2013, 08:21:36 PM »
I'm suddenly having a weird problem I can't seem to debug. I have an FSM that has always worked before, but is now getting stuck on a very simple state and refusing to continue. The state in question has 3 SendMessage actions (all set to UseOwner and does not require reciever) and a GetComponent message. When the state is entered, nothing happens, the state just freezes. In the editor the first action is grey, the rest are stuck green, but the first action never actually fires either.

Any idea how to even begin debugging this? There are no errors in either the playmaker log or the unity log, and the exact same state is working fine in other fsms (I am reorganizing my fsms to be somewhat hierarchical, but this is happening without any subFsms even being enabled). Any help would be much appreciated.

-Sean

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Fsm getting stuck on simple state
« Reply #1 on: February 06, 2013, 11:23:33 PM »
Are you using the beta? Can you email me the project with repro steps?


sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Fsm getting stuck on simple state
« Reply #2 on: February 06, 2013, 11:25:22 PM »
I'm in 4.1. I'll see if I can make a small repro project, since the project its in is over a gig.

sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Fsm getting stuck on simple state
« Reply #3 on: February 06, 2013, 11:52:07 PM »
Actually, I figured out what's causing it... maybe I'm using it wrong. I have one main FSM and a disabled FSM that is on another game object, which is a child of the main object (where the main FSM is). This main FSM, when it enters the idle state, enables the child fms (patrol). That state (where it enables the patrol fsm) then checks every few frames (I have a custom action that does this) to see if it detects a target, at which point it leaves the state and sets the target (this all works fine). The issue is that if I leave "Reset On Exit" checked for the Enable FSM action, it causes it to lock up on the first SendMessage action in the next state. Oddly, if the first action in the next state is a GetComponent action, that one triggers, but the SendMessage actions still freeze.

Anyway, sending a repro project is going to be tricky, but if necessary I can try to figure it out. Before I do though, I wanted to make sure it wasn't obvious based on that extra info (either what the problem is, or what I'm doing wrong). Thanks.

More Info:

I actually found I can leave Reset on Exit on if I move that action to the bottom of the action list. Not sure if its being the last action, or if its being after my custom action that causes it to start working, but that's what is happening.
« Last Edit: February 06, 2013, 11:57:54 PM by sgoon »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Fsm getting stuck on simple state
« Reply #4 on: February 06, 2013, 11:59:45 PM »
I'll try to build a repro from your description. But if you have time, a small repro project would be most appreciated :)

When you said subFSMs I though you were using the 1.5.0 Playmaker beta? Or do you mean organizing FSMs in a gameobject hierarchy?

sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Fsm getting stuck on simple state
« Reply #5 on: February 07, 2013, 12:12:25 AM »
ah, sorry, yeah, just organizing them myself as a gameobject hierarchy. you have successfully piqued my interest about 1.5 now though ;) Anyway, yeah, I don't have time tonight to make a repro project, but if you're unable to repro it easily let me know and I'll set some time aside to set one up tomorrow. I'd just send you my custom action, but its so tied into my other classes/scripts that it would quickly snowball into a full repro project anyway.

sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Fsm getting stuck on simple state
« Reply #6 on: February 07, 2013, 01:20:10 AM »
So turns out I had time, and by that I mean I grossly over-estimated how much work it would take to pull my custom action out of the project. Extremely tiny, simple repro project headed your way via email.

shaken

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Fsm getting stuck on simple state
« Reply #7 on: August 28, 2013, 06:14:31 PM »
Alex,

Was there any progress made on this bug?  I'm seeing this same thing in my project, where after leaving a state where "Reset on Exit" is used, it hangs up on the next SendMessage, or alternatively, doesn't hang on the SendMessage, but fails to actually send the message.

In testing this, I also found that in instances where the SendMessage fails (not hangs), if I put an FSM breakpoint in the state with the SendMessage, the SendMessage will succeed.  So for whatever reason the SendMessage is just being skipped over.

I'd tell you what version of PlayMaker I'm currently using... but I can't seem to locate where the version number is shown.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Fsm getting stuck on simple state
« Reply #8 on: September 07, 2013, 11:26:44 PM »
Main menu > PlayMaker > About...