Frictional Games Forum (read-only)
Unlocking an elevator door - 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: Unlocking an elevator door (/thread-9220.html)



Unlocking an elevator door - TheDavenia - 07-18-2011

Hello guys i needs some help on unlocking an elevator door
Heres the code i put in

in void onstart:
Code:
AddUseItemCallback("", "hollow_needle_1", "elevator_door", "unlock_elevator_door", true);

Below void onstart:
Code:
void unlock_elevator_door(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("elevator_door", false, true);
    PlaySoundAtEntity("", "unlock_door", "elevator_door", 0, false);
}
And when i use my hollow needle on the elevator door ingame it says cant use this item this way!

Please help!
Thanks,
TheDavenia


RE: Unlocking an elevator door - Kyle - 07-18-2011

Are you sure that you are using "hollow_needle_1" to unlock the elevator door? If you have a different one, then that's why.

You are also forgetting the .snt on the unlock_door sound file.

PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);


RE: Unlocking an elevator door - rojkish - 07-18-2011

Does it really work unlocking the elevator doors? I've never really tried.. ^_^

(07-18-2011, 03:49 PM)Kyle Wrote: You are also forgetting the .snt on the unlock_door sound file.
PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);

PlaySoundAtEntity doesnt require you to write the extension (snt in this case), it works either way.




RE: Unlocking an elevator door - xtron - 07-18-2011

double check needle and door name twice before you try the code out.
I had the same problem but with a dagger.


RE: Unlocking an elevator door - Kyle - 07-18-2011

(07-18-2011, 04:13 PM)rojkish Wrote: Does it really work unlocking the elevator doors? I've never really tried.. ^_^

(07-18-2011, 03:49 PM)Kyle Wrote: You are also forgetting the .snt on the unlock_door sound file.
PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);

PlaySoundAtEntity doesnt require you to write the extension (snt in this case), it works either way.

Wow, I didn't know that. Thanks for telling me. Big Grin


RE: Unlocking an elevator door - TheDavenia - 07-18-2011

(07-18-2011, 03:49 PM)Kyle Wrote: Are you sure that you are using "hollow_needle_1" to unlock the elevator door? If you have a different one, then that's why.

You are also forgetting the .snt on the unlock_door sound file.

PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);

I'm sure since i copy and pasted the code of the cabinet and changed the name into the elevator door's name and its the same needle that you keep