playMaker

Author Topic: Changing Global Variables on different FSM's(solved)  (Read 1609 times)

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Changing Global Variables on different FSM's(solved)
« on: April 11, 2013, 07:48:53 AM »
Hi everyone, I am trying to figure something out.
I have 2 different game managers.
The first one sets a GUI, and displays an INT number from a global variable.
The second game manager has a state that does an INT ADD, and changes a global variable that is showing on the first game managers gui.
When I change the global int on the 2nd game manager, it does not update the gui on the first game manager.
How can I get this to work?
I hope this makes sense.
« Last Edit: April 11, 2013, 08:54:08 AM by Kaneydien »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2494
  • Mender of the past
    • View Profile
    • Cleverous
Re: Changing Global Variables on different FSM's
« Reply #1 on: April 11, 2013, 08:27:21 AM »
If you're using GUILayout Int Label and selecting the global then it should reflect any changes to that int.

The other FSM can make any change to the int by Int Add/Int Divide/Int Subtract, whatever and it will reflect that in the GUI.

Make sure you're selecting the Global Int instead of a local int to that FSM. If it still isn't working can you post some screenshots of the FSM/Actions?

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Changing Global Variables on different FSM's
« Reply #2 on: April 11, 2013, 08:41:56 AM »
make sure the GUI FSM is being updated per frame (or per second) if its only run once it wont update the GUI again

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Changing Global Variables on different FSM's
« Reply #3 on: April 11, 2013, 08:53:54 AM »
Ah, I forgot to have it update once per frame. Thanks!
Im very new to playmaker, and programing for that matter lol.
Thanks everyone, this is such a great and helpful community!