Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-11-26 20:37        
     
working on a night attack mission and have run into a bit of a snag.

there are 10 lights; 6 halogen, 4 street, in a rather large area i want disabled.

being new to scripting (well, newish), i googled it to find the normal way of doing it with "switchlight" won't work
so i can't just attach a game logic to the nearest power station (2 Klicks away) that says
{_x switchLight "OFF"} forEach ((getPos this) nearObjects ["StreetLamp",5000]);

now in my search i found 2 sets of work-arounds

one using sethit
_lamp = nearestObject [player, "Lamps_base_F"];
_lamp setHit ["light_1_hitpoint", 0.97]; //off
_lamp setHit ["light_1_hitpoint", 0]; //on

and this one by Pirin
// 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 "someMarkerName" nearObjects [_types select _i, 500];
	sleep 1;
	{_x setDamage _onoff} forEach _lamps;
};

i have only vauge ideas on how to use either of these.
specifically i need some instruction on how to apply them.

i get that the set hit has to be applied to the object in question, but i don't know how, and i think i'd have to do it 4 times on each of the 6 halogen lamps, as each of those have 4 individual lights that i've had to shoot out in the past. i also understand that the Pirin method involves a some kind of map marker, but that's about all i understand.

my scripting ability goes about as far as making loadouts and everything i've learned through trial and error and quick looking things up, please try to keep that in mind.


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 29
In-game name: big_wilk

 
#2 Posted at 2013-11-26 20:43        
     
Yeah this does not work in Arma3 I spent ages trying to do the same thing as you..

Heres a working demo: https://www.dropbox.com/s/tpt2esi6q3m98uc/Intel%40LightsOff.Stratis.rar

Repeat the scripts in the place you want to kill the lights, edit this line, changeing the 500 changes the are of influence.

_lamps = getMarkerPos "lightMarkerTest" nearObjects [_types select _i, 500];


Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2013-11-26 21:01        
     
where does this script go? In the Initialization field of something? that's the part i don't understand.


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 29
In-game name: big_wilk

 
#4 Posted at 2013-11-26 21:51        
     
you put the file you deziped into your

C:\Users\WindowsUserName\Documents\Arma 3 - Other Profiles\YourProfilename

then you can open it in the editor.