Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Doors & Keys
Author Message
Angerpull Offline
Member

Posts: 88
Joined: Jun 2011
Reputation: 0
Post: #1
Level Doors & Keys

Can keys open locked level doors? I tried it and it doesn work, the script is okay since I switched doors to try if there was something wrong with my script, but the key and the door worked fine but not the Level door. What's wrong?
(This post was last modified: 07-24-2011 03:28 AM by Angerpull.)
07-24-2011 02:29 AM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 424
Joined: Jun 2011
Reputation: 33
Post: #2
RE: Level Doors & Keys

Keys can in fact open level doors, but level doors are very very different from swing doors.
You have to use SetLevelDoorLocked(string& asName, bool abLocked); instead of SetSwingDoorLocked.
Ex:
void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofleveldoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofleveldoor", false);
SetLevelDoorLockedSound("nameofleveldoor", "door_level_wood_locked.snt");
RemoveItem("nameofkey");
}

[Image: button.png]
(This post was last modified: 07-24-2011 03:20 AM by JenniferOrange.)
07-24-2011 03:09 AM
Find all posts by this user Quote this message in a reply
Angerpull Offline
Member

Posts: 88
Joined: Jun 2011
Reputation: 0
Post: #3
RE: Level Doors & Keys

(07-24-2011 03:09 AM)JenniferOrange Wrote:  Keys can in fact open level doors, but level doors are very very different from swing doors.
You have to use SetLevelDoorLocked(string& asName, bool abLocked); instead of SetSwingDoorLocked.
Ex:
void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofleveldoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofleveldoor", false);
SetLevelDoorLockedSound("nameofleveldoor", "door_level_wood_locked.snt");
RemoveItem("nameofkey");
}

Holy potato canon, that worked! Thank you! I am so glad this site exists.
07-24-2011 03:23 AM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 424
Joined: Jun 2011
Reputation: 33
Post: #4
RE: Level Doors & Keys

Haha, no problem. Smile Happy mapping!

[Image: button.png]
07-24-2011 03:34 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)