Jump to content
Sign in to follow this  
MANTIA

Getting A.i. Mortar Team to fire on target repeatedly

Recommended Posts

Hello guys. I'm putting together a mission where you have to hunt a series of enemy mortar sites.

Basically I want an a.i. mortar to repeatedly fire onto a position on a map. The players will listen to the tubes out fire to determine the exact position of the enemy mortar.

This is what I thought would do the trick. The a.i. mortar seems to acknowledge the "watch" part as he spins himself around and points the tube toward the target (variable T1). However he doesn't fire a single round.

The target is an invisible helipad named T1

this doWatch T1;

T1 = this select 1;

mortar = this select 0 ;X = getPos T1 select 0; Y = getPos T1 select 1;

mortar1 commandArtilleryFire [[X, Y, 0], "8Rnd_82mm_Mo_shells", 1];

goto"redo";

Any ideas on how to get this mortar man to fire?

Share this post


Link to post
Share on other sites

Hey there, you could do the following:

artillery unit init field:

nul = [this,"Marker1"] execVM "arty.sqf";

arty.sqf:

_arty = _this select 0;
_target = _this select 1;


while {alive _arty} do {
effectiveCommander _arty commandArtilleryFire [getMarkerpos _target, currentMagazine _arty, 1];
_arty setVehicleAmmo 1;
sleep 5;
};

This will fire indefinitely on the specified marker, you can put it into as many units as you want and use as many markers as you want.

Works for all artillery units.

Adjust the sleep to your liking and delete the setVehicleAmmo command if you want them to run out of ammo.

Cheers

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  

×