playMaker

Author Topic: Access Global Variables via Script. [SOLVED]  (Read 3125 times)

Murcho

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 54
Access Global Variables via Script. [SOLVED]
« on: October 11, 2011, 07:21:52 PM »
Is there an easy way to access Global Variables through the scripting interface?  I've setup scripts before to access Variables located in specific FSMs, but haven't been able to work out how to access the Glopal Variables.
« Last Edit: November 30, 2011, 10:46:58 PM by alexchouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Access Global Variables via Script.
« Reply #1 on: October 12, 2011, 01:27:26 AM »
Use: FsmVariables.GlobalVariables to get the global FsmVariables.

For example:

var globalVariables = FsmVariables.GlobalVariables;
var numLives = globalVariables.GetFsmInt("numLives");

Away from my computer, so haven't tested, but that should work...

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Access Global Variables via Script.
« Reply #2 on: November 05, 2011, 02:50:11 PM »
Did this work for you?