Angerpull
Member
Posts: 88
Threads: 24
Joined: Jun 2011
Reputation:
0
|
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 |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
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 |
|
Angerpull
Member
Posts: 88
Threads: 24
Joined: Jun 2011
Reputation:
0
|
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 |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Level Doors & Keys
Haha, no problem. Happy mapping!
Ba-da bing, ba-da boom.
|
|
07-24-2011, 03:34 AM |
|
|