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 to make locked door and key that opens it.
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#1
How to make locked door and key that opens it.

I dont know how and please tell me what i would write.

Thanks.
09-30-2010, 05:12 PM
Find
trancedj Offline
Member

Posts: 60
Threads: 7
Joined: Sep 2010
Reputation: 0
#2
RE: How to make locked door and key that opens it.

Take a look at:

http://hpl2.frictionalgames.com/tutorials
09-30-2010, 05:16 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#3
RE: How to make locked door and key that opens it.

(09-30-2010, 05:12 PM)LoneWolf Wrote: I dont know how and please tell me what i would write.

Thanks.

This has been addressed a thousand times and is in the tutorial section as a video.
09-30-2010, 05:17 PM
Find
fantino Offline
Junior Member

Posts: 14
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: How to make locked door and key that opens it.

It doesn't work for me. Any idea Huh

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave(
{
}
09-30-2010, 07:09 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#5
RE: How to make locked door and key that opens it.

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true); --> is your key named "awesomekey_1"? The door name must be "mansion_1" as well.
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true); --> again door name "mansion_1"?
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1"); --> just to remove the key from inventory after it is used, key name "awesomekey_1"
}

Check the tutorial video on making doors. If you follow step by step you can't go wrong.
09-30-2010, 08:58 PM
Find
fantino Offline
Junior Member

Posts: 14
Threads: 2
Joined: Sep 2010
Reputation: 0
#6
RE: How to make locked door and key that opens it.

I've done everything like in the video. That's why i don't understand. Sad

edit: I've found the problem. The extension of my folder was .hps.hps instead of .hps ! Dodgy

It works now! Youhou! Tongue

Anyway thank you! Big Grin
09-30-2010, 09:18 PM
Find




Users browsing this thread: 1 Guest(s)