Evilhardt 1 Posted July 5, 2013 Hey, I want a streetlamp to turn on and off upon activating and deactivating a trigger. So I made a trigger with this script: On Act: L1 enableSimulation true; On Dea: L1 enableSimulation false; And a Streetlamp that i called L1. I put "this enableSimulation false" in the init line of the Streetlamp. The lamp will be initialized not shining and on activating the trigger it will turn on and shine. But on deactivation it won't turn off again. Any idea why that is? Share this post Link to post Share on other sites
kylania 568 Posted July 5, 2013 Doesn't seem that switchLight is working (not by class type, parent type or even ID), which previously was the best way of doing this. Hope they fix it. I'm real tired of having to shoot out every light on the planet since NVGs are completely washed out by the smallest light not to mention how overly sensitive to starlight they are. :) Share this post Link to post Share on other sites
f2k sel 164 Posted July 5, 2013 object setdamage 0.95 is a poor work around and not tested an all lights Share this post Link to post Share on other sites
kylania 568 Posted July 5, 2013 That seems to work F2k! // off: 0 = [0.95] execVM "lights.sqf"; // on: 0 = [0] execVM "lights.sqf"; _types = ["Lamps_Base_F", "PowerLines_base_F"]; _onoff = _this select 0; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { // powercoverage is a marker I placed. _lamps = getMarkerPos "someMarkerName" nearObjects [_types select _i, 500]; sleep 1; {_x setDamage _onoff} forEach _lamps; }; Unfortunately some placed lamps are set to Off and you can't seem to turn them on via switchLight or the damage fix. Share this post Link to post Share on other sites
Evilhardt 1 Posted July 5, 2013 (edited) Great, that works. Thx! But can I remove the "sleep 1;" line to make the effect occur more quickly? Edit: Nvm, I tried and it worked. Edited July 5, 2013 by Evilhardt Share this post Link to post Share on other sites
kylania 568 Posted July 5, 2013 Yeah, that script was from a "blow up the power station to turn off the lights" mission where i wanted a rolling blackout effect. :) Share this post Link to post Share on other sites
Evilhardt 1 Posted July 6, 2013 I got a problem with the script. I would like it to not react to dead players. The lamps stay on, if a player dies in the area of their assigned trigger. Can you help me fix this? Share this post Link to post Share on other sites
kylania 568 Posted July 6, 2013 Not without seeing how you're triggering all of this. :) Share this post Link to post Share on other sites
KevsNoTrev 44 Posted July 6, 2013 Thought you might like to know there is a workaround to setting the damage to 0.95 to turn off the lights. I have yet to test out and get it working . From the Arma 3 feedback tracker You can now use the setHit command to destroy/restore just the "bulbs" by using it in conjunction with light_n_hitpoint where "n" is the number of the respective light on the pole (some like halogen and decor have multiple lights). Share this post Link to post Share on other sites
Evilhardt 1 Posted July 7, 2013 I put this in the trigger: ON ACT: 0 = [0] execVM "lights.sqf"; ON DEA: 0 = [0.95] execVM "lights.sqf"; I set the trigger to "present ayone" I put a marker near the lamp that I want to be affected. In this case it's the marker "ML1". I use a sqf that uses the name of the marker. In this case "ML1.sqf" and it contains this code: _types = ["Lamps_Base_F", "PowerLines_base_F"]; _onoff = _this select 0; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { // powercoverage is a marker I placed. _lamps = getMarkerPos "ML1" nearObjects [_types select _i, 7]; {_x setDamage _onoff} forEach _lamps; }; (As I did not know how to modified the script correctly I use one sqf per lamp, as I want each lamp to have it's own trigger.) Share this post Link to post Share on other sites
kylania 568 Posted July 7, 2013 So your entire island has motion sensor street lights? It's the present anyone that's probably causing the lights to stay on. Umm... I supposed you could add something like this && {alive _x} forEach thislist perhaps? Share this post Link to post Share on other sites
f2k sel 164 Posted July 7, 2013 The trigger conditions anyone present is broken. animals are currently classed as civilians setting of the trigger. http://feedback.arma3.com/view.php?id=5765 Share this post Link to post Share on other sites
Evilhardt 1 Posted July 7, 2013 So your entire island has motion sensor street lights?It's the present anyone that's probably causing the lights to stay on. Umm... I supposed you could add something like this && {alive _x} forEach thislist perhaps? I assumed I was supposed to add this to the condition of the trigger. But I guess that is not where that code fragment is meant to be put, as I get an error when I put it in the condition field of the trigger: "&& Type Any, Expected Bool". Share this post Link to post Share on other sites
Evilhardt 1 Posted July 8, 2013 (edited) Could you tell me were this is meant to go? I'd really appreciate that. I can't figure it out. The trigger conditions anyone present is broken. animals are currently classed as civilians setting of the trigger. http://feedback.arma3.com/view.php?id=5765 Well, I my case this actually comes handy, as motion sensors for lamps are triggered by animals IRL as well... ^^ Edited July 8, 2013 by Evilhardt Share this post Link to post Share on other sites