Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: xeondream on June 15, 2012, 04:55:34 AM

Title: [solved] passing variables from custom script to fsm
Post by: xeondream on June 15, 2012, 04:55:34 AM
hi all, i got a custom script with say this string variable "abc". how do i pass it to playmaker fsm so that i can set my string from custom script to my global variable string in my fsm?
Title: Re: passing variables from custom script to fsm
Post by: jeanfabre on June 15, 2012, 05:26:15 AM
Hi,

 There is a script example showing how to achieve this:

http://hutonggames.com/playmakerforum/index.php?topic=1733.msg7631#msg7631 (http://hutonggames.com/playmakerforum/index.php?topic=1733.msg7631#msg7631)

Basically you need to

1: be using HutongGames.PlayMaker
2: create a public variable of type FsmComponent (let's call it "myFsm", where you can then drag a fsm component on it
3: access its variables like so:

myFsm.FsmVariables.GetFsmString("my string variable").Value = "hello"

or string myString = myFsm.FsmVariables.GetFsmString("my string variable").Value ;


Bye,

 Jean
Title: Re: passing variables from custom script to fsm
Post by: xeondream on June 15, 2012, 06:03:49 AM
thanks jean. it works ^^.
Title: Re: [solved] passing variables from custom script to fsm
Post by: lalamax3d on August 10, 2013, 04:14:58 AM
thanks
it helped..