The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Two locked doors + keys on one map???
Duncansch Offline
Junior Member

Posts: 1
Threads: 1
Joined: Sep 2012
Reputation: 0
#1
Two locked doors + keys on one map???

Hey guys.
I have started scripting my new amnesia map lately and i have an annoying problem:
lets say i have three rooms. you start in room one. in room one you find the key to door one leading to room two. in room two, you find key two for door two which leads into room three. the problem here though, is that when i use key one on door one, door two unlocks too, without me using any key on it... i guess the script is not good. well, here it is:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
SetSwingDoorLocked("door_1", false, true);
RemoveItem("key_1");
PlaySoundAtEntity("", "unlock_door", "door_2", 0, false);
SetSwingDoorLocked("door_2", false, true);
RemoveItem("key_2");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

Sorry, I couldn't find any threads on this and it is really bugging me. i have tried moving them around a bit, but it didn't work. help is very, very much appreciated
09-28-2012, 01:48 PM
Find


Messages In This Thread
Two locked doors + keys on one map??? - by Duncansch - 09-28-2012, 01:48 PM



Users browsing this thread: 1 Guest(s)