Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Tricky_Widget on July 11, 2015, 11:10:39 AM
-
I'm writing a custom action, and I need to reference other variables in the current FSM by name. I've been doing a lot of searching, and it seems like everyone uses something like this:
FsmInt intVariable = this.Fsm.FsmVariables.GetFsmInt("Name");
But when I try that code myself, I get this error:
error CS1061: Type `HutongGames.PlayMaker.Fsm' does not contain a definition for `FsmVariables' and no extension method `FsmVariables' of type `HutongGames.PlayMaker.Fsm' could be found (are you missing a using directive or an assembly reference?)
I'm baffled by this, as a Google for "Fsm.FsmVariables" turns up 328 results. It seems like "Fsm" really should contain a definition for "FsmVariables", and yet for me it insists that it does not.
Does anyone have any idea what I'm missing?
Thanks!
-
Hi, maybe add .Value
what are you trying to make?
Did you check the EcoSystem (https://hutonggames.fogbugz.com/default.asp?W1181) for custom actions?
-
Hi, maybe add .Value
what are you trying to make?
Did you check the EcoSystem (https://hutonggames.fogbugz.com/default.asp?W1181) for custom actions?
I'm working with the 1.8 beta and I'm using the new array variable type. I'm trying to make a sort of poor-man's multidimensional array by making a structured way to refer to a group of individual arrays. But to do that, I need to get references to the various arrays in that group. Ultimately I think I'm looking for something like Fsm.FsmVariables.GetFsmArray("Name"), but I figured that would confuse everyone who's not in the beta. :)
-
Hi,
I Think you should ask on the beta forum then.
many things are changed on 1.8
-
I Think you should ask on the beta forum then.
many things are changed on 1.8
Well, I tried it in 1.7.3 and got the same result, so it's not a beta thing. However, I dug up the API Reference (https://hutonggames.fogbugz.com/default.asp?W1098) and discovered that FsmVariables is a type. And the way to get the current one is "Fsm.Variables". Which works like a charm.
How on earth all those "Fsm.FsmVariables" examples I saw works remains a mystery. But "Fsm.Variables" is the answer I needed. :)