Jump to content
Sign in to follow this  
arthur666

what's wrong with this artillery script?

Recommended Posts

named CDF_mort.sqf

#define __debug false

_mortarTgtPos = _this select 0;

if (__debug) then { player sideChat "Executing mortar.sqf" };

if ([CDF_mort, _mortarTgtPos, fireMission select 1] call BIS_ARTY_F_PosInRange) then
{
[CDF_mort, _mortarTgtPos, fireMission] spawn BIS_ARTY_F_ExecuteTemplateMission;
_mrk = createMarker ["MortarTarget", _mortarTgtPos];
_mrk setMarkerColor "ColorBlack";
_mrk setMarkerShape "ICON";
_mrk setMarkerType "mil_objective";

waitUntil {CDF_mort getVariable "ARTY_ONMISSION"};
if (__debug) then { player sideChat "mortars are on a mission" };
if (__debug) then { player sideChat format["ammo used: %1", CDF_mort getVariable "ARTY_AMMO"] };
waitUntil {CDF_mort getVariable "ARTY_COMPLETE"};
if (__debug) then { player sideChat "mortars have finished fire mission" };
waitUntil {CDF_mort getVariable "ARTY_SPLASH"};
if (__debug) then { player sideChat "mortars about to splash!" };

sleep 10;

deleteMarker _mrk;
}
else
{
hint "W mortars";
};

if (__debug) then { player sideChat "Exiting mortar.sqf" };

My mortars fire, but only once. I want them to fire at different targets spotted by friendlies until they run out of ammo.

My -On Act- in the trigger area, which is set OPFOR-Repeatedly-Detected by BLUFOR

firemission = ["IMMEDIATE","HE",0,8]; nul=[getPosASL (thisList select 0)] execVM "CDF mort.sqf";

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  

×