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 SetGlobalVarInt not working
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#3
RE: SetGlobalVarInt not working

(07-03-2016, 10:50 PM)Darkfire Wrote: (snip)

It has to be a global variant as it taking place is across multiple maps, otherwise I would have stuck with the local as I have successfully used it in the past.

Anyway, I discovered 2 flaws with my original script which I fixed, 1) in my 'if' part of the script I had Local instead of Global, and 2) I realised if the command 'SetGlobalVarInt("DRDoor",0);' was in the OnStart section it would reset to 0 every time the map was loaded, so I put it inside one of my collide callbacks instead.

So I fixed these issues but it STILL wont work! This is really frustrating as I actually thought i'd cracked it. Can anyone see what is wrong now? Just for clarity this is what I now have:

map 1#:

Quote:void OnStart()

{
CheckDRDoor();
AddEntityCollideCallback("Player", "ScriptArea_1", "Creak", true, 1);
}

void CheckDRDoor()
{
if(GetGlobalVarInt("DRDoor") == 1)
{
SetLevelDoorLocked("level_wood_2", false);
}
}

void Creak(string &in asParent, string &in asChild, int alState)

{
PlaySoundAtEntity("", "afx_mans_hallquake_postdetail.snt", "ScriptArea_4", 0, false);
StartScreenShake(0.02f, 4.0f, 1.5f, 3.0f);
SetGlobalVarInt("DRDoor",0);
CreateParticleSystemAtEntity("", "ps_dust_falling_mansion_quake_landing.ps", "AreaDust_1", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_mansion_quake_landing.ps", "AreaDust_2", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_mansion_quake_landing.ps", "AreaDust_3", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_mansion_quake_landing.ps", "AreaDust_4", false);
}

map #2:

Quote:void OnStart()
{
SetEntityPlayerInteractCallback("ExamineArea_1", "UnlockDoor", true);
}

void UnlockDoor(string &in asEntity)

{
SetMessage("Messages", "DoorNowUnlocked", 3);
PlaySoundAtEntity("", "lock_door.snt", "level_wood_5", 0, false);
SetEntityActive("ExamineArea_1", false);
AddGlobalVarInt("DRDoor", 1);

}

(This post was last modified: 07-04-2016, 10:14 AM by serbusfish.)
07-04-2016, 01:12 AM
Find


Messages In This Thread
SetGlobalVarInt not working - by serbusfish - 07-03-2016, 09:59 PM
RE: SetGlobalVarInt not working - by Darkfire - 07-03-2016, 10:50 PM
RE: SetGlobalVarInt not working - by serbusfish - 07-04-2016, 01:12 AM
RE: SetGlobalVarInt not working - by Lizard - 07-04-2016, 11:04 AM
RE: SetGlobalVarInt not working - by serbusfish - 07-04-2016, 01:55 PM
RE: SetGlobalVarInt not working - by Romulator - 07-04-2016, 02:00 PM
RE: SetGlobalVarInt not working - by serbusfish - 07-05-2016, 08:35 PM
RE: SetGlobalVarInt not working - by Darkfire - 07-04-2016, 04:30 PM
RE: SetGlobalVarInt not working - by Daemian - 07-06-2016, 01:59 AM
RE: SetGlobalVarInt not working - by Mudbill - 07-06-2016, 02:27 AM



Users browsing this thread: 2 Guest(s)