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 Doors & Keys
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#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
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#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");
}

Ba-da bing, ba-da boom.
(This post was last modified: 07-24-2011, 03:20 AM by JenniferOrange.)
07-24-2011, 03:09 AM
Find
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#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
JenniferOrange Offline
Senior Member

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

Haha, no problem. Smile Happy mapping!

Ba-da bing, ba-da boom.
07-24-2011, 03:34 AM
Find




Users browsing this thread: 1 Guest(s)