Casio91Fin 31 Posted October 2, 2018 Hello. Does anyone have any knowledge or skill to get the lights off? primary order: - lights off the airport - streetlights off - some of the buildings also have lights. If they too would get the lights off. (gas station / hospital / air traffic control towers / some factories (solar power plant) / and many other buildings where there is lights) thanks. Share this post Link to post Share on other sites
Purzel 35 Posted October 2, 2018 //Use an object as switch for some // Needs in editor:One objekt as lightswitch (e.g. generator), an empty (= unvisible) marker named lights, some lamps inside radius // Called from INIT of the object (e.g. generator) // Example: // lgt = this addAction [""Lights ON"", ""0 = [0, 150, 'lights'] execVM 'scripts\baselights.sqf'"", nil, 6, true, true, """", ""alive _target && ((getPos _target) distance (getPos _this)) <= 4""]; // lgt = this addAction [""Lights OFF"", ""0 = [0.95, 150, 'lights'] execVM 'scripts\baselights.sqf'"", nil, 5, true, true, """", ""alive _target && ((getPos _target) distance (getPos _this)) <= 4""]; // Important: Don´t use "if (isServer) then {SOMECODE};" ,because the script has to be executed local on the players PC ! // with this script you can switch of lights in a radius of 150m around the empty marker (Action menu Mousewheel). _types = ["Lamps_Base_F", "PowerLines_base_F", "Land_LampHalogen_F"]; // add here all lightsources you have used or all lightsources from map _onoff = _this select 0; _dist = _this select 1; _marker = _this select 2; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { // powercoverage is a marker I placed. _lamps = getMarkerPos _marker nearObjects [_types select _i, _dist]; sleep 1; {_x setDamage _onoff} forEach _lamps; }; Don´t use a damage more than 0.95 as seen in the "Lights OFF"-Code ( [""Lights OFF"", ""0 = [0.95, 150, 'lights'] ), because it will destroy all lightsources and they wont be able to switch ON again. 1 Share this post Link to post Share on other sites
HazJ 1289 Posted October 2, 2018 https://community.bistudio.com/wiki/switchLight See @killzone_kid's comment. 2 Share this post Link to post Share on other sites
Casio91Fin 31 Posted October 4, 2018 @HazJ works well with all street lamps, but no gas station. How do I get the gas station off the lights? Runway lights are also on @Purzel It's a good thing, but it's about getting the lights out of the whole map. Share this post Link to post Share on other sites
HazJ 1289 Posted October 4, 2018 1 hour ago, Casio91Fin said: @HazJ works well with all street lamps, but no gas station. How do I get the gas station off the lights? Runway lights are also on @Purzel It's a good thing, but it's about getting the lights out of the whole map. I assume those don't use Lamps_base_F then. Just find the correct one for those and add them in the array. Share this post Link to post Share on other sites
Harzach 2517 Posted October 4, 2018 11 hours ago, Casio91Fin said: @HazJ works well with all street lamps, but no gas station. How do I get the gas station off the lights? Runway lights are also on @Purzel It's a good thing, but it's about getting the lights out of the whole map. Here's the array I use, which I think gets them all. [ "Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F", "Land_fs_roof_F", "Land_FuelStation_01_roof_F", "Land_FuelStation_02_roof_F", "Land_FuelStation_01_roof_malevil_F" ]; *edit* - ooh, forgot about runway/lighthouse lights. Share this post Link to post Share on other sites
Casio91Fin 31 Posted October 5, 2018 Good, there is some progress now, but "Land_fs_roof_F" did not work at all or not worked properly. { for "_i" from 0 to count getAllHitPointsDamage _x - 1 do { _x setHitIndex [_i, 0.97]; }; } forEach nearestObjects [ player, [ "Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F", "Land_fs_roof_F", "Land_FuelStation_01_roof_F", "Land_FuelStation_02_roof_F", "Land_FuelStation_01_roof_malevil_F" ], 500 ]; Share this post Link to post Share on other sites