Comrades in Arms Discussion Board
Automatic AI artillery barrage - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: Automatic AI artillery barrage (/showthread.php?tid=1937)



Automatic AI artillery barrage - TonyMarony - 11-20-2010

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/artillerie-automatisches-dauerfeuer-virtuelles-ziel-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


Re: Automatic AI artillery barrage - Zwobot - 11-20-2010

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.


Re: Automatic AI artillery barrage - TonyMarony - 11-20-2010

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....


Re: Automatic AI artillery barrage - Overlord - 11-24-2010

Don't listen to Zwobot, his barrages tends to land on top of our heads Tongue


Re: Automatic AI artillery barrage - Zwobot - 11-25-2010

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?


Re: Automatic AI artillery barrage - TonyMarony - 11-28-2010

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




Re: Automatic AI artillery barrage - Zwobot - 11-28-2010

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


Re: Automatic AI artillery barrage - TonyMarony - 11-29-2010

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


Re: Automatic AI artillery barrage - Zwobot - 11-29-2010

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


Re: Automatic AI artillery barrage - TonyMarony - 11-30-2010

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



Re: Automatic AI artillery barrage - Zwobot - 12-03-2010

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.