playMaker

Author Topic: Sending Multiple Events[SOLVED]  (Read 2225 times)

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
Sending Multiple Events[SOLVED]
« on: November 18, 2013, 09:48:41 AM »
Hi everyone. I am trying to figure out how to get my FSM to handle being sent multiple events at the same time.
Here is the breakdown of what I am trying to do:
I have 6 cubes, when the scene starts one randomly gets picked out and popped up in the air, then it loops back immediately and picks another random cube. During that cubes "popped up" state, I have a 3 second wait period that is handled by a second FSM that is set up to handle all of the wait periods. However, once one is called and is sitting in that Wait period, none of the others can be called.
How can I fix this, or is there a better way to be doing this (I am sure there is but I'm new to programing).
Any help would be appreciated. Thanks!
« Last Edit: November 19, 2013, 12:53:17 AM by jeanfabre »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Sending Multiple Events
« Reply #1 on: November 18, 2013, 09:54:03 AM »
So to be clear, you're trying to make a random cube jump in the air every 3 seconds?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Sending Multiple Events
« Reply #2 on: November 18, 2013, 12:29:14 PM »
What I want is for multiple cubes to be jumping in the air at random (it's a whack a mole game style), but when one cube is already in the air I want it to be skipped until that animation is completed.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Sending Multiple Events
« Reply #3 on: November 18, 2013, 02:24:11 PM »
Just handle the movement on the cubes then. You can send a transition event to an object and if its in a state that does not contain a transition event named that, then nothing will happen. Just set the cubes up where they have an [Idle] and a [Jumping] state. [Idle] would have a transition named DoJump, while Jumping only has a FINISHED transition that loops back to idle when the animation is finished.

That way, you can have a controller FSM sending DoJump events to random objects and they simply won't respond if they're actually jumping. You could also check at the controller FSM what state the selected object was in so that you could confirm it is not jumping, then skip that object if you want, to be more technically correct.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Sending Multiple Events
« Reply #4 on: November 18, 2013, 04:39:37 PM »
I tried your suggestion and now its working. Thanks Lane!