Frictional Games Forum (read-only)

Full Version: Amnesia editor - Unlocking doors help? [Solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having some issues getting a door to unlock. I have the item "Hollow needle" in my level, and I'm trying to get it to unlock a "Prison door". I have named the needle to "Sharp_needle" and the door to "prison_door_01".

For the needle, I have set up the name and description. My hps. file looks like below:

////////////////////////////
// Run when entering map
void OnEnter()

{
AddUseItemCallback("", "Sharp_needle", "prison_door_01", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_door_01", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem("Key01");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

I don't understand why it won't work. Could anyone shed some light on this please? Thanks Smile
Try putting your callback into the OnEnter function.
It doesn't work still. I can't figure out why it won't work..
Are you sure you haven't make any mistake with names in the editor? Like, the " RemoveItem("Key01"); ".
It should be RemoveItem("Sharp_needle");
I just changed that now, still it gives me the "can not be used in this way" message. I don't understand what I'm doing wrong??
Is this: AddUseItemCallback("", "Sharp_needle", "prison_door_01", "FUNCTION", true);
in your void OnStart()

Also do you see that you are using the "Sharp_needle" on the door, but you are removing a key? Don't you think that it should be
AddUseItemCallback("", "Key01", "prison_door_01", "FUNCTION", true);
If you know how to use Devmode, turn on DebugMessages and put this inside of your "FUNCTION" callback.
Code:
AddDebugMessage("FUNCTION" has responded. Their must be a error with the code inside" FUNCTION"!, false);
It's ok, I fixed the issue. The problems was the hps file was actually being shown as a txt. file, a friend helped me sort it out. Thanks for helping guys Smile