Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: ShawnMcCool on February 11, 2012, 01:11:00 PM
-
I have a character manager FSM. When a character needs added to a scene an event is sent. It needs to know which character to add and then I need to set a few variables using script methods. The problem that I see here is that I need to pass a parameter in some capacity.
So.. This is what I have now.
Global Variable: Character Type (String)
I first set the Character Manager variable "New Character Type".
I send the "Add Character" event to the Character Manager.
This seems clumsy. What am I missing?
-
You could use Event Data instead of a global variable. Use Set Event Data to set some parameters, then the character manager FSM could use Get Event Info to get the event data. Seems a little cleaner...
EDIT: Or depending on the number of character types you have, just make an event + state for each one. Then you can also do custom setup on each character type. E.g.. A MakeSoldier state that has a global transition with a MakeSoldier event. Now just send MakeSoldier to the character manager FSM. CharacterFactoryFSM might be a better name...
-
The event data solution is definitely better. The issue is that there are something like 100 character types. That's a specific need for this design.