Frictional Games Forum (read-only)

Full Version: 1 working key, 1 unworking
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have tried alot of things to get the 2nd key to work, but i can't semm to fix it. here is my hps file:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "BedroomKey", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "StorageRoomKey", "mansion_2", "Door", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("BedroomKey");
}
void Door(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("StorageRoomKey");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}
what am I doing wrong?
Where did you put "StorageRoomKey" in the key's tab in the LeveEditor? It could be in the wrong spot or spelled incorrectly...
(01-01-2012, 10:27 PM)Statyk Wrote: [ -> ]Where did you put "StorageRoomKey" in the key's tab in the LeveEditor? It could be in the wrong spot or spelled incorrectly...


I put it in the CutomSubItemTypeName
I'm not sure if this is it, but put it as the internal name. Where it says something like "item_key_01"
FINNALY after many tries. The key works. Big Grin