Jump to content
Sign in to follow this  
MP

FlakGun script...

Recommended Posts

Here is a script that I compiled over night that simulates AAA from fixed guns on the ground, otherwise known as "Flak".

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Actor = _this select 0

_Centre = _this select 1

_area = _this select 2

_minZ = _this select 3

_maxZ = _this select 4

_freq = _this select 5

_rounds = _this select 6

_ActorPos = GetPos _Actor

_oldx = _ActorPos select 0

_oldy = _ActorPos select 1

_oldz = _ActorPos select 2

_CentrePos = GetMarkerPos _Centre

_cx = _CentrePos select 0

_cy = _CentrePos select 1

_areaX2 = _area * 2

_value = (_maxZ - _minZ) * 2

_rounds = _rounds - 1

_Actor SetPos [_cx + Random(_areaX2) - _area,_cy + Random(_areaX2) - _area, Random(_value) + _minZ]

_Actor SetDammage 1

~0.01

_Actor SetPos [_oldx,_oldy,_oldz]

_Actor SetDammage 0

~_freq

? (_rounds > 0) : goto "Update"

exit<span id='postcolor'>

Explaination:

The script will be exec'ed by [Actor,"Centre",Area,MinZ,MaxZ,Freq,Rounds] exec "script.sqs"

Actor= The unitname to start the fireing (e.g a russian guy)

Centre= The target marker where it will be fireing from,

Area= The maximum spread from the centre of the target marker,

MinZ= The minimum hight for the rounds to explode,

MaxZ= The maximum hight for the rounds to explode,

Freq= The time between each explosion,

Rounds= The maximum number of rounds for the battery.

This has not yet been fully tested by myself so if it isint working for you then post the error message and I'll get it fixed.

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  

×