Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Local Variables - problem
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Local Variables - problem

(08-22-2011, 02:58 PM)Elven Wrote: I don't mind if you explain it properly. But I think I got it. My scripts are working all perfectly with no problem. Basically local works on one map, global works on all maps. Some kind of text, value or whatever thing, right Smile?

GetLocalVar<Type>() doesn't magically create a local function variable for you to use. You're supposed to store or use the return value of the function yourself.

For example:
string value = GetLocalVarString("steps");
if (value == "something")
     // do something...

// Or...
int value = GetLocalVarInt("steps");
if (value == 1)
     // do something...

// Or...
if (GetLocalVarInt("steps") == 1)
     // do something...

These functions are for the game to store in a save file (i.e. when the user or game saves). If you don't need these values to be saved by the game in a save file, then you can use normal variables.

Tutorials: From Noob to Pro
(This post was last modified: 08-22-2011, 06:45 PM by Your Computer.)
08-22-2011, 06:43 PM
Website Find


Messages In This Thread
Local Variables - problem - by Elven - 08-22-2011, 12:08 PM
RE: Local Variables - problem - by Kyle - 08-22-2011, 01:41 PM
RE: Local Variables - problem - by Elven - 08-22-2011, 02:58 PM
RE: Local Variables - problem - by Your Computer - 08-22-2011, 06:43 PM
RE: Local Variables - problem - by Elven - 08-22-2011, 06:47 PM



Users browsing this thread: 1 Guest(s)