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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Remove key after 3x uses
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#9
RE: Remove key after 3x uses

First of all, there are more than just Global and Local variables.
I would say there are also SubLocal.

And there are more differences than just map scope.

1) LocalVariables are not only visible in one map, they are also visible for every function in it.

2) SubLocal Variables, like
PHP Code: (Select All)
void OnStart()
{
string mySubVar "Whoa";

are visible only for the function and nothing else can reach it.

3) Don't even bother with Global.hps file. There is a difference between Global variables and Global.hps.

Just set the Global value as usual with:
PHP Code: (Select All)
SetGlobalVarInt("name"0);

// Might also interest you:
// AddGlobalVarInt("name", 1); adds the integer to the value
// GetGlobalVarInt(string& asName); returns the integer value 
in your normal map file, preferably at the puzzle sequence initialization. It is redundantly unnecessary to add it OnGameStart unless it's your first puzzle.
(This post was last modified: 05-08-2016, 07:57 PM by Spelos.)
05-08-2016, 07:55 PM
Find


Messages In This Thread
Remove key after 3x uses - by serbusfish - 04-26-2016, 10:30 PM
RE: Remove key after 3x uses - by WALP - 04-27-2016, 01:51 AM
RE: Remove key after 3x uses - by Daemian - 04-27-2016, 06:39 AM
RE: Remove key after 3x uses - by Spelos - 04-27-2016, 08:48 AM
RE: Remove key after 3x uses - by serbusfish - 05-05-2016, 12:29 PM
RE: Remove key after 3x uses - by WALP - 05-05-2016, 12:49 PM
RE: Remove key after 3x uses - by Darkfire - 05-06-2016, 02:46 PM
RE: Remove key after 3x uses - by serbusfish - 05-08-2016, 11:28 AM
RE: Remove key after 3x uses - by Spelos - 05-08-2016, 07:55 PM
RE: Remove key after 3x uses - by Mudbill - 05-08-2016, 10:33 PM
RE: Remove key after 3x uses - by Darkfire - 05-09-2016, 04:31 PM



Users browsing this thread: 1 Guest(s)