![]() |
[SCRIPT] Help With Levers and Stuckstate - 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: [SCRIPT] Help With Levers and Stuckstate (/thread-15734.html) |
Help With Levers and Stuckstate - heyitsrobert97 - 05-31-2012 I need Help With A Big problem with my map. i have places custom levers in the game and they work but when i try to have the lever stick at a place when pulled down they stuff up ![]() anyone know how to make it work? ----------------------------------------------------------------------------------------------------------- SetEntityConnectionStateChangeCallback("light_switch", "func_switch"); SetEntityPlayerInteractCallback("light_switch", "light", false); } void light(string &in asEntity) { SetLeverInteractionDisablesStuck("light_switch", true); } void func_switch(string &in asEntity, int alState) { if (alState == 1) { SetLampLit("fluro_1", true, true); PlaySoundAtEntity("", "click.snt", "Player", 0.0f, false); SetLeverStuckState("light_switch", 1, false); } else { if (alState == -1) SetLampLit("fluro_1", false, true); PlaySoundAtEntity("", "click.snt", "Player", 0.0f, false); SetLeverStuckState("light_switch", -1, false); } } But When I Remove The Stuckstate and Player Interaction the script works and they are not stuck. But it only works with lever with one light script in it( so light switches that only start one light work). but others with 2 or more lights strangely do this, when holding the lever down (value 1) the lights stay on. but when i let go (goes to value 0) the lights go out except for the first one on the script code. and when i pull it up (value -1) that one light goes out? RE: Help With Levers and Stuckstate - Putmalk - 05-31-2012 Hm, try removing the "else { }" and just having two if statements there. That might help. |