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
Key to open door on seperate level
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#1
Key to open door on seperate level

Hey everyone, i'm having trouble trying to figure out how to script the player picking up a key in one map and using that key to unlock a level door in a different map entirely. So far what I have is the player picks up a key in the east wing guest quarters, and they have to take that key to the lab and use it on a door to the upper levels. I have never done something like this before and I have tried it out myself with no luck, any help would be greatly appriectiated.
Thanks.
06-30-2012, 01:59 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#2
RE: Key to open door on seperate level

Use the script you would normally use to unlock a door, and place it in the script for the door's map. Use the internal name of the key you find in the other map.

Also, please use the Development Support forum for development help.

06-30-2012, 02:50 AM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#3
RE: Key to open door on seperate level

ok so should it look something like this?
void OnStart()
{
AddUseItemCallback("", "Key_Upper_Levels", "Upper_Levels", "UsedKey", true);
}
void UsedKey(string &in item, string &in door)
{
SetLevelDoorLocked("Upper_Levels", false, true);
PlaySoundAtEntity("", "unlock_door", "Upper_Levels", 0,false);
RemoveItem("Key_Upper_Levels");
GiveSanityBoostSmall();
{
06-30-2012, 02:57 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: Key to open door on seperate level

Yep. Last bracket needs to be } instead of { though.

06-30-2012, 03:33 AM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#5
RE: Key to open door on seperate level

(06-30-2012, 03:33 AM)Damascus Wrote: Yep. Last bracket needs to be } instead of { though.
Awesome, it's working perfectly. Thank you so much!
06-30-2012, 03:41 AM
Find




Users browsing this thread: 1 Guest(s)