Jump to content
flyingsaucerinvasion

Cancel Scripted Fire Mission Waypoint

Recommended Posts

I couldn't find a good solution to this anywhere on google, so I'm gonna share what I came up with.

 

To cancel a fire mission waypoint, such as this one:

_wp = _arty_group addwaypoint [_target_pos,0];
_wp setWaypointType "SCRIPTED";
_wp  setWaypointScript "A3\functions_f\waypoints\fn_wpArtillery.sqf";
_arty_group setCurrentWaypoint _wp;

What I found that worked was to first move the waypoint somewhere where they can't shoot at it, pause for a few seconds, then delete the waypoint.  NOTE:  I have not yet tested this on mobile artillery.

_wp setWaypointPosition [[1000000,0,0], 0];  //move wayoint somewhere where they can't shoot at it.
sleep 5; //pause to let above waypoint movement to take effect, before deleting waypoints.
_wp_count = (count (waypoints _arty_group)) - 1;
for "_i" from _wp_count to 0 step -1 do { deleteWaypoint [_arty_group, _i]; };	

-------

Here's a bonus piece of info:  You can add dispersion to the fire mission by moving the waypoint a little bit periodically while the guns are shooting:

_expire = time + 15;
while {time < _expire} do {
	_wp setWaypointPosition [_target_pos, 75];
	sleep 2;
};

The artillery crew seems to adapt almost instantly to changes in the waypoint position. 

 

--------

 

Another piece of info:   The artillery group used in conjunction with the fire mission waypoint doesn't have to be comprised of artillery of the same type, at least if you don't specify what kind of mag for them to fire.   See here for more info on specifying the mag type.

Share this post


Link to post
Share on other sites

There should be a cleaner solution by spawning the corresponding function (BIS_fnc_wpArtillery) and later just stopping it with terminate.

 

customartyscript.sqf:

_private _index = _this spawn BIS_fnc_wpArtillery;
private _group = _this select 0;
_group setVariable ["artyScriptIndex", _index];

 

setting the script to waypoint:

_wp  setWaypointScript "customartyscript.sqf";

 

stopping arty from firing (you have to know the group) :

 

_index = _group getVariable "artyScriptIndex";
terminate _index;

 

all of this not tested but should work this way.

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

×