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
Level door doesn't open. (SOLVED)
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Level door doesn't open. (SOLVED)

Hi.

I made a script that is supposed to unlock a level door.
The problem is that i can hear it unlock and the sanity boost works, but the door are still locked???


Here is the full script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Scary1", "TurnOff", true, 0);
AddUseItemCallback("", "Key2", "prison_2", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_2", false, false);
PlaySoundAtEntity("", "unlock_door", "prison_2", 0, false);
RemoveItem("Key2");
PlayMusic("10_puzzle02.ogg", false, 0.7, 0.1, 10, true);
RemoveItem("Key2");
GiveSanityBoost();
}

void TurnOff(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(100.0f, true);
PlaySoundAtEntity("", "react_pant6", "lamp", 0, false);
StartPlayerLookAt("ScaryArea1",5.0f,10.0f,"");
AddTimer("ScaryArea1_02",1.5f,"ScaryArea12");
SetLampLit("lamp", false, true);
SetLampLit("lamp_1", false, true);
SetLampLit("lamp_2", false, true);
SetLampLit("lamp_3", false, true);
SetLampLit("lamp_4", false, true);
PlayMusic("Skummellyd3.ogg", false, 1.0f, 0, 0, false);
AddTimer("LightOn",5.0f,"TurnOn");
AddTimer("LightOn2",3.0f,"TurnOn2");
}

void ScaryArea12(string& asEntityName)
{
StopPlayerLookAt();
}

void TurnOn(string &in asTimer)
{
PlayMusic("Normal.ogg", true, 1.0f, 0, 0, true);
SetLampLit("lamp", true, true);
SetLampLit("lamp_1", true, true);
SetLampLit("lamp_2", true, true);
SetLampLit("lamp_3", true, true);
SetLampLit("lamp_4", true, true);
GiveSanityDamage(5.0f, true);
SetMessage("IntroCategory", "Intro5", 5.0f);
}

void TurnOn2(string &in asTimer)
{
SetEntityActive("infected_1", false);
}

void NoteMemento(string &in asEntity)
{
AddQuest("questtest3","questtest3");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
SetupLoadScreen("LoadingText", "Loading_Library", 1, "images.jpg");
}
(This post was last modified: 03-05-2011, 10:10 PM by Henriksen.)
03-05-2011, 07:06 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#2
RE: Level door doesn't open.

A level door isn't a swing door, use
SetLevelDoorLocked(string& asName, bool abLocked);
instead.

03-05-2011, 07:24 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#3
RE: Level door doesn't open.

(03-05-2011, 07:24 PM)Pandemoneus Wrote: A level door isn't a swing door, use
SetLevelDoorLocked(string& asName, bool abLocked);
instead.

Ahh.

Thanks it works now Wink
03-05-2011, 10:10 PM
Find




Users browsing this thread: 1 Guest(s)