Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: spiceflo on January 19, 2018, 06:08:23 PM
-
Hi,
Description
I fill the variable actionId from a global variable actionId in the state "GetVariablesFromScript". After the Finished Event it transists to the next State "SelectAction". In this state I want to select an Event over "Int Switch" compared with the (local) actionId. If actionId is 1, then it should transits to the state "Command".
Problem
If I set a breakpoint to the State "SelectAction" everything works (with actionID = 1). Without a breakpoint on that State, my FSM stops on State "SelectAction" and it seems that the actionID is 0 and no Event will be fired.
Thank you very much and best regards
Florian
Screenshots without breakpoint
(http://public.10fruits.com/playmakerForum/2018-01-19/wo_breakpoint_FSM.png)
(http://public.10fruits.com/playmakerForum/2018-01-19/wo_breakpoint_log.png)
Screenshots with breakpoint
(http://public.10fruits.com/playmakerForum/2018-01-19/wi_breakpoint_FSM.png)
(http://public.10fruits.com/playmakerForum/2018-01-19/wi_breakpoint_log.png)
-
Hi,
it seems that the FSM is too fast. If I add "Wait" in Action Browser with 0.1 seconds and the event "Finished" everything works fine.
But why do I need this 0.1 seconds? I thought that the Finished Event starts automatically, when the previous Actions are finalized.
Thanks and best regards
Florian
-
Only the "Finished" event transitions automatically.
So it would seem when your int is 0 the corresponding event is not called?
What if you change the bottom switch to "selectResearch" to 0 instead of None, does that make a difference?
Instead of a wait you can also use a "Next frame event"
-
Hi,
here is the solution:
I have a C# Script which fills the global variables and starts the Event in the FSM. In the C# Script, in the first stept you have to fill the global variable, and after that, you start the Event of the FSM.
Otherwise, you start first with the Event, and it takes too long too fill the global variables over the script.
Thanks for your feedback
Florian
-
But why do I need this 0.1 seconds? I thought that the Finished Event starts automatically, when the previous Actions are finalized.
If you have multiple actions in 1 state they will start from top to bottom.
But they will not wait if the action above a finalized, unless you have enabled 'action sequence' (right click to enable)
(https://i.imgur.com/LeQRSDS.gif)