Playmaker Forum

PlayMaker Feedback => Feature Requests => Topic started by: ciabaros on April 13, 2013, 01:51:16 AM

Title: Passing FSMs as Variables (new 'Fsm' varaible type)
Post by: ciabaros on April 13, 2013, 01:51:16 AM
I believe that there should be a new Fsm Variable/Parameter type for directly storing/passing "Fsm" object references. The manual assignment of this variable (or action parameters of this type) would pop up an FSM picker, almost identical to the current PlayMaker "FSM Browser" (easy implementation reuse?).

Why not use FsmObject with SubType "PlayMakerFSM"?

Why This Came Up:
I've recently implemented 2 custom actions, which (to me) revolutionized what I can do with PlayMaker in treating/running ANY other FSM AS a Sub-FSM from within a single state using actions:

But I noticed that now, having a reasonable arsenal of actions that operate on FSMs, defining the GO, and FSMName every time is kinda ugly (as EnableFSM does). With an "Fsm" type variable/parameter, you could further separate Fsm-operating actions into proper atomic ones, such as:

Additionally, this would allow the current "RunFSM" Action to simply output the SubFSM instance into a variable, rather than having to retrieve by the current intended "StoreID", which would then be an unnecessary complication.

More Information About the Proposed "Any FSM as SubFSM" Pattern:
I'll create an appropriate topic for this in the right section, and provide a reference to it from here once done, in case anyone's interested in why I'm so jazzed about it.
Title: Re: Passing FSMs as Variables (new 'Fsm' varaible type)
Post by: jeanfabre on April 15, 2013, 01:20:41 AM
Hi,

 yes, I too would enjoy storing the Fsm component reference directly. This would also allow hopefully for a better management when referecing fsm's an variables on a prefab, because at the moment, if you use "set fsm string" for example on prefab unknown during edit time, then you have to hardcode the fsm name and variable name, and it will not be refactored if you change it, so that's a real potential for byd bug if you forget about this loose referencing.

It's indeed a difficult situation here, maybe reference the fsm from a template would help the refactoring.

bye,

 Jean