[SCRIPT] Lever State - 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] Lever State (/thread-20965.html) |
RE: Lever State - ClayPigeon - 03-29-2013 If you're using the lever panel you're gonna need to use the multislider functions. void OnStart() { SetMultiSliderCallback("lever_panel_1", "LeverStateChange1"); } void LeverStateChange1(string &in EntityName, int alState) { if(alState == 1) { AddDebugMessage("DoorOpen", false); } } RE: Lever State - ClayPigeon - 03-29-2013 (03-29-2013, 05:56 PM)Robosprog Wrote:(03-29-2013, 04:14 PM)ClayPigeon Wrote: If you're using the lever panel you're gonna need to use the multislider functions. Multisliders has no -1 state, their states are 0,1 and 2, unlike levers which have -1, 0 and 1. RE: Lever State - NaxEla - 03-29-2013 If there's only one lever, then you use SetEntityConnectionStateChangeCallback. For example, if you want something to happen when the lever's state is 1, you write: PHP Code: void OnStart() RE: Lever State - ClayPigeon - 03-29-2013 (03-29-2013, 09:27 PM)Robosprog Wrote:(03-29-2013, 06:30 PM)ClayPigeon Wrote:(03-29-2013, 05:56 PM)Robosprog Wrote:(03-29-2013, 04:14 PM)ClayPigeon Wrote: If you're using the lever panel you're gonna need to use the multislider functions. Is your lever model called "water_wheel_cog_panel" ? If it is, the connectionstatechange callback won't work with it, and you need to use mutlisliders. If you use any other lever, you can use SetEntityConnectionStateChangeCallback. |