Frictional Games Forum (read-only)
Transfering key to another map and then unlock door - 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: Transfering key to another map and then unlock door (/thread-9964.html)



Transfering key to another map and then unlock door - fuytko - 08-24-2011

Hello all !

Again me..

How I could script this :

I have item Key_2 in map 02_Study and I want this key to unlock door to the Libary in map 01_Entry_Hall .. Please,how I can do this?

It's really hard for me,I' am looking for some thread about this,I found one but I don't understand ..

Can somebody explain me in details ? Please Sad




RE: Transfering key to another map and then unlock door - Hades4545 - 08-24-2011

This is only a guess, but maybe you can use the name of the key and such from the second map and then for the first map's script you can use the name of the key from the second map.

Not sure if that will work, but its worth a shot. :o


RE: Transfering key to another map and then unlock door - fuytko - 08-24-2011

(08-24-2011, 10:27 PM)Hades4545 Wrote: This is only a guess, but maybe you can use the name of the key and such from the second map and then for the first map's script you can use the name of the key from the second map.

Not sure if that will work, but its worth a shot. :o

I think that not will work


RE: Transfering key to another map and then unlock door - JenniferOrange - 08-24-2011

Repeat the key unlock door script in both map1.hps and map2.hps.


RE: Transfering key to another map and then unlock door - Elven - 08-24-2011

As I told you already. if you transfer maps, you will bring all items with you. You should ask instead then, how can you open locked doors with key ^^.


RE: Transfering key to another map and then unlock door - fuytko - 08-25-2011

(08-24-2011, 11:16 PM)JenniferOrange Wrote: Repeat the key unlock door script in both map1.hps and map2.hps.

it will work?


RE: Transfering key to another map and then unlock door - JenniferOrange - 08-25-2011

Already have it tested, yes, it will work :]
If it doesn't then my sincere apologies, i tested it on level doors and it worked for me though.


RE: Transfering key to another map and then unlock door - fuytko - 08-25-2011

(08-25-2011, 02:06 AM)JenniferOrange Wrote: Already have it tested, yes, it will work :]
If it doesn't then my sincere apologies, i tested it on level doors and it worked for me though.

It doesn't work..

This script you thinks?

Code:
void OnStart()

{
AddUseItemCallback("", "Key_2", "level_celler_1", "OnPickup", true);
}

void OnPickup(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("level_celler_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
    RemoveItem("Key_2");
}

I copy this script and put it in 01_EntryHall.hps and in 02_Study.hps .. But If I want go through level door to Study it shows message that this function already exists with same parameters ..


RE: Transfering key to another map and then unlock door - JenniferOrange - 08-25-2011

Try this instead:
Spoiler below!

void OnStart()

{
AddUseItemCallback("", "Key_2", "level_celler_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_celler_1", false);
RemoveItem("Key_2");
}


Put that in the first map's .hps! In the second map's .hps, put this:

Spoiler below!

void OnStart()

{
AddUseItemCallback("", "Key_2", "level_celler_1", "UsedKeyOnDoor2", true);
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_celler_1", false);
RemoveItem("Key_2");
}




RE: Transfering key to another map and then unlock door - Kyle - 08-25-2011

Please... Use the search bar first... -_-