playMaker

Author Topic: Send Event not working.  (Read 2048 times)

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 110
Send Event not working.
« on: November 28, 2012, 09:14:47 AM »
Greetings.

I'm trying to make an FSM send an event to another one, to control when to transit to another state. I need some operations done before this transition, so the best thing I can think to achieve it is to control it using events. This used to work for me in other projects, but here... :/

This is the issue: I have a Player FSM and a equipment list FSM. The player is initialized with its stats, and the equipment list will modify them depending on the pieces it has. The player sends the event 'InitEquipStatsEv' so the equipment FSM can start to work. After retrieving the params, the equipment machine sends the event 'AddStatsFromEqpEv' so the player knows that, for the umpteenth piece of equipment, the stats add have been retrieved and they can be applied. After doing so, the player sends the 'ContinueListProcessEv' so the list can repeat the process to the next piece, if any. That's the dude I want to catch. I get the transition to the 'SendSignalToList' state, which sends the event to the list FSM, but that FSM does not transit upon receiving the event. I made sure the list FSM is already in the state that transits with that event, but, for some reason, that transition isn't made.

Anything I'm skipping?

Thanks in advance.

[Update - Nov 28]
Solved the thing delaying the event sending to 0.5segs (gonna try with less time). However, this should work with no delay, I guess, since I'm ensuring the states are the right ones to perform the transitions. Although I solved my issue, I'd like to have some feedback from my inital work, so I won't mark this as solved yet.
« Last Edit: November 28, 2012, 09:34:15 AM by DARK_ETERNAL »
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8

Kwak

  • Guest
Re: Send Event not working.
« Reply #1 on: April 27, 2013, 07:14:03 PM »
Thanks for the delay tip!

According this nice (but broken) tutorial It should have worked without delay. The game skipped sending the Platform_Add events when it starts, but the delay did the trick. Some other stuff in the tutorial was broken too, but that I could fix.