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
Request Amnesia Custom Story Key problems.
Catalyst Offline

Posts: 214
Threads: 32
Joined: Aug 2014
Reputation: 3
Amnesia Custom Story Key problems.

I have question,how to unlock a level door,to make a key that unlocks a level door? SetSwingDoorLocked? or there is another script function?

Also I tried to unlock a regular mansion door with key that I created on another map level.When I bring it in map with locked door,this key cannot unlock it =(
Maybe this is because the door is in 1.map and key for this door is on 2.map?

Please someone,I need help,cannot continue my latest custom story project(

The script :

void OnLeave()
AddEntityCollideCallback("Player", "QuestArea6", "MyRoom", true, 1);
AddEntityCollideCallback("Player", "QuestArea7", "MyRoom2", true, 1);
AddEntityCollideCallback("Player", "QuestArea8", "MyRoom3", true, 1);
AddEntityCollideCallback("Player", "SlimeFear", "Slimee", true, 1);
AddUseItemCallback("", "key_study_1", "leveldoor_3", "UnlockLevelDoor", true);

void UnlockLevelDoor(string &in asParent, string &in asChild, int alState)
SetLevelDoorLocked("leveldoor_3", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "leveldoor_3", 0, false);

As I said,the door is in the first map,the key is in the other,please somebody help,let me know what I'm doing wrong.

Thanks earlier.

Egypt CS
[Image: 27003.png]
(This post was last modified: 08-16-2014, 12:58 PM by Catalyst.)
08-16-2014, 12:56 PM
Find Reply
Neelke Offline
Senior Member

Posts: 669
Threads: 82
Joined: Apr 2013
Reputation: 26
RE: Amnesia Custom Story Key problems.

You got two boolean in the SetLevelDoorLocked. It's supposed to be like this.

SetLevelDoorLocked("leveldoor_3", false);

And youre trying to start the useitem callback with a collide callback. Change it to this.

void UnlockLevelDoor(string &in asEntity, string &in asItem)

(This post was last modified: 08-16-2014, 01:50 PM by Neelke.)
08-16-2014, 01:49 PM
Find Reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
RE: Amnesia Custom Story Key problems.

PHP Code: (Select All)
void OnLeave()

void UnlockLevelDoor(string &in asEntitystring &in asItem)

First, you used the wrong callback on the wrong function. UnlockLevelDoor is a callback of AddUsItemCallback. Then why is it using the AddEntityCollideCallback callback syntax?

Second, SetLevelDoorLocked has the wrong argument. Your argument (string, bool, bool) is actually for SetSwingDoorLocked. SetLevelDoorLocked has only two arguments (string, bool).

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 08-17-2014, 01:20 AM by PutraenusAlivius.)
08-17-2014, 01:19 AM
Find Reply

Users browsing this thread: 1 Guest(s)