; minigun.sqs
; Syntax:
; [marker object,time in seconds,radius in metres,rate of fire in rounds per min] Exec "minigun.sqs"
; notes
; bullets 'fired' at 30 degree angle to maximise chance of hitting something,
; point of aim is offset from target object to compensate.
; _radius = random _strikeradius - linear distribution
; _radius = _strikeradius * (random 1)^2 - concentrates fire on point of aim
; _radius = _strikeradius * sqrt (random 1) - even spread across area
_markerobj = _this Select 0
_firetime = _this Select 1
_strikeradius = _this Select 2
_rateoffire = _this Select 3
_strikex = GetPos _markerobj Select 0
_strikey = (GetPos _markerobj Select 1) - 6
_delay = 60 / _rateoffire
_stoptime = time + _firetime
#fire
; POI
_angle = random 360
; _radius = random _strikeradius
; swap with either to taste:
; _radius = _strikeradius * (random 1)^2
_radius = _strikeradius * sqrt (random 1)
_strike = "Bullet12_7W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
; _strike = "Bullet7_6W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
_strike SetVelocity [0,500,-300]
~_delay
?(time > _stoptime): exit
Goto "fire"
exit