Started this in sdvanced scripting forum but thought it be better here so I closed the other thread ;D
ok
Ive thought about the AI and their firing in the game, seems its either way too accurate sometimes or rediculously lame.--EG choppers firing at ground troops--even when the chopper does fire sometimes he can empty his entire browning MAG at a spot one foot away from a stationary careless target and all the bullets went into the same hole
So i made this wee script but need help to make it so the AI doing the firing also sprays a bit above and below the target also.
Its works quite well actually, it only activates when an AI fires and deactivates 0.5 seconds after he has fired.
tried it on infantry and a lot more bullets went flying than normal, less hits--I thought with propper tweaking it could resemble more wot real weapons and average soldiers would be really like.
Perhaps more real if it were applied only to certain types of weapons. I dunno too much about ballistic and such but I wonder sometimes about AK accuracy and how AI fire--looking more for the "pray and spray" effect here by AI that is
We all know that when humans in the game apply suppressing fire I SURE as heck get my butt down to cover.
Funny thing is that in some circumstances this lil script actually makes guns MORE effective in killing--eg Machine gun. An old soldier told me once that u dont wanna MG to be too accurate--u want it to scatter fire and blanket an area.
Well the following makes for one HECK of an extended FIRE FIGHT between AI-- and I dont think they are too inaccurate at all. However tweaks will be needed.
Its WAY cool.
#1The AI dont all kill each other in 5 seconds.
#2 Sporadic firing all over the place
#3 heaps more wounded
#4 the script doesnt alter the accuracy of the first shot--so the first shot always goes where it should. They only spray after the first shot. ;D So if AI are using single shot (bolt action) or sniper rifle it doesnt affect em.
I mean thats more real aint it? the first shot is the one that counts methinks?
activated by this in INIT: of unit
unit addeventhandler ["fired", {_this exec "spray.sqs"}]
;spray script
   _man = _this select 0
   _count = 0
   _start1 = "start1"
   _start2 = "start2"
   _start1_and_start2_array = [_start1, _start2]
   _random = random (count _start1_and_start2_array)
   _random = _random - _random % 1
   _randomstart = _start1_and_start2_array select _random
   _man removealleventhandlers "fired"
   _mandir = getdir _man
   goto _randomstart
#start1
   _man setdir _mandir
   _mandir = _mandir + 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start1"
#start2
   _man setdir _mandir
   _mandir = _mandir - 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start2"
#end
   _man addeventhandler ["fired", {[_this select 0] exec "spray.sqs"}]
exit
Your thoughts, suggested improvements welcome
Especially for firing above and below target--I dunno if thisll work for a gunner in a chopper cause it uses setdir and when a guy is in a chopper I think his direction is determined the direction of the chopper , not where hes facing. I could be wrong tho.
attached test map, for really extended fire fight. Ive made player immortal so sit amongst the guys and hear all the bullets whizz past around you ;D
Zay out