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
Why is this lock script not working?
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#1
Why is this lock script not working?

In the level, the key will not unlock the doors. Not even one. And i cant work out why.
Any aid is appreciated.
Quote:void OnStart()
{
AddUseItemCallback("", "KeyLobby", "Door1", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "KeyLobby", "Door2", "UsedKeyOnDoor2", true);
AddUseItemCallback("", "KeyLobby", "Door3", "UsedKeyOnDoor3", true);
}

void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door1", 0, false);
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door2", false, true);
PlaySoundAtEntity("", "unlock_door", "Door2", 0, false);
}

void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door3", 0, false);
}
02-19-2011, 06:45 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#2
RE: Why is this lock script not working?

If I remember correctly I think you need to do SetSwingDoorLocked("NameOfDoor", false, false);

I believe what you are doing is having the key Lock the door instead of Unlock the door. Does the sound play?
(This post was last modified: 02-19-2011, 08:18 AM by Selyp.)
02-19-2011, 08:17 AM
Find
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#3
RE: Why is this lock script not working?

(02-19-2011, 08:17 AM)Selyp Wrote: If I remember correctly I think you need to do SetSwingDoorLocked("NameOfDoor", false, false);

I believe what you are doing is having the key Lock the door instead of Unlock the door. Does the sound play?

A sound plays, yes...
Ill alter the script
02-19-2011, 09:34 AM
Find
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#4
RE: Why is this lock script not working?

BAH im an idiot. The doors are Level Doors, and thats a script for regular doors.
*Facekick*
02-20-2011, 09:57 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#5
RE: Why is this lock script not working?

(02-20-2011, 09:57 AM)Chilton Wrote: BAH im an idiot. The doors are Level Doors, and thats a script for regular doors.
*Facekick*

Ha it took me a while to figure that one out once too. Tongue

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
02-20-2011, 10:15 AM
Find




Users browsing this thread: 1 Guest(s)