Jump to content
Draygone

Large ground target

Recommended Posts

After having some trouble in some missions I was curious about the accuracy of artillery, particularly between normal, guided and laser guided rounds. To do this I wanted to create a target I could shoot at which would spawn some sort of marker when hit by a round. I managed to do this by using blocks with a script attached to spawn spheres using the HitPart event handler. However the biggest block is only 12m x 12m and I need a much bigger target. I was curious if there was some sort of basic object I could create of a set size that registered hits.

 

Alternatively if there was some other way to create an area where projectiles hitting the ground were registered, maybe with triggers or logic, that would also be cool (I'm more interested in getting the right result.

 

Finally, if I have to use multiple blocks (or some other object), is there a way to spawn a large number of them in a grid so that they all are scripted to register and spawn on hits.

 

Any of these methods would do.

Share this post


Link to post
Share on other sites

There's a lot of scripts out there made during Arma 2 that do this sort of thing.  You add a "fired" eventHandler to the gun and track the projectile periodically in fight.  When it becomes null, you use the last recorded position and spawn a marker there.  Then it doesn't matter where or what it hits.

this addeventHandler ["fired",{
    (_this select 6) spawn {
        _lastPos = ASLtoAGL getPosASL _this;
        while {alive _this} do {
            _lastPos = ASLtoAGL getPosASL _this;    
            sleep 0.01;
        };
        // then return _lastPos and check time once it is "dead"
        player sideChat format ["Pos: %1, Time = %2", _lastPos, time];
        _mkr = createMarker ["position" + str _lastPos + str time,_lastPos];
        _mkr setMarkerSize [15,15];
        _mkr setMarkerShape "Ellipse";
        _mkr setMarkerBrush "SolidBorder";
        _mkr setMarkerColor "ColorBlack";
        _mkr setMarkerAlpha 0.5;
    }
}];

 

  • Like 3

Share this post


Link to post
Share on other sites

Ok, I implemented that and managed to get some nice results, here is the scatter of 1000 155mm HE rounds from the M4 Scorcher fried at a target. However when I went to test guided and laser guided rounds I ran into a problem. These rounds seem to be made of two parts The first part which acts like a normal round and despawns a distance from the target, and the guided part which spawns in its place to then hit the target. This means that the script registers the location of the first part despawning and not the end point of the guided component.

Does anyone have a way of tracking that second part?

  • Like 1

Share this post


Link to post
Share on other sites

You need to get the children of the munition (ie, the submunition).  I don't think it's clearly documented so you may be better off doing your own testing and working out what's going on.  I need to something on this in the future, but have no idea for now.  :)

Share this post


Link to post
Share on other sites
_this removeAllEventHandlers "Fired";
_this addEventHandler ["Fired",{
	_this spawn {
		_projectile = _this select 6;
		_lastPos = [0,0,0];
        waitUntil {
            if (isNull _projectile) exitWith {true};
            _lastPos = getPos _projectile;
            false
        };
		_nearObject = nearestObject [_lastPos,getText (configfile >> "CfgAmmo" >> typeOf _projectile >> "submunitionAmmo")];
		_mrkDest = createMarker [str _lastPos, _lastPos];
		_mrkDest setMarkerShape "ICON";
		_mrkDest setMarkerType "mil_dot";
		_mrkDest setMarkerText "SPLIT";

		_lastPosFinal = [0,0,0];
        waitUntil {
            if (isNull _nearObject) exitWith {true};
            _lastPosFinal = getPos _nearObject;
            false
        };
        _mrkFinal = createMarker [str _lastPosFinal, _lastPosFinal];
		_mrkFinal setMarkerShape "ICON";
		_mrkFinal setMarkerType "mil_dot";
		_mrkFinal setMarkerColor "ColorRed";
		_mrkFinal setMarkerText "IMPACT";

	};
}];

This script will create a marker on 

  1. The position where the shell gets replaced
  2. Where the new shell impacts

 

1RoLctR.jpg

 

Might lead to some undefined behaviour when you use it on a shell that doesn't split.

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×