OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Jffsieg on 19 May 2007, 07:00:48

Title: Street Lights need to be turned off
Post by: Jffsieg on 19 May 2007, 07:00:48
Is it possible to turn off the street lights in Sahrani?

 ???
Title: Re: Street Lights need to be turned off
Post by: Willus_Killus on 19 May 2007, 11:55:05
probably but i couldent tell u how m8 will be something 2 do with "nearestobject" and its ID and stuff
Title: Re: Street Lights need to be turned off
Post by: Mandoble on 20 May 2007, 13:29:10
And where did you find any street light there? Was checking several towns and cities (3:30 am), not a single lightpost in any of them  :blink:
Title: Re: Street Lights need to be turned off
Post by: Jffsieg on 20 May 2007, 19:40:02
there are street lights in everytown
Title: Re: Street Lights need to be turned off
Post by: Mandoble on 20 May 2007, 19:47:05
Give the name of a town and the placement of them so I can locate them. May be there are too few, may be they are too weak, but the case is that I'm missing them (except a few quite weak ones over bridges).
Title: Re: Street Lights need to be turned off
Post by: Jffsieg on 21 May 2007, 01:31:10
Corazol has them, just past the building past the first bridge if you enter for the south's side.
Title: Re: Street Lights need to be turned off
Post by: Mr.Peanut on 22 May 2007, 16:36:24
Check the FAQ here (http://www.ofpec.com/FAQ/faq_obj.php#lights). Should still apply to ArmA.
Title: Re: Street Lights need to be turned off
Post by: genji on 25 May 2007, 00:08:42
Check the FAQ here (http://www.ofpec.com/FAQ/faq_obj.php#lights). Should still apply to ArmA.

Code: [Select]
(object12345) switchLight "off"
or maybe even

Code: [Select]
ID12345 switchLight "off"
but still its not working  :(
can anyone get this to work?

Title: Re: Street Lights need to be turned off
Post by: Mandoble on 25 May 2007, 01:05:37
Code: [Select]
// lightsoff.sqf
_pos    = _this select 0;
_range = _this select 1;

// Add more types if needed
_types = ["Land_lampa_vysoka", "Land_lampa_ind", "Land_lampa_ind_b", "Land_lampa_sidl", "Land_lampa_ind_zebr"];
for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   _lamps = _pos nearObjects [_types select _i, _range];
   Sleep 1;
   {_x switchLight "OFF"} forEach _lamps;
};

For example:
Code: [Select]
res=[getPos player, 3000]execVM"lightsoff.sqf"
Title: Re: Street Lights need to be turned off
Post by: genji on 26 May 2007, 17:19:57
Thankyou Mandoble  :clap:
im really learning a lot from you guys on these ace forums

now why couldnt i think of that  :D