Home   Help Search Login Register  

Author Topic: More bullets, less hits, more fun, more real? Small script here  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
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  :P

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.3 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 ;D

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.


activated by this in INIT: of unit

unit addeventhandler ["fired", {_this exec "spray.sqs"}]

;spray script

Code: [Select]
_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 > 30: goto "end"
   ~0.01
   goto "start1"

#start2
   _man setdir _mandir
 Â Â Â _mandir = _mandir - 0.06
   _count = _count + 1
   ? _count > 30: 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. ;D


Zay out
« Last Edit: 13 Mar 2003, 12:42:12 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Josef

  • Guest
This is nice, although that AK from BAs has a High Disp to make this effect...

Your way whould be better, it makes the first shot hit the spot and then he spray...

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Thanks for your comments josef  :)

Ive continued the thread here with a test map:



http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=7298

Zay out

« Last Edit: 14 Mar 2003, 04:52:06 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"