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
Link a Key to a Door
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#1
Link a Key to a Door

Hey Everyone!

I been trying for a couple of hours now linking a key to a door. I managed to name the key in the way I wanted to, using the extra_english.lang file, but unfortunatley I am unable the key to the door I want to.


////////////////////////////
// Run first time starting map
void OnStart()
{
wakeUp();
PlayGuiSound("break_wood1.ogg", 1);
PlayGuiSound("general_thunder1.ogg", 1);
SetPlayerLampOil(0);
PlayMusic("react_breath1",false,100.0f,0.0f,1,false);
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}


If you manage to solve this problem, I would be very grateful [Image: smile.gif]

Cheers!
/Twitchez
03-19-2012, 08:34 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Link a Key to a Door

That's better! Smile

Ok so does it give you error or does it just not work? Smile

03-19-2012, 08:37 PM
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#3
RE: Link a Key to a Door

(03-19-2012, 08:37 PM)SilentStriker Wrote: That's better! Smile

Ok so does it give you error or does it just not work? Smile
I didn't write the codes I used for example "wakeUp();", because that works like a charm. The problem is that when I enter my map, I go and pick up my key (which is named the way I want it). I go to my door, which is locked. I try to use my key, but it just says "Cannot use this item..." Undecided
(This post was last modified: 03-19-2012, 08:40 PM by Twitchez.)
03-19-2012, 08:40 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: Link a Key to a Door

Ok, check so both the door and the key is named right, if they are try renaming them to your liking. For example if it is a Mansion door name it MansionDoor_1 and the key MansionKey_1 or something like that Smile

03-19-2012, 08:45 PM
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#5
RE: Link a Key to a Door

(03-19-2012, 08:45 PM)SilentStriker Wrote: Ok, check so both the door and the key is named right, if they are try renaming them to your liking. For example if it is a Mansion door name it MansionDoor_1 and the key MansionKey_1 or something like that Smile
I solved the problem. Apperantly, it seems like the HPL Editor won't allow me to name doors and keys with letters like å,ä and ö without giving me problems. So much for being a Swede Tongue But thanks a lot for giving me the heads up.

//Problem Solved
03-19-2012, 08:51 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: Link a Key to a Door

(03-19-2012, 08:51 PM)Twitchez Wrote:
(03-19-2012, 08:45 PM)SilentStriker Wrote: Ok, check so both the door and the key is named right, if they are try renaming them to your liking. For example if it is a Mansion door name it MansionDoor_1 and the key MansionKey_1 or something like that Smile
I solved the problem. Apperantly, it seems like the HPL Editor won't allow me to name doors and keys with letters like å,ä and ö without giving me problems. So much for being a Swede Tongue But thanks a lot for giving me the heads up.

//Problem Solved
Nä det är för den är skriven för engelska tangentbord och då finns inte ÅÄÖ Wink

Varsegod ^^


(This post was last modified: 03-19-2012, 09:08 PM by SilentStriker.)
03-19-2012, 09:08 PM
Find




Users browsing this thread: 2 Guest(s)