Jump to content
Sign in to follow this  
mattxr

Autoflares Script Help.

Recommended Posts

Hello all im trying to make a script which makes flares fire into the sky in a random pattern.. anyways this is the sqs i used in flashpoint but i just cant get it to work in arma. Could anyone please help me thanks! Autoflares=true will be set in a param for it to be selected.

;----------------------------------------------

?!(local Server): exit

~4

? Autoflares : goto "start"
exit

#start

_Xpos = getpos middle select 0
_Ypos = getpos middle select 1
_Xspread = 250
_Yspread = 500
_flares = ["F_40mm_White","F_40mm_Red","F_40mm_Geen","F_40mm_Yello"]

_localtargetcounter = 0

#loop

_X = _Xpos
_Y = _Ypos

_X = _X + (random _Xspread - _Xspread /2)
_Y = _Y + (random _Yspread - _Yspread /2)

_flare = _flares select random 3


_flare1 = _flare createvehicle [_X,_Y,120]

~10 + random 10
goto "loop"

Share this post


Link to post
Share on other sites

In sqf:

private["_x","_y","_xpos","_ypos","_xspread","_yspread","_flares","_flare1"];
if(isServer) then {
sleep 4;
_xpos = (getpos middle) select 0;
_ypos = (getpos middle) select 1;
_xspread = 250;
_yspread = 500;
_flares = ["F_40mm_White","F_40mm_Red","F_40mm_Green","F_40mm_Yellow"];
while { autoflares } do {
	_x = _xpos + ((random _xspread) - _xspread / 2);
	_y = _ypos + ((random _yspread) - _yspread / 2);
	_flare1 = (_flares select (random 3)) createvehicle [_x,_y,120];
	sleep (10 + random 10);
};
};

true

It doesn't require a game logic with the name 'server' anymore, but it still requires an object with the name 'middle'. I've set the variable 'autoflares' as condition of the loop, so you're able to shut it off in the mission by setting it to 'false'.

Share this post


Link to post
Share on other sites

Thanks so much worked like a treat.

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  

×