Frictional Games Forum (read-only)
Weird problem with a lever - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Weird problem with a lever (/thread-7309.html)



Weird problem with a lever - Mooserider - 04-12-2011

Hello there!
I'm working on my first custom story at the moment. I'm very new to scripting, but I think I'm going pretty well.
Any way, I have a lever in my map, and when I pull it down I'm trying to get this carpet to disappear and a sound to play(The carpet is concealing a secret trapdoor). However, it's not working. The debug message that I set to show works, but the rest doesn't. Here's my script:

Code:
void Leverpulled(string &in asEntity, int alState)//"Leverpulled" is the ConnectionStateChangeCallback that I set in the map editor.
{
if(alState == -1){
SetEntityActive("Hiddencarpet", false);
PlaySoundAtEntity("Carpetnoise", "break_wood_metal.snt", "Hiddencarpet", 1.0f, false);
AddDebugMessage("Lever Pulled", true);
}
}
Can anyone see what the problem would be? There are no errors in the script, apparently.