playMaker

Author Topic: [SOLVED] Getting variables from another FSM?  (Read 5015 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
[SOLVED] Getting variables from another FSM?
« 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.
« Last Edit: June 06, 2013, 06:53:27 AM by ryf9059 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Getting variables from another FSM?
« Reply #1 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: [SOLVED] Getting variables from another FSM?
« Reply #2 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?
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Getting variables from another FSM?
« Reply #3 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: [SOLVED] Getting variables from another FSM?
« Reply #4 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?

« Last Edit: October 11, 2017, 05:17:51 AM by krmko »
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: [SOLVED] Getting variables from another FSM?
« Reply #5 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: [SOLVED] Getting variables from another FSM?
« Reply #6 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.
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Getting variables from another FSM?
« Reply #7 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: [SOLVED] Getting variables from another FSM?
« Reply #8 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.
Available for Playmaker work