dark_spectre 2 Posted November 20, 2013 (To begin with I take no credit for this script, props to kylania) lights.sqf // 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 "LIGHTSOURCE" nearObjects [_types select _i, 500]; sleep 1; {_x setDamage _onoff} forEach _lamps; }; Trigger on act 0 = [0.95] execVM "lights.sqf"; Now when I use this trig/script almost all the lights go out, but some still remain on. So i guess that begs the question, what other classNames are missing to make this script complete in its light killing scope? The ones already listed are filed under vehicles, so any hopes of an intuitive search is fruitless. Not that I genuinely have much idea of what I'm doing anyhow. :-P So I'm here to plead for assistance. So close yet so far away!! _types = ["Lamps_Base_F", "PowerLines_base_F"]; _onoff What other _types are missing in this array? As always thank for the read and insight. Spectre Share this post Link to post Share on other sites
anthonyfromtheuk 6 Posted November 20, 2013 (edited) I used this and it took out all the lights as far as I could tell. { _x setDamage 1; _x hideobject true; } forEach (getPos p1 nearObjects ["Lamps_Base_F", 1000]) + (getPos p1 nearObjects ["PowerLines_base_F", 1000]); Edited November 20, 2013 by Anthonyfromtheuk only tested it in Kavala 1 Share this post Link to post Share on other sites
jw custom 56 Posted November 20, 2013 Try add Land_PowerPoleWooden_L_F to "_types" Share this post Link to post Share on other sites
mad_cheese 593 Posted November 21, 2013 (edited) _lamps = ( ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampHarbour_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampShabby_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampStreet_small_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampStreet_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_PowerPoleWooden_L_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampHalogen_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampDecor_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampSolar_F",1000]) + ((getMarkerPos "LIGHTSOURCE") nearObjects ["Land_LampAirport_F",1000]) ); {_x setdamage 0.92; sleep 0.1} foreach _lamps; There's one more kind of lamp (the one near the terminal building at Altis main airfield), haven't checked for that typename yet. (EDIT: "Land_LampAirport_F" added) Kylania's script is way more performance friendly btw, better to just add the missing classnames Edited November 21, 2013 by Mad_Cheese Share this post Link to post Share on other sites
rakowozz 14 Posted November 21, 2013 Some lamp names I use myself for the same purpose: "Lamps_Base_F" "PowerLines_base_F" "Land_PowerPoleWooden_F" "Land_LampHarbour_F" "Land_LampShabby_F" "Land_PowerPoleWooden_L_F" "Land_PowerPoleWooden_small_F" "Land_LampDecor_F" "Land_LampHalogen_F" "Land_LampSolar_F" "Land_LampStreet_small_F" "Land_LampStreet_F" Share this post Link to post Share on other sites
mad_cheese 593 Posted November 21, 2013 Some lamp names I use myself for the same purpose: "Lamps_Base_F" "PowerLines_base_F" "Land_PowerPoleWooden_F" "Land_LampHarbour_F" "Land_LampShabby_F" "Land_PowerPoleWooden_L_F" "Land_PowerPoleWooden_small_F" "Land_LampDecor_F" "Land_LampHalogen_F" "Land_LampSolar_F" "Land_LampStreet_small_F" "Land_LampStreet_F" Awesome, I didn't know about "Land_LampSolar_F". "Lamps_Base_F" and "PowerLines_base_F" don't seem to be valid classnames. "Land_PowerPoleWooden_small_F" is not an active lamp. It's switched off by default, so no need to check for them. By the way, "Land_LampAirport_F" is the classname of that lamp at the airfield. I updated my post above, but thinking about performance you may want to stick with Kylania's example and just add the missing classnames Share this post Link to post Share on other sites
dark_spectre 2 Posted November 21, 2013 You guys rock! Thanks to you I was finally able to kill of the last few straggler lamps I was having. heres the lights.sqf // off: 0 = [0.95] execVM "lights.sqf"; // on: 0 = [0] execVM "lights.sqf"; _types = ["Lamps_Base_F", "PowerLines_base_F", "Land_PowerPoleWooden_F", "Land_LampHarbour_F", "Land_LampShabby_F", "Land_PowerPoleWooden_L_F", "Land_PowerPoleWooden_small_F", "Land_LampDecor_F", "Land_LampHalogen_F", "Land_LampSolar_F", "Land_LampStreet_small_F", "Land_LampStreet_F", "Land_LampAirport_F", "Land_PowerPoleWooden_L_F"]; _onoff = _this select 0; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { // powercoverage is a marker I placed. _lamps = getMarkerPos "LIGHTSOURCE" nearObjects [_types select _i, 500]; sleep 1; {_x setDamage _onoff} forEach _lamps; }; awesome sauce! 1 Share this post Link to post Share on other sites
pingo21vb 1 Posted November 22, 2013 (edited) Uhm... Could someone please (chop it all up) in steps... I'm lost.. How do I make it work?? Edit; Well... It works :) It's very cool made!! Thanks for sharing :) Edited November 22, 2013 by Pingo21vb Share this post Link to post Share on other sites
TAW_Yonose 11 Posted February 18, 2014 Somehow i can make it look more cleaner like this: _types = "Lamps_Base_F", "PowerLines_base_F", "Land_PowerPoleWooden_F", "Land_LampHarbour_F", "Land_LampShabby_F", "Land_PowerPoleWooden_L_F", "Land_PowerPoleWooden_small_F", "Land_LampDecor_F", "Land_LampHalogen_F", "Land_LampSolar_F", "Land_LampStreet_small_F", "Land_LampStreet_F", "Land_LampAirport_F", "Land_PowerPoleWooden_L_F"]; _onoff = _this select 0; Edit: And yes, what should i add to be able to do this for more than one locations? Share this post Link to post Share on other sites
dark_spectre 2 Posted February 18, 2014 You can create multiple markers, i.e. lightsource, lightsource_1, lightsource_2, etc.. Specify them in the script in getMarkerPos and then for example use triggers to run the lights.sqf by radio call corresponding to the specific MarkerPosition. Alpha could be lightsource_1 Bravo lightsource_2, etc. It's really cool to trigger either by radio or by "not present" on a static structure. I can provide you an example, but I'm trapped at work at the moment. Share this post Link to post Share on other sites
TAW_Yonose 11 Posted February 18, 2014 alright thanks, i have modify this script or like show what do what that is easier to modiy if i guess. so, who made this? was it you and Kylania? Share this post Link to post Share on other sites
dark_spectre 2 Posted February 18, 2014 Kylania is the man, im just the OCD guy who wouldn't quit till it killed all the lights in A3. I believe it's an arms 2 script just with arma 3 class names now. My most recent incarnation of this script genuinely includes "all" lights now. I'll post up a barebones mission when I get home and you can dissect it. Give you radio and triggered examples. Share this post Link to post Share on other sites
dark_spectre 2 Posted February 18, 2014 (edited) okay, to begin I strongly getting yourself Poseidon as a text editor. http://www.armaholic.com/page.php?id=22139 Here is the first mission. The trigger is activated by a static object = not present. In this case a transformer on the outskirts of a small town. Because your the only player and as such, team leader, you will drop your backpack with all your high explosives behind you at mission start for a long range radio. So, I left you some nato explosive ammo boxes nearby. ;) place 3 explosive charges on the transformer, move a safe distance, detonate, and enjoy the show! The transformer will blow and the towns lights will shutdown. Please read the comments I left in the lights.sqf script to add more than one area. http://www.filedropper.com/lightsource1altis I'll provide the "by radio" via scroll-wheel next so you can turn them on AND off simply via radio button. Don't hesitate to ask if you have any questions! I'm off to go solve my own hydra now. :D https://www.youtube.com/watch?v=D66nuvxqVSQ&feature=youtu.be Edited February 18, 2014 by Dark_Spectre Share this post Link to post Share on other sites
TAW_Yonose 11 Posted February 18, 2014 If you want a tip, i would set the "sleep" to 0.1, that makes it more realistic when the power shutsdown. For my mission, im making more like a stealth one, which means the lights.sqf will only be triggered when blufor is in the other trigger which will allow him to use the script and "jam the powersource" Share this post Link to post Share on other sites
dark_spectre 2 Posted February 19, 2014 Definitely give that a try! I've found the delay a bit immersion breaking anyhow. Thanks. I was using it as an EMP pulse in conjunction with a nuke detonation script. Yonose, the second mission will be posted up this afternoon, same time and channel. Stuck at work again, boo! Share this post Link to post Share on other sites
dark_spectre 2 Posted February 19, 2014 (edited) I added your suggestion of retarding the "sleep" time to .01, and it works amazing! Here's the radio mission, they turn on and off like a literal switch now. Great suggestion! :) just press 0-0 and 1 is off and 2 is back on. http://www.filedropper.com/radiosaltis_1 Just multiply the number of scripts, markers and waypoints, (all with new names and references of course) to create multiple areas that you can control as such. http://youtu.be/wFoXBzxyehs Edited February 19, 2014 by Dark_Spectre had to update the link, i left a straggler file in the folder. Share this post Link to post Share on other sites
TAW_Yonose 11 Posted February 20, 2014 Nice! did you do that with multiply markers? Share this post Link to post Share on other sites
dark_spectre 2 Posted February 20, 2014 Negative, that was a single marker. I will make a second mission and split the town in two utilizing 2 markers, two scripts and 2 more radio triggers for you when I get home and post it up. (I could create an array, but that's anther ball of wax, and with a script this small unobtrusive, it's no real issue from a performance/mission size perspective) Share this post Link to post Share on other sites
dark_spectre 2 Posted February 20, 2014 (edited) Well the results were not what I expected... Maybe its because the markers radii overlap or something, but I simply cannot get the second trigger set to work. Maybe someone smarter than I can figure out what im doing wrong and illuminate us both as to why. I'm fairly certain the theory is sound, the first one certainly works, but I'm clearly making a mistake in practice. its odd because the hint that i placed in each of the second set of triggers show when activated. Its just not executing the script. http://www.filedropper.com/radiosaltis_2 ( i think I had my mods on as well, might have to open the mission.sqm file and remove any addons you dont have) Edited February 20, 2014 by Dark_Spectre mods on, oops. Share this post Link to post Share on other sites
TAW_Yonose 11 Posted February 20, 2014 Alright i checked it out and i found the reason. 1. at your trigger LIGHTS_OUT_2 you called this 0 = [0] execVM "lights_2.sqf"; hint "lights_2 off"; which means you turn the lights on so i change it to 0 = [0.95] execVM "lights_2.sqf"; hint "lights_2 off"; 2. your lights_2.sqf called this // off: 0 = [0.95] execVM "lights.sqf"; // on: 0 = [0] execVM "lights.sqf"; BUT it should say this // off: 0 = [0.95] execVM "lights_2.sqf"; // on: 0 = [0] execVM "lights_2.sqf"; and now its working great for me Share this post Link to post Share on other sites
dark_spectre 2 Posted February 20, 2014 Awesome! Always with the human error! In this case that human was I. (seems to be a trend for me in the scripting department lately :P) I need to be more diligent in proofreading. Share this post Link to post Share on other sites