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
Transfering key to another map and then unlock door
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#1
Transfering key to another map and then unlock door

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

08-24-2011, 09:59 PM
Find
Hades4545 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Aug 2011
Reputation: 0
#2
RE: Transfering key to another map and then unlock door

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

"Death: A fate worse than life. "
--J. J. Furnas
08-24-2011, 10:27 PM
Find
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#3
RE: Transfering key to another map and then unlock door

(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
08-24-2011, 10:38 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#4
RE: Transfering key to another map and then unlock door

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

Ba-da bing, ba-da boom.
08-24-2011, 11:16 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#5
RE: Transfering key to another map and then unlock door

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

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 08-24-2011, 11:26 PM by Elven.)
08-24-2011, 11:25 PM
Find
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#6
RE: Transfering key to another map and then unlock door

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

it will work?
08-25-2011, 12:02 AM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#7
RE: Transfering key to another map and then unlock door

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.

Ba-da bing, ba-da boom.
(This post was last modified: 08-25-2011, 02:07 AM by JenniferOrange.)
08-25-2011, 02:06 AM
Find
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#8
RE: Transfering key to another map and then unlock door

(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?

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 ..
08-25-2011, 06:33 AM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#9
RE: Transfering key to another map and then unlock door

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");
}


Ba-da bing, ba-da boom.
(This post was last modified: 08-25-2011, 10:48 PM by JenniferOrange.)
08-25-2011, 10:46 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#10
RE: Transfering key to another map and then unlock door

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

08-25-2011, 11:25 PM
Find




Users browsing this thread: 1 Guest(s)