Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting General

ATGM Dispersion / Accuracy

(1/2) > >>

snafu:
Recently I've been creating some Cold War-era armor missions and have tried to include some fixed ATGMs and armor equipped with ATGMs on each side. However, I've found the ATGMs to be too effective. Was there ever a mechanism or script developed to create dispersion for ATGMs launched from armor, static weapons and aircraft?

h-:
Using "fired" eventhandler to execute code that modifies the velocity of the fired projectile with setVelocity should do the trick.  :hmmm:

It just involves "space maths" because you cant just modify the velocity with some random values because it would also affect the speed of the projectile.
I lack the brain to give an example  :(

snafu:
I did think about using invisible targets around tanks with the idea that the AI might engage them and create a sense of ATGMs missing their targets due to an operator error etc. However, your method sounds better. I'll have a play around with it and see what it's like.

Thanks  :)

Gruntage:
It's been a long time since I played OFP but I do have a suggestion.

However it depends on the answer to this question, can a missile or any other kind of projectile be deleted when it's in flight?

Maybe some kind of nearestobject code following a 'fired' eventhandler perhaps?

My suggestion is simply spawning explosions in a radius around a target, which can be done using any artillery script around with a little modification. You'd still see the missile being fired however. Just that it gets deleted very shortly after firing...in fact, near instantly. This way you don't have to mess with velocity of missiles in flight. This is just an idea and I have no idea if projectiles can be deleted.

If my memory serves me well, Mandoble played around with custom missiles and velocity stuff in his campaign Grunt ONE. Perhaps it's worth looking in there...it's also a very good campaign so worth a play if nothing else  :)

EDIT: I just remembered that THobson played around with spawning projectiles in his Abandoned Armies mission. So by creating the right kind of projectile (such as a missile) at random points around a set position (a radius essentially), you would get the dispersion effect I think. That's where I would look. (How do I remember this stuff from 10 years+ ago  :blink: )

SoldierEPilot:
Human activity detected :D

BIS ATGMS are children of LAWLauncher with default params:
dispersion=0.002;
aiDispersionCoefX=1;
aiDispersionCoefY=1;

One can increase dispertion of LAWLauncher in BIN\config.cpp or
in addon configs.
----------------------------------------------------------

It's also not a rocket science to use scripts like these:

In init field of unit with ATGM:

--- Code: ---this addEventHandler ["fired", "_this exec {onFired.sqs}"]
--- End code ---

Put this file to mission folder:
onFired.sqs:

--- Code: ---_unit=_this select 0
_ammoClass=_this select 4
_r=nearestObject[_unit, _ammoClass]

; ajust _k value here to change the dispersion value
_k = 8

#fly
?isNull _r: exit
_v=velocity _r
_vNew=[(_v select 0)+_k-(random 2*_k),(_v select 1)+_k-(random 2*_k),(_v select 2)+_k-(random 2*_k)]
_r setVelocity _vNew

; ajust time period between deviations here
~(0.2+random 0.3)
goto "fly"
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version