OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Nobby on 17 Dec 2002, 23:15:24

Title: Random MG fire, spraying instead of aiming.
Post by: Nobby on 17 Dec 2002, 23:15:24
How do you get a unit to spray MG fire instead of aiming?
e.g A unit fires from left to right OVER the "crawling" training object whilst another unit crawls UNDER the MG fire.
I know the doFire command will come up somewhere, and all attempts have come up short. Any help will be muchos appreciated.

Cheers

Nobby.
Title: Re:Random MG fire, spraying instead of aiming.
Post by: tai mai shu on 02 Jan 2003, 00:08:43
well ive seen a demo missoin for this somewhere...

youve gotta make 2 connected crawling thingys, then make a m2 machine gun a few yards away.    in a script, do this

#loop
machinegun dowatch crawlingthingy1
machine fire [browning, browning]
machinegun dowatchcrawlinthingy2
~.01
goto "loop"

or sumthin like that

what it does is makes the machine gun constantly fire ammo, while the machine gun swivels to watch crawling #1, then swivel over to watch crawling #2, so the machine gun sprays fire everywhere over the crawling things.
Title: Re:Random MG fire, spraying instead of aiming.
Post by: O Neil on 02 Jan 2003, 01:02:58
...so, isn't there an easier way to say, just make a Machine Gunner (M60) just spray in a general direction?

O Neil
 :gunman:
 :gunman:
 :gunman:                                                            :help:
 :gunman:
 :gunman:
 :gunman:
Title: Re:Random MG fire, spraying instead of aiming.
Post by: Pandoz on 08 Jan 2003, 07:04:46
haha well that is the only way i have found to do this...or  a similar way to do it...i just use the camera objects (tall grass i believe) and set 2 of them then do this basic thing and it will make the guy spray and pray basically
Title: Re:Random MG fire, spraying instead of aiming.
Post by: Spinor on 08 Jan 2003, 15:21:17
doWatch also works with a position instead of an object (according to ComRef):

unit doWatch [x,y, z]

hence you don't need the target objects:


;spraying around the target position [_x, _y, 0], scattering = +- 5 meters
#loop
   machinegun doWatch [_x + (random 10) - 5, _y + (random 10) - 5 , 0]
   machinegun fire [browning, browning]
   ~0.1
goto "loop"

Spinor
Title: Re:Random MG fire, spraying instead of aiming.
Post by: Pandoz on 09 Jan 2003, 04:02:49
hmm actually that is a really MUCH better way of doing it thanx...