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
How add Multi Doors and Keys? Help me please!!!
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#1
Sad  How add Multi Doors and Keys? Help me please!!!

Hi forum this is my second question for the HPL Engine in Amnesia.
Ok my ask is how add Doors and Keys (Closed to open doors with keys) Multi Doors and Keys
because I can not do it and do not know where to look

Please Help Me Huh

sorry for my english
Im from chile!!! Rolleyes

PD: i have a .eps file
this is the code of first key and door

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}



But y need add second door and key...and and third and fourth...etc...

Sorry i no0b in amnesia level editor!!! Big Grin
03-24-2012, 04:55 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#2
RE: How add Multi Doors and Keys? Help me please!!!

Just like the first one.

void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true); //First key
AddUseItemCallback("", "nameofsecondkey", "nameofseconddoor", "KeyOnDoor2", true); //Second key
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofseconddoor", false, true);
PlaySoundAtEntity("", "unlock_door", "nameofseconddoor", 0, false);
RemoveItem("nameofsecondkey");
}
03-24-2012, 05:20 PM
Find
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#3
RE: How add Multi Doors and Keys? Help me please!!!

Yeah!!!!! Tanks!!!!! you are Great!!!!

Then I can keep asking?
without irritating Tongue
03-24-2012, 05:50 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#4
RE: How add Multi Doors and Keys? Help me please!!!

(03-24-2012, 05:50 PM)skirnks017 Wrote: Yeah!!!!! Tanks!!!!! you are Great!!!!

Then I can keep asking?
without irritating Tongue
Sure lol

03-24-2012, 05:52 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: How add Multi Doors and Keys? Help me please!!!

Y u no use parameters?

Tutorials: From Noob to Pro
03-24-2012, 07:24 PM
Website Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#6
RE: How add Multi Doors and Keys? Help me please!!!

(03-24-2012, 07:24 PM)Your Computer Wrote: Y u no use parameters?
Oh yeah I forgot, you can make one function to multiple doors.


void unlock_door(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}

That's the function, now simply on every door you add:

AddUseItemCallback("", "key_name", "door_name", "unlock_door", true);

AddUseItemCallback("", "key_name2", "door_name2", "unlock_door", true);


Etc.
Should save you a bunch of lines if you have much doors.
03-24-2012, 07:59 PM
Find




Users browsing this thread: 1 Guest(s)