Home   Help Search Login Register  

Author Topic: Enemies shooting but missing  (Read 819 times)

0 Members and 1 Guest are viewing this topic.

Gooner861

  • Guest
Enemies shooting but missing
« on: 18 Apr 2004, 19:13:29 »
Is there anyway in making an enemy say fire from a tank and it just exploding next to u but not killing or hurting you. It wud help add atmosphere and in a cutscene it wud look gud if rounds were exploding near u.

wamingo

  • Guest
Re:Enemies shooting but missing
« Reply #1 on: 19 Apr 2004, 21:09:23 »
unfortunately you can't make units in ofp miss on purpose so no, it's not possible, at least not to the extent you want...
and it may end up being very difficult...

what you can do is simulate a shell hitting here and there, that's very easy... but you won't see or hear the tank firing without getting your hands very very dirty in the scripting business - by the time you'd be done you'd be teaching BIS employees how to script... ;)

if you want the cheap explosion here and there start with checking out some of the simple artillery scripts from the editor depot...

good luck though.

j-man

  • Guest
Re:Enemies shooting but missing
« Reply #2 on: 19 Apr 2004, 21:24:10 »
I suppose you could set the tanks skill to the very lowest. That way their accuracy would be terrable. But, this is probably not the best way of achieving what you want.

DBR_ONIX

  • Guest
Re:Enemies shooting but missing
« Reply #3 on: 20 Apr 2004, 20:20:37 »
You could maybe make a new config for the tank (There is commentsed configs somewhere on this site), and put the dispersion up really high (I take it you can do that with tank guns)
Then it would spray around so much, you'd have to be pretty ublucky to get hit ;)

Not the easiest way, though
Oh, there was a script that makes full auto fire spread out a lot.. I think it's on the 3rd page on the beta scripts thread.. Might be worth a look

- Ben

Grendel

  • Guest
Re:Enemies shooting but missing
« Reply #4 on: 20 Apr 2004, 23:07:32 »
I posted a solution for this kind of thing on another thread, but heres a suggestion:

Use an invisible target addon (BAS Tonali Pack and MMP have them) and a simple script to place them around the tank. Combine with a reveal and dofire command and you should get the desired result. The example script would also need the DirToObj.sqf function which can be found in the ed depot function page.

Untested example script:

Code: [Select]
_it=invistargname
_tank=nameoftank
_targ=nameoftarget

;distance from target you want round to impact
_missdist=25

;keep tank from firing at target prematurely
_tank setcombatmode "green"

;--------------------------place invis target-------------------
_dir=[_targ,_tank] call dirtoobj
;randomize placement left/right of axis of fire
_rdir=_dir+random(180)-90
_pos=getpos _tank
_xp=_pos select 0
_yp=_pos select 1

_nxp=_xp+(_missdist*(cos _dir))
_nyp=_yp+(_missdist*(sin _dir))

it setpos [_nxp,_nyp]

;--------------------------fire at targ cycle-------------------
;number of rounds to fire but miss
_rnds=10

#firetop
_rnds=_rnds-1

_tank reveal _it
_tank dotarget _it
_tank setcombatmode "red"
_tank dofire _it
@unit ready _tank
_tank setcombatmode "green"
;wait to reload/"retarget"
~random(5)+5
?(_rnds>0):goto "firetop"

;back to normal
_tank setcombatmode "red"
exit

This will take a little work to set up (i.e. downloading addon/function and seting up function in init.sqs) but it should work (...should).  I'll test tonight.

-Grendel

BTW, actually the bit about using camcreated shells along with seeing/hearing the tanks fire would be easy as well, it would just need more code for some drop/sound efects.  I can do a script for this as well if anyone is interested (or the invis target thing doesn't work as planned).  Does that mean I should go on the official forum and let BIS know I'm ready to teach LOL  :P
« Last Edit: 20 Apr 2004, 23:13:22 by Grendel »