I dont want to go against the advice of almighty sui :thumbsup: but there is a way to do this.
First of all add a fired eventhandler to the unit in question, whether vehicle or unit (i havn't tested with vehicle yet).
Next add a script that looks like this
; keepfiring.sqs
; By Paddy for NIMOD (www.nimod.net) (paddy@nimod.net)
; All scripts are property of Paddy and available freely for editing ON REQUEST only
;
; Any modified versions must recognise and name Paddy and NIMOD as original creators
;
; A script designed to keep a unit firing (sustained)
; Called by event handlers in coverfire
;
;NB: Script will be part of URBAN AI pack by NIMOD available from www.nimod.net
;
;
;-------------- Define some variables ---------------------
private ["_unit","_weapon","_muzzle","_mode","_ammo","_fire","_rocket"]
_unit = _this select 0
_weapon = _this select 1
_muzzle = _this select 2
_mode = _this select 3
_ammo = _this select 4
_rocket = nearestobject [_unit,_ammo]
_fire = 0
;-------------- Remove EH to prevent repeated detection ---------------------
_unit removeAllEventHandlers "fired"
;-------------- Set a fire pattern, check weapontype ---------------------
? speed _rocket > 3500 : goto "machinegun"
? speed _rocket < 2000 : goto "end"
#riflefire
~1
_unit fire [_weapon]
_fire = _fire+1
? _fire < 10 : goto "riflefire"
goto "end"
#machinegun
~1
_unit fire [_weapon]
_fire = _fire+1
? _fire < 50 : goto "machinegun"
goto "end"
#end
;-------------- End script (EH re-added in coverfire, not here) --------------------
_unit domove getpos _unit
_unit removeAllEventHandlers "fired"
~0.3
Exit
Or something like that
This will make a unit fire more , multiple rouns on the target instead of just one.
I am in the process of making an advanced AI script that will do all this and more, including
- decreasing AI accuracy and making them give coverfire to comrades
- Making AI behave properly in urban enviroments
- Making weapons fire more accuratly
As you may have noticed the above script is part of that AI script so if you want more u'll have to wait til i release it!!!
P.S. have a look at bored_onion's RPG path deviation script to decrease unit accuracy
Hope this helps
Peace out!