Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: miki3d on June 25, 2012, 08:11:02 AM
-
Hi all!
I'm just trying to figure out how to send multiple events in the same state, I attach a screen for explain this.
(http://img854.imageshack.us/img854/3762/eventss.jpg) (http://imageshack.us/photo/my-images/854/eventss.jpg/)
In another fsm I have a button that send the startspawn event to the fsm above.
Then I want to send three events, one that start a sound, one that switch on a light and the third that spawn enemies.
The problem is that with my way only the event on the top of the stack (OpenDoor) works :(
Maybe It's not the right way...any suggestion?
Really thanks :)
-
Hi,
Untick the everyframe property of your send event actions. you 99.99% the case never want that
if you do want to maintain a signal, consider building a start and end event so that other fsm know they enter a specific context and wait for the related end event to quit that context.
Else, simply send an event once, I never send an event on each update, this is not very good practice ( I feel )
Bye,
Jean
-
Hi,
Untick the everyframe property of your send event actions. you 99.99% the case never want that
if you do want to maintain a signal, consider building a start and end event so that other fsm know they enter a specific context and wait for the related end event to quit that context.
Else, simply send an event once, I never send an event on each update, this is not very good practice ( I feel )
Bye,
Jean
Ops! I was wrong, I was doing a test with every frame checked but I really don't want this, I updated the correct screenshot :) sorry
-
Hi,
the problem I see is that you don't implement them events in your fsm and you do specify for each of these events "self" as the target, which means that you should have states defining them events as "global transition"
Where are you implementing "OpenDoor" "soundLight" and "ActivateLight" I guess they are on other Fsm right? so you should change the target to point to the Fsm or gameObject that implement them events.
Bye,
Jean
-
Hi,
the problem I see is that you don't implement them events in your fsm and you do specify for each of these events "self" as the target, which means that you should have states defining them events as "global transition"
Where are you implementing "OpenDoor" "soundLight" and "ActivateLight" I guess they are on other Fsm right? so you should change the target to point to the Fsm or gameObject that implement them events.
Bye,
Jean
I think you're right...now I don't have one fsm for each object but I tried to do everything with one fsm.
I have a node with this fsm and other objects (door, light..) are child of it, then i refer to these objects from the main fsm (each event go to a state where I manage each object, as you can see in the screenshot).
Maybe it's not the right way :)...I'll try to put one fsm in each object and then send events to them from the main fsm as you sad :)
Thanks a lot!!!
Mik
-
Hi,
yes, try that.
the basic underlying assumption is that when you send an event to a target, the target ought to implement that event as a global transition ( it can also be a transition on the current state, but I rarely go down that route as it feels wrong, but that works)
bye,
Jean