Frictional Games Forum (read-only)
Amnesia editor - Unlocking doors help? [Solved] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Amnesia editor - Unlocking doors help? [Solved] (/thread-19659.html)



Amnesia editor - Unlocking doors help? [Solved] - Racingcreed - 12-24-2012

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


RE: Amnesia editor - Unlocking doors help? - Tomato Cat - 12-24-2012

Try putting your callback into the OnEnter function.


RE: Amnesia editor - Unlocking doors help? - Racingcreed - 12-24-2012

It doesn't work still. I can't figure out why it won't work..


RE: Amnesia editor - Unlocking doors help? - str4wberrypanic - 12-24-2012

Are you sure you haven't make any mistake with names in the editor? Like, the " RemoveItem("Key01"); ".
It should be RemoveItem("Sharp_needle");


RE: Amnesia editor - Unlocking doors help? - Racingcreed - 12-24-2012

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??


RE: Amnesia editor - Unlocking doors help? - FlawlessHappiness - 12-24-2012

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);


RE: Amnesia editor - Unlocking doors help? - Rapture - 12-24-2012

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);



RE: Amnesia editor - Unlocking doors help? - Racingcreed - 12-24-2012

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