Jump to content
Sign in to follow this  

Recommended Posts

Is there a way to track a shot from a Mortar ?

I need to try and work out the coordinates i.e. 0125,0643 on the map where it lands

Is that possible ?

Share this post


Link to post
Share on other sites

Where it lands there will be a mortar crater created. You could use nearestObject to look for it's p3d.

Share this post


Link to post
Share on other sites

Hmm how would I do that? – I only need it to come up as a hint nothing to fancy! or even a red dot marker would be good ?

Also if they readjust and fire again, and it is next to the last one which one will it get next time?

Is there a way to track the projectile?

Edited by psvialli

Share this post


Link to post
Share on other sites

are you trying to calculate the the actual firing arc of the mortar?

else just use fired eventhandlers and track the projectile, or if using artillery module, there is options for mortar radar there believe.

Share this post


Link to post
Share on other sites

No not using the Module all manual

Can you please let us know how I would use the eventhandlers and track the projectile, as I would like to show the Grid coordinates and a marker on the map that show where it hit for a few seconds

Thanks

Share this post


Link to post
Share on other sites

addEventHandler ["fired",{[_this] spawn fn_shellTracker}]; //time insensitive

fn_shellTracker = {

_projectile = _this select 6; //or was it 5? writing from memory, look it up.

_pos = getPos _projectile;

//add your marker here.

while {alive _projectile} do {

//update markers position

sleep 0.345;

};

sleep 10;

deleteMarker "yourmarker";

}; //end spawned script

Too tired to look it up myself, but somewhere along those lines.

Share this post


Link to post
Share on other sites

add this into the init of the gun you wish to track bullets of.

this addEventHandler ["Fired", {_this execVM "trackBullet.sqf";}];

save this as trackBullet.sqf

_projectile = _this select 6;

// this part is dynamically creating a new marker.
_cnt = 0;
_markerName = "EH_Fired_Bullet";
while {!isNil (_markerName)} do {
_markerName = format ["%1_%2",_markerName,_cnt];
_cnt = _cnt + 1;
};

//creating the marker with the name from above.
_marker = createMarker[_markerName,(getPos _projectile)];
_marker setMarkerShape "ICON";
_marker setMarkerType "DOT";
// add more details for the marker if you wish. look up createMarker on wiki and you get all the commands available.

// track the projectile with the marker while its alive, (bullets die on impact).
while {alive _projectile} do {
_marker setMarkerPos (getPos _projectile);
sleep 0.1;
};

// delete the marker when bullet is dead.
deleteMarker _marker;

edit: untested but something like that, maybe the dynamic markername is not working properly, let me know and ill see if i can fix it.

Edited by Demonized

Share this post


Link to post
Share on other sites

yeah add into the while loop:

edit: add this before the while line:

_impact = [];

_impact = getPos _projectile;

after the while loop (last }; after while)(now its dead, asume impact add this:

hint format ["impact was at position %1",_impact];

how to get Grid coords youll need to get from that position, im sure there is a way.

edit: here is something to read up on for that:

http://community.bistudio.com/wiki/Converting_position_to_map_grid

Share this post


Link to post
Share on other sites

Again thanks for this have been trying all morning , but getting now where.

Will add that in now and thanks for the link that will come in handy !

Share this post


Link to post
Share on other sites

For the map grid position try this....

_gridPos = [url="http://community.bistudio.com/wiki/mapGridPosition"]mapGridPosition[/url] getPos player;

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
Sign in to follow this  

×