Frictional Games Forum (read-only)
Locking level door after entering - 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)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Locking level door after entering (/thread-16396.html)



Locking level door after entering - Hartmann - 06-22-2012

I cant find out what the script for locking a level door AFTER you entered. what does the script looks like?. Name of door in map 1: level_celler_2 and map 2: level_celler_1. and the key that locks it in the first map is: key_3


RE: Locking level door after entering - Cruzore - 06-22-2012

If I understood it right, you want to be able to use a key on the second map's door so it locks? If so:
map 2 script file:
void OnStart()
{
AddUseItemCallback("", "key_3", "level_celler_1", "LockDoor", true);
}
void LockDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked(asEntity, true);
//If you want to remove the key also:
RemoveItem(asItem);
}


RE: Locking level door after entering - Hartmann - 06-22-2012

(06-22-2012, 01:20 PM)FastHunteR Wrote: If I understood it right, you want to be able to use a key on the second map's door so it locks? If so:
map 2 script file:
void OnStart()
{
AddUseItemCallback("", "key_3", "level_celler_1", "LockDoor", true);
}
void LockDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked(asEntity, true);
//If you want to remove the key also:
RemoveItem(asItem);
}
Right after i unlock the door and go trough it in map 1 it shall lock and you are not able to comeback


RE: Locking level door after entering - Cruzore - 06-22-2012

So, when you go through the level door in the firsts map and go to the second, the level door on the second one should lock? That#s easy.
Just go to the leveleditor for the second map, select the level door and check for locked.


RE: Locking level door after entering - Hartmann - 06-22-2012

(06-22-2012, 01:34 PM)FastHunteR Wrote: So, when you go through the level door in the firsts map and go to the second, the level door on the second one should lock? That#s easy.
Just go to the leveleditor for the second map, select the level door and check for locked.
im so dumb! thank you! Smile