Jump to content
Sign in to follow this  
Pirate Mayor

Lights in ArmA 2

Recommended Posts

Hey, it's been awhile since I've been on this forum, and I have know idea if this belongs here or not, but I gotta know if it's possible to have all electricity in a certain area to be shut off because a trigger. I have an Idea in my campaign I'm making to have that when the power plant in Elektrovadosk is destroyed, all the power is shut off. But I have zero clue how to do this.

Thanks in advance for anyone who can help! :)

Share this post


Link to post
Share on other sites

Yeah, so that means it wouldn't work in ArmA2. Maybe CEG, Chernarus Electrical Grid. Well, I'll see what I can do. Thanks.

Share this post


Link to post
Share on other sites

Did you ever figure this one out man? I have the same Idea for my recon mission and I cant get this thing to work in arma2...

Share this post


Link to post
Share on other sites

I assume it's basically just a matter of taking the Sahrani Electrical Grid code (see OFPEC's scripts section) and adapting it by changing the numbers which are basically locations for towns.

Here's a snippet of the old SEG code:

sleep .1;
if (!isServer) exitWith {};
{_x switchLight "off"} foreach ([14475.468750,8576.005859,30.519976] nearObjects ["streetlamp",250]); // Gaula
sleep .1;
{_x switchLight "off"} foreach ([16571.910156,9363.751953,12.285000] nearObjects ["streetlamp",300]); // Everon
sleep .1;
{_x switchLight "off"} foreach ([14535.646484,10791.570313,43.965000] nearObjects ["streetlamp",550]); // Obregan
sleep .1;
{_x switchLight "off"} foreach ([13215.121094,11346.532227,25.965000] nearObjects ["streetlamp",635]); // Mercalillo

All you need to do is place a unit in the centre (in terms of a circle that would cover the town) of each town you want covered, (name the unit after the town to make life easy), then save the mission, open up the mission.sqm file in notepad and cut & paste the unit's position numbers into a script, adjust the radius to fit the town, and add a comment to show which town is affected (to avoid later nightmares).

Eg replace the red bits with the relevant numbers/names:

{_x switchLight "off"} foreach ([[color="Red"]town_location1[/color],[color="Red"]town_location2[/color],[color="Red"]town_location3[/color]] nearObjects ["streetlamp",[color="Red"]radius_of_town_in_metres[/color]]); // [color="Red"]Town_name[/color]

I will warn you: I haven't even remotely tested this in ArmA2 yet, so this method might not work at all. ArmA2 may have changed the name of "streetlamp" to something else, for starters. Try it on one town & see how you go.

Share this post


Link to post
Share on other sites

There is a reason why we have an ArmA2 Editing forum.

Edit: Moved to correct forum and unlocked.

Edited by W0lle

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×