Comrades in Arms Discussion Board

Full Version: Automatic AI artillery barrage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hola,

i´m messing around with hte editor once again ;-).

This time i had the idea, that my squad needs some artillery barrage for securing the insertion point. I want to have it like that the barrage is shooting at a certain distance (like 300m) ahead of my insertion point to keep the enemy from approaching my chopper, so the guys have a minute for the insertion and securing the perimeter.

So i was busy last week with searching around in several forums for the Artillery module in Arma (OA) and was able to get it running for my player to call in the support by Mapklick. BUT: I couldn´t make it working for shelling the place automatically (without any Klicking by player).

I think the most promising piece i found is this:
http://hx3.de/editing-scripting-167/arti...iel-16770/

from Armed-Assault.de.

It showes a interesting script:

_heTemplate = [“IMMEDIATE”, “HE”, 0, 15];
_targetpos = getposASL player;

[AriLogicName, _targetpos, _heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;


which is told to work as follows:
1. place a few mortar units
2. group them
3. make a artillery module logic and synchronize with the group
4. make a triger and on actviation set: this exec "bm21fire.sqs"

Sounds plain and simple, but it is not working for me. In game i get no error message, but no shells are showing up. ( i tried it with getpos Player for test - nothing happened, i tried with getpos objectnamex (eg. b1, which is the name of a objekct at the place i want the shells to fall later on) but with no shells either).

Any good ideas whats wrong or how i can get my idea into action?

Greets

Tony
The Biki article about the artillery module has all the basic information you need to script fire missions.

I think it would be most effective to meet up in TS for a few minutes to give you a walkthrough or answer specific questions.
weeell,

of course the biki is something like the homepage, if you are fiddling around with arty, and as i stated before, even i could make it run with hte help of the player, no problem with that (and that speak to itself if you know my editor skills ;-) )...

But in my opinion it doesnt help if you want it triggered without the players help, or did i miss something usefull? at least i couldnt work it out after reading and testing the site....
Don't listen to Zwobot, his barrages tends to land on top of our heads Tongue
Let me quote myself:
(11-20-2010, 06:05 PM)Zwobot link Wrote: [ -> ]I think it would be most effective to meet up in TS for a few minutes to give you a walkthrough or answer specific questions.
So, how are you fixed on time?
Hola,

maybe you are online tonight? I´ll be around at 20.00 for games. Maybe i can make it a bit earlier too. I´ll have an eye out ;-).

Thx + greets

Around 20.00 could work, depends on how the AGW battles work out.
yay!

Zwobot sorted out that thing with even less stuff to do. I want to post this solution to keep the topic helpful for any other editors who wants to have automatic AI atrillery barrage.

1. Set up a couple of mortars and group it
2. Set a Artillery Module (F7)
3. group the Artillery Module with the mortars and give the Artillery-) Logic a name (in this example "ArtiLogicName")
4. Place a trigger and set it, so it triggers off at a certain condition (e.G. bluefore is present).
5. copy in the ON Activation Field:
Code:
[AriLogicName, 200] call BIS_ARTY_F_SetDispersion; [AriLogicName, getposASL s1, ["IMMEDIATE", "HE", 0, 15]] call BIS_ARTY_F_ExecuteTemplateMission;

Where "200" is the dispersion of the shells and s1 is the name of the unit on whichs head you want to drop the stuff...

very simple and even not a script is needed!

Thx to Zwobot for this!

Cheers

 Tony

ED: Changed the Module type to correct type
You're welcome Tony.

(11-29-2010, 03:03 PM)Fat Tony link Wrote: [ -> ][...]
2. Set a SOM Module (F7)
3. group the SOM Module with the mortars and give the (SOM-) Logic a name (in this example "ArtiLogicName")
[...]
It's the artillery module, not the SOM module.

You can use the SOM module to call in artillery, but that's another story  Wink
hola,

thx for this bit of correction! Changed it in the post above to avoid errors.

This is going to get fun :-).

A short demo mission with the barrage (and a helo insertion without scripting included aswell :-) ):

maxcaddata.de/ofp/da.zip

Hope it helps anyone with the same aims ;-)

Greetz

  Tony
The following modification to the above code will place the centre of the artillery strike at a random location within a 150 meter radius of the target unit:
Code:
[AriLogicName, 200] call BIS_ARTY_F_SetDispersion; [AriLogicName, [((getPosASL s1) select 0) + (random 150) - (150 / 2), ((getPosASL s1) select 1) + (random 150) - (150 / 2), (getPosASL s1) select 2], ["IMMEDIATE", "HE", 0, 15]] call BIS_ARTY_F_ExecuteTemplateMission;

I have replaced the simple designation of the target location of
Code:
getposASL s1
with the calculation of the random position inside the 150 meter radius:
Code:
[((getPosASL s1) select 0) + (random 150) - (150 / 2), ((getPosASL s1) select 1) + (random 150) - (150 / 2), (getPosASL s1) select 2]
You can modify the radnom radius by changing the 150 numbers in above code.