Frictional Games Forum (read-only)
[REQUEST] Amnesia Custom Story Key problems. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+--- Thread: [REQUEST] Amnesia Custom Story Key problems. (/thread-25874.html)



Amnesia Custom Story Key problems. - Catalyst - 08-16-2014

Greetings,
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)
{
AddPlayerSanity(10);
SetLevelDoorLocked("leveldoor_3", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "leveldoor_3", 0, false);
RemoveItem("key_study_1");
CompleteQuest("searchquest2","SearchQuest2");
}

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.


RE: Amnesia Custom Story Key problems. - Neelke - 08-16-2014

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)


RE: Amnesia Custom Story Key problems. - PutraenusAlivius - 08-17-2014

PHP Code:
void OnLeave()
{
 
AddEntityCollideCallback("Player""QuestArea6""MyRoom"true1);
 
AddEntityCollideCallback("Player""QuestArea7""MyRoom2"true1);
 
AddEntityCollideCallback("Player""QuestArea8""MyRoom3"true1);
 
AddEntityCollideCallback("Player""SlimeFear""Slimee"true1);
 
AddUseItemCallback("""key_study_1""leveldoor_3""UnlockLevelDoor"true);
}

void UnlockLevelDoor(string &in asEntitystring &in asItem)
{
  
AddPlayerSanity(10.0f);
  
SetLevelDoorLocked("leveldoor_3"false);
  
PlaySoundAtEntity("""unlock_door.snt""leveldoor_3"0false);
  
RemoveItem("key_study_1");
  
CompleteQuest("searchquest2","SearchQuest2");


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).