Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ryf9059 on June 06, 2013, 04:15:14 AM

Title: [SOLVED] Getting variables from another FSM?
Post by: ryf9059 on June 06, 2013, 04:15:14 AM
How do I get a variable from another FSM? Supposely using global variable, but I cannot make a existing variable to a global one (at least I didn't find a way to). Also, to me the global variable looks like a static variable of kind, I don't want that, I just want a variable that belongs to one FSM and can be accessed by others through some means.
Title: Re: Getting variables from another FSM?
Post by: jeanfabre on June 06, 2013, 05:17:09 AM
Hi,

 yes, the naming is confusing, I agree.

-- you can access *ALL* fsm local variables, from anywhere. simply use actions like "Get/Set Fsm XXX"

-- you can not turn a local variable into a global variable, use the "global variables" window to manage global variables.

-- global variables, are infact static variables, you are right. they can be accessed by anything, anywhere.

Does that help getting a clearer picture?

bye,

 Jean
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: Fat Pug Studio on October 10, 2017, 10:04:48 AM
Damn, i made like a zillion of global variables, and now i had a problem that i had to solve by getting a variable from another FSM. I tried by using get fsm variable, but to no avail, and then i found out i can do it by using get fsm int/float/whatever.

That said, what is the difference between get fsm variable and get fsm variable of a certain type?
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: jeanfabre on October 11, 2017, 02:25:06 AM
Hi,

 I am not usre I am following you with your question on getting fsmvariables, can you rephrase?

 using global variables should be down tot he very strict minimum, if you end up with more than 10, there is a problem in your approach.

 Bye,

 Jean
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: Fat Pug Studio on October 11, 2017, 04:35:30 AM
Yeah, there is a problem with my approach, i was using global variables because i was afraid too new to delve deeper into playmaker innards. Also, mass editing and tweaking of variables is easier when they're global.

As for getting fsmvariables, i will rephrase. I am using Get FSM (Variable Type) to get a variable i want from another FSM, but i need to know the specific type i want to get, which is fine.

What is Get Fsm Variable used for?

Title: Re: [SOLVED] Getting variables from another FSM?
Post by: djaydino on October 11, 2017, 12:20:07 PM
Hi,
Quote
Get the value of a variable in another FSM and store it in a variable of the same name in this FSM.

From what i understand.

if you have for example a local int variable named "Score" on FSM 1

Then on FSM 2 you have also a local int variable named "Score"

Then you can use the action to get the value from  FSM 1 and place it directly to the same named variable on FSM 2
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: Fat Pug Studio on October 11, 2017, 02:14:24 PM
I have to check it out, i tried with FSM that don't have same variable names.
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: jeanfabre on October 12, 2017, 02:49:59 AM
Hi,

 GetFsmVariable will get you a pointer to that you can work with that variable, set or get its value, know its name or properties such as whether it's shown in the inspector or its category.

 bye,

 Jean
Title: Re: [SOLVED] Getting variables from another FSM?
Post by: Fat Pug Studio on October 13, 2017, 04:38:54 AM
Great, thanks for helping out both of you, that should cut the number of global variables a lot.