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
"SetGlobalVarInt" Problem
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#1
"SetGlobalVarInt" Problem

okay i have a huge problem with "SetGlobalVarInt".
i heard that it could cause problems to use "AddGlobalVarInt", so i just use Set.

each time i run the custom story, it gives me an error that says, "LanternInt is not declared"


please help, since i don't know what to do anymore.

the code(left out unneccesarys):


void OnStart()
{
SetGlobalVarInt("LanternInt", 0);
}

void OnEnter()
{
if(GetGlobalVarInt(LanternInt) == 0)    
{    
SetLevelDoorLocked("level_dungeon_1", true);
}

if(GetGlobalVarInt(LanternInt) == 1)
{    
SetLevelDoorLocked("level_dungeon_1", false);    
}
}
(This post was last modified: 08-23-2012, 07:22 AM by bjaffedj.)
08-22-2012, 09:15 PM
Find
shadowZgamerZ Offline
Junior Member

Posts: 18
Threads: 3
Joined: Jul 2012
Reputation: 1
#2
RE: "SetGlobalVarInt" Problem

Try this:

void OnStart()
{
SetGlobalVarInt("LanternInt", 0);
}

void OnEnter()
{
if (GetGlobalVarInt("LanternInt") == 0)
{
SetLevelDoorLocked("level_dungeon_1", true);
}

if (GetGlobalVarInt("LanternInt") == 1)
{
SetLevelDoorLocked("level_dungeon_1", false);
}
//Watch out for these ones: ""
}

- I hope i didn't spell something wrong, because I am writing this on my phone! Hope this helped!

Project: Another Penumbra Story - Chapter 1 - Deep Underground
Level Editor: 18%, Scripting: 8%, Gameplay: 3 hours or more!
(This post was last modified: 08-22-2012, 09:42 PM by shadowZgamerZ.)
08-22-2012, 09:34 PM
Find
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#3
RE: "SetGlobalVarInt" Problem

THANK YOU SO MUCH! i see now that im a idot -.-
08-22-2012, 09:48 PM
Find




Users browsing this thread: 1 Guest(s)