Frictional Games Forum (read-only)

Full Version: Why doesnt my key work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I followed this video: http://www.youtube.com/watch?v=ABI7NUqkX...re=related
and my key doesnt work.

hps file:
////////////////////////////

// Run when entering map

void OnEnter()

{

Haha there was space at my key name Big Grin

AddUseItemCallback("", "key_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("key_1");

}

extra english lang:

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_key1">Cellar Key</Entry>
<Entry Name="ItemDesc_key1">This key looks rusty and old.</Entry>
</CATEGORY>
</LANGUAGE>

When i pick up key, it says: "Picked up Cellar key" like it should say, and when i use it door: "Cannot use item this way"

Help please..
(06-09-2012, 10:26 AM)Putkimato Wrote: [ -> ]I followed this video: http://www.youtube.com/watch?v=ABI7NUqkX...re=related
and my key doesnt work.

hps file:
////////////////////////////

// Run when entering map

void OnEnter()

{

Haha there was space at my key name Big Grin

AddUseItemCallback("", "key_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("key_1");

}

extra english lang:





Cellar Key
This key looks rusty and old.



When i pick up key, it says: "Picked up Cellar key" like it should say, and when i use it door: "Cannot use item this way"

Help please..


You, just as me are trying to get help right, but i realized one thing when i searched for help that it was way easier to discover the fault myself and it was a good feeling that i was learning to script this without tutorials, you can use tutorials on hard items and then memorize them and then try something new by yourself like i'm doing so i'm glad you solved this by yourself.