playMaker

Author Topic: How to Pass Data to SubFSM? [SOLVED]  (Read 2251 times)

ciabaros

  • Playmaker Newbie
  • *
  • Posts: 13
How to Pass Data to SubFSM? [SOLVED]
« on: April 13, 2013, 11:35:12 AM »
Regarding: The new SubFSM feature by use of "RunFSM", FsmTemplates, and "FinishFSM".

How can I send any data to a Sub-FSM initiated using "RunFSM"? By send data, I mean one of the following:
  • Set a variable on the SubFSM (which the master should understand, not the other way around)
  • Send an event (with standard event-data) to the SubFSM

Neither of which, I see any way of doing. Am I missing something? (I hope we're not limited to having to use mutually understood fully Global variables..)

Side Note: I've seen people make references to "sending data to SubFSMs" in contexts of other issues like the sub-sub-FSM not having the data propagated, etc., but no details.
« Last Edit: April 19, 2013, 12:43:47 AM by ciabaros »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Pass Data to SubFSM?
« Reply #1 on: April 16, 2013, 01:37:18 AM »
Hi,

 actually, both are implemented :)

 -- When you select a template in the RunFsm action, the action will present the fsm variables defin in the template you selected and you can feed values.

 -- The send event action has two new options for the "event target": Host Fsm and Sub Fsms.

 So you are covered :)

bye,

 Jean

ciabaros

  • Playmaker Newbie
  • *
  • Posts: 13
Re: How to Pass Data to SubFSM? [SOLVED]
« Reply #2 on: April 19, 2013, 12:43:18 AM »
LOL, I've earned by forum status just now :)

Didn't think of actually just try adding variables to my FSM Template. Works great. Thanks!