Jump to content
Sign in to follow this  
anthonyfromtheuk

How to turn off city lights and burn the area

Recommended Posts

After searching i can only seem to find old posts saying its not working yet in arma 3. but is it possible to turn off all the lights in a city? also im using this

flames = "test_EmptyObjectForFireBig" createVehicle position this; flames attachTo[this,[0,1.5,-1]];

to make a wreck burn to give light but it looks strange as i walk around the fire it seem to move round the wreck dependant on where i am. am i doing something wrong there?

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

Look here for "lights off".

All you need is a object "generator" and init.sqf, that is all. Set the radius in the init.sqf below from 500m up to the range you need. (just exchange the "500" to your needs.)

Activate the lights-off part as you want ("generator" was my "addAction-switch", the player had to be 5m close to get the addAction visible and delete the "sleep 0.01;"-part. So all lights go off at once.

Delete all "sleep"- and "cuttext"-commands.

Note, that fuelstation lights will NOT go off...

write an init.sqf:

if (!isNull player) then {

[] spawn {

nul = player addAction ["Power off", {lightsOut = true; publicVariable "lightsOut";}, [], 0, false, true, "", "_this distance generator < 5 && isNil 'lightsOutVariable'"];

waitUntil {!isNil "lightsOut"};

1000 cutText ["Power off in 10 seconds!","PLAIN DOWN", 2];

sleep 9;

1000 cutText ["Power goes off - NOW!","PLAIN DOWN", 2];

sleep 1;

};

};

if (isServer) then {

waitUntil {!isNil "lightsOut"};

sleep 10;

{

_x setDamage 1;

sleep 0.01;

} forEach (getPos generator nearObjects ["Lamps_Base_F", 500]) + (getPos generator nearObjects ["PowerLines_base_F", 500]);

};

I hope this works for you with the lightsOFF-part.

Now you just need to get the "fire"-part started...

Share this post


Link to post
Share on other sites

Brilliant this works great thank you. I changed it a bit to just make it turn the lights off from the start. I just put this code in my players INIT. With my player name being p1

{  _x setDamage 1; _x hideobject true;  } forEach (getPos p1 nearObjects ["Lamps_Base_F", 1000]) + (getPos p1 nearObjects    ["PowerLines_base_F", 1000]);  

I added hide objects because it leaves lots of broken lamp post all over the place otherwise.

Edited by Anthonyfromtheuk
Lamp post laying everywhere

Share this post


Link to post
Share on other sites

As for the fire i cannot stop it being strange when i walk past it but by putting a hidden fireplace under the wreck i want to burn, at least it generates light because for some strange reason test_EmptyObjectForFireBig does not generate any light.

Share this post


Link to post
Share on other sites

How to add on generator options when i drop democharges or hand granate to kill the lights automaticly? And how to add generator sound while is running and no sound when it is destroyed or it is in off position? Tnx for script!

I am using this script...

http://www.armaholic.com/page.php?id=24220

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  

×