Jump to content
Sign in to follow this  
Pioneer760

How to make AI shoot artillery in a specific way

Recommended Posts

Lone mission builder needs help for at least one of the following two problems

Background: I like to make AI shoot artillery without hearing the impact explosion near by

Solution A ---------------------

Make AI shoot smoke shells. My script is running well with standard HE shells, but not with the smoke shells/ smoke magazine classes. I do not know why.

(Vehicle ari1) addmagazine "8Rnd_82mm_Mo_Smoke_white"; 	//classes: 8Rnd_82mm_Mo_shells, 8Rnd_82mm_Mo_Smoke_white, 8Rnd_82mm_Mo_Flare_white
ari1 DoWatch [_X,_Y,_Z];
ari1 fire "Smoke_82mm_AMOS_White";                               //classes: mortar_82mm, Smoke_82mm_AMOS_White, 8Rnd_82mm_Mo_Flare_white

Solution B ---------------------

Make AI shoot in long range mode behind a mountain, but I have no clue how to code this long range mode.

Thanks a lot for your help!

Share this post


Link to post
Share on other sites

Thanks for your answer, but I have tried that already. And I have tried it again with some further tests to encircle the error. No positive effect.

There could be an unsolved issue with doArtilleryFire: "Confirmed, still an issue in stable, in dev 1.09 doArtilleryFire seems completely broken! :-o" (On server versions)

http://feedback.arma3.com/view.php?id=15818

On the other hand it seems to run just fine in youtube examples:

Hm, my code is not different from the examples and I have reduced my working script to the core task. Still no effect (the script is working - the gunner is adjusting the mortar, but not firing; the target is within the standard close range of the mortar)

ari1 doArtilleryFire [[16468.031, 680, 9022], "8Rnd_82mm_Mo_Smoke_white", 3];

Cheers

Edited by Pioneer760

Share this post


Link to post
Share on other sites

What are you running this mission on/trying to run on? 1.09 as development branch is a long way back and doArtilleryFire, according to the issue, is only affected on a dedicated server.

To expand, this code here works and guarantees that the artillery will shoot into oblivion. This particular code will cause the barrel to go upright and shoot upright, so fine tuning is obviously needed, but you'll get the gist.

artilleryUnitName doArtilleryFire [[(getposATL this select 0) + 1000, (getposATL this select 1) + 1000, 0], "32Rnd_155mm_Mo_shells", 4];

Also, to get the ammo that's usable for your particular vehicle, use getArtilleryAmmo. select 0 will/should always return a HE shell in case of a mortar/static artillery.

Share this post


Link to post
Share on other sites

You, Sir, are really fast. I just edited my first post and added some working links, proving the code works for standard mission. Thanks!

Anyhow its late on this side of the planet. I will force myself into that strange problem later. Wait! Your coordinates suggest XYZ order not XZY that I am using.

Arrggg, that was the problem! For some reason I thought its the alternate order.

Thanks for you help. Cheers!

Edited by Pioneer760

Share this post


Link to post
Share on other sites

Hello, I have used the script to make my artillery fire at a trigger. but when I go in to preview. The opfo rifle squad moves into the trigger area and my mortar just kind of moves in circles and will not fire. I am using the command mortar1 commandArtilleryFire [getposatl (thislist select 0), "8Rnd_82mm_Mo_shells", 6]; but nothing happens. Any help at all would be great.

Share this post


Link to post
Share on other sites

Just now I see your comment - it was not busy here for a while. Why dont you post your code? I my case it works just fine. Below I ll post the entire code.

Good luck

Pioneer760

//;;----------------------------------------------------------------------------------------------------------------------------------
//;
//;;
//;;----------------------------------------------------------------------------------------------------------------------------------


if (!isServer) exitWith {};
If ((not alive ari1) and (not alive ari2) and (not alive ari3)) exitWith {};


// aritarget2
//_X = 16468.031;
//_Y = 9022.5645;
//_z = 680.3761;


//_X = 9618.8584; 
//_Y = 9809.8506; 
//_z = 1200;

// 	mortar class: O_Mortar_01_F

(Vehicle ari1) addmagazine "8Rnd_82mm_Mo_shells"; 	//8Rnd_82mm_Mo_Smoke_white		8Rnd_82mm_Mo_shells	8Rnd_82mm_Mo_Flare_white
(Vehicle ari2) addmagazine "8Rnd_82mm_Mo_shells";
(Vehicle ari3) addmagazine "8Rnd_82mm_Mo_shells";


//16468.031, 9022, 680

_shellMagType = "8Rnd_82mm_Mo_shells"; 	//8Rnd_82mm_Mo_Smoke_white


ari1 doArtilleryFire [[13622,  7478, 120], _shellMagType, 2];	
Sleep 0.8;
ari2 doArtilleryFire [[13622,  7478, 120], _shellMagType, 2];
Sleep 1.2;
ari3 doArtilleryFire [[13622,  7478, 120], _shellMagType, 2];

Sleep 8;

ari1 doArtilleryFire [[16468,  9022, 680], _shellMagType, 1];	
Sleep 0.9;
ari2 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];
Sleep 1.5;
ari3 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];

Sleep 8;

ari1 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];	
Sleep 1.4;
ari2 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];
Sleep 0.5;
ari3 doArtilleryFire [[16468,  9022, 680], _shellMagType, 1];

Sleep 10;

ari1 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];	
Sleep 0.8;
ari2 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];
Sleep 1.5;
ari3 doArtilleryFire [[16468,  9022, 680], _shellMagType, 2];


ari1 DoWatch [_X,_Y,_Z];
ari2 DoWatch [_X,_Y,_Z];
ari3 DoWatch [_X,_Y,_Z];

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  

×