Home   Help Search Login Register  

Author Topic: ATGM Dispersion / Accuracy  (Read 3414 times)

0 Members and 1 Guest are viewing this topic.

Offline snafu

  • Members
  • *
ATGM Dispersion / Accuracy
« on: 07 Aug 2019, 22:28:53 »
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?


Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: ATGM Dispersion / Accuracy
« Reply #1 on: 08 Aug 2019, 19:06:01 »
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  :(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline snafu

  • Members
  • *
Re: ATGM Dispersion / Accuracy
« Reply #2 on: 08 Aug 2019, 22:46:10 »
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  :)


Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: ATGM Dispersion / Accuracy
« Reply #3 on: 10 Aug 2019, 11:26:31 »
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: )
« Last Edit: 10 Aug 2019, 11:29:56 by Gruntage »
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline SoldierEPilot

  • Members
  • *
Re: ATGM Dispersion / Accuracy
« Reply #4 on: 10 Aug 2019, 14:27:10 »
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: [Select]
this addEventHandler ["fired", "_this exec {onFired.sqs}"]
Put this file to mission folder:
onFired.sqs:
Code: [Select]
_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"

Offline snafu

  • Members
  • *
Re: ATGM Dispersion / Accuracy
« Reply #5 on: 11 Aug 2019, 17:24:35 »
Two excellent suggestions there, gents  :)

Appreciate the assistance.

Quote
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.

My first idea was to go to JAM and I tested the HD versions of armor. However, HD didn't appear to impact MG or ATGM fire which was unfortunate.