playMaker

Author Topic: Actions in a State Execute Only at Startup [solved]  (Read 2763 times)

Pako

  • Playmaker Newbie
  • *
  • Posts: 3
Actions in a State Execute Only at Startup [solved]
« on: January 06, 2013, 01:51:08 PM »
Hi,

I'm trying to follow the "Pop Up Manager" Tutorial:

http://www.youtube.com/watch?v=sFG0kpCvxJ8&list=PLC759306A1E692A10&index=10

However, I can't get it to work, even though I've double checked that I've done everything right.  Now I'm wondering if it's a bug, or if there's something about PlayMaker that I'm not aware off.

Basically, I have two FSM's:

- The first FSM is attached to a cube, and makes the cube pop up (jump and rotate), as soon as its global "Pop Up" event gets triggered.  The cube is made into a prefab, and 9 cubes are then laid out in the scene, sitting on a plane.
-The second FSM is attached to a "PopUpManager" gameobject.  It has two states:
   a. "Wait" - wait between 0.3 to 2 seconds at random, and then fire the send_pop event to transition to the "Send Pop" state
   b. "Send Pop" - pick a cube object from the scene at random, trigger it's global "Pop Up" event, and then trigger a FINISHED event to transition back to "Wait".

Every time the state is "Wait" it's supposed to execute all actions, transition to "Send Pop", and loop again and again, each time popping up a cube at random.  However, the sequence is executed only after (at start up), and then "Wait" becomes the active state (forever), and it's actions are not executed.  Nevertheless, if I alt-click on "Wait" the actions (and the sequence) get executed, and each time the sequence stops at "Wait".

Is this a bug, or what am I missing?

I attach the 2 screenshots of the 2 states of the FSM attached to PopUpManager.


« Last Edit: January 06, 2013, 03:29:14 PM by Pako »

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: Actions in a State Execute Only at Startup
« Reply #1 on: January 06, 2013, 02:30:45 PM »
So what you're saying is that when you start the game, it works fine one time but when it goes back to the first stage for the second time, it stays there forever?
Remember, you don't fail unless you give up trying to succeed!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Actions in a State Execute Only at Startup
« Reply #2 on: January 06, 2013, 03:10:18 PM »

Pako

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Actions in a State Execute Only at Startup
« Reply #3 on: January 06, 2013, 03:13:36 PM »
@KozTheBossYes, exactly!

In fact, I experimented a bit more on a separate scene:

I used a single state machine hooked up on a GUI text object.  I used the "Random Float" and "Wait" actions on the starting state, in order to to simulate a similar setup as with the cubes.  On a 2nd state I just output a random number on the GUI Text Object.  Again, the problem is reproduced: a single number is output on the GUI text, and the -starting- "Wait" state becomes active forever, i.e. it's actions are not executed again (unless I force execution with alt-click, as is also the case with the cubes).

I attach the screenshots of the test FSM.


Pako

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Actions in a State Execute Only at Startup
« Reply #4 on: January 06, 2013, 03:27:00 PM »
This might be the problem:
http://hutonggames.com/playmakerforum/index.php?topic=2700.0



Yes, this was the problem!!!! It's working properly now.

Thanks for the bug fix  :)