Frictional Games Forum (read-only)

Full Version: Transfering key to another map and then unlock door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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

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
(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
Repeat the key unlock door script in both map1.hps and map2.hps.
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 ^^.
(08-24-2011, 11:16 PM)JenniferOrange Wrote: [ -> ]Repeat the key unlock door script in both map1.hps and map2.hps.

it will work?
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.
(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 ..
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");
}

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