Frictional Games Forum (read-only)
[SCRIPT] Buttons! - 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] Buttons! (/thread-11197.html)



Buttons! - JenniferOrange - 11-05-2011

Oh my god buttons are so complicated. xD
I want to make it so the player clicks the button, then a nearby light turns on flickering, then stops. I know I need timers for flickering, but as far as touching the button to turn the light on I'm clueless. Could anyone be nice enough as to give me an example script? Thank you Smile



RE: Buttons! - Obliviator27 - 11-05-2011

SetEntityPlayerInteractCallback can be used to interact with the button to start the timers for the lights. Smile



RE: Buttons! - JenniferOrange - 11-05-2011

So I guess something like SetEntityPlayerInteractCallback("button_1", "Light", true); ?
and I noticed SetEntityConnectionStateChangeCallback is used for levers to open things, should I do the same for the button?



RE: Buttons! - Tanshaydar - 11-06-2011

(11-05-2011, 08:51 PM)JenniferOrange Wrote: So I guess something like SetEntityPlayerInteractCallback("button_1", "Light", true); ?

and I noticed SetEntityConnectionStateChangeCallback is used for levers to open things, should I do the same for the button?

If it's a button entity, you can and should do so.