Jump to content
Sign in to follow this  
headspace

ArmA 2's Artillery Module

Recommended Posts

Would it be possible to put the exact min/max ranges of each artillery piece on the biki or this thread?

That info is readily available by using the commands listed in the biki, but I don't see why not. Just keep in mind that minimum and maximum range are going to vary with the height of the terrain--I'm going to be able to lob a shell a lot father from 1200 meters elevation down to a 300 meter elevated level then I would be able to do so against a target elevated the same or higher than me.

Share this post


Link to post
Share on other sites

Ah, neat. Could make a quick script that outputs some markers for those ranges. Would still be helpful to have an easy reference for rough min/max ranges though.

Share this post


Link to post
Share on other sites

i found a bug in the example missions on the biki. see i always wanted to look at the art while it fires. so i moved them to next to the player and went through the arti support request process. they didn't move to fire.

i changed them to the cannons. same deal.

reloaded the base mission - worked ok as it came but why not when i move the art i(mlrs or cannon) closer to me to watch em in action?

Share this post


Link to post
Share on other sites

EDIT: This works. Needs improvement but it does function.

Here's what I've been working on. It doesn't require secops and let's you set up custom fire missions in the function call. You would call it like this:

Nul=[bat,type,ord,delay,rnds,disp] execvm "FireMission.sqf";

Bat = name of artillery game logic

Type = timed or immediate fire, can use t for timed

Ord = type of round used like HE, WP, etc

Delay = time between rounds fired. If timed then how long rounds fire for

Rnds = total rounds fired

Disp = dispersion.

The rounds are shot from the weapons so don't stand infront of a mortar tube! This script was only tested with US mortars but has at least 1 fatal flaw, I can't get the mapSingleClick command to work properly. Due to this the artillery will always target the player. I tried turning the code into 2 blocks so the mapSingleClick would call the rest of the code, but then my vars went bad. So I changed the vars to global but then mapSingleClick stopped calling the rest of the script. Hope one of you can fix it.

Got to be honest I can't remember which version of the script this is so it may not work at all. Also the splash over and such hints don't work well. Also I'm at work and had to post from my BB so if it doesn't look pretty, sorry

EDIT:

K I think this may work. I'm using the marker (ty Wiper) to store the pos and then transfer that pos to _tPos. Hope this works.

If anyone would like to test it here's a quick instruction.

Make a map with you as a player. In your units 'INIT' field put this radio code:

1 setRadioMsg "Fire HE"; 2 setRadioMsg "Fire WP";

3 setRadioMsg "Fire Illum";

Next make some artillery. Don't worry about adding ammo, it'll work as long as you use the right name.

K. Now add an artillery Game Logic. Name it Battery1. Synchronize it with the mortar team leader.

Finally were going to add 3 triggers, one for each ammo type (HE, WP, ILLUM). Make the three triggers, set them to repeatable. Then for activation select the radio codes Alpha, Bravo, and Charlie. Next on the On Activation line enter the following:

under the Alpha radio command:

Nul=["Battery1","I","HE",2,10,50] execVM "FireMission.sqf";

under the Bravo radio command:

Nul=["Battery1","I","WP",2,10,50] execVM "FireMission.sqf";

under the Charlie radio command:

Nul=["Battery1","T","ILLUM",6,30,500] execVM "FireMission.sqf";

Finally cut and paste his code into notepad. Then save it in your mission file (my documents/documents/Arma 2/missions/ I think). Name it FireMission.sqf

glbbattery =_this select 0;

glbtype =_this select 1;

glbordType =_this select 2;

glbdelay =_this select 3;

glbrounds =_this select 4;

glbdispersion =_this select 5;

_tPos=position player;

hint "click on the map";

onMapSingleClick "[_pos] call ArtFire; onMapSingleClick ''; true;";

ArtFire

={

_tPos = _this select 0;

hint "clikced";

_marker = createMarker["Marker1",_tPos];

"Marker1" setMarkerPos _tPos;

"Marker1" setMarkerShape "Icon";

"Marker1" setMarkerType "dot";

"Marker1" setMarkerSize [1,1];

"Marker1" setMarkerColor "ColorRed";

if not((glbordType == "WP")or (glbordType == "SADARM") or (glbordType == "LASER") or (glbordType == "ILLUM") or (glbordType == "SMOKE")) then

{

glbordType="HE";

};

_fMission=["Immediate",glbordType,glbdelay,glbrounds];

if ((glbtype == "timed") or (glbtype == "Timed") or (glbtype == "t") or (glbtype == "T")) then

{

_fMission=["Timed",glbordType,glbdelay,glbrounds];

};

if not ([glbbattery,_fMission] call BIS_ARTY_F_StillViable) then

{

Hint "Artillery out of commission.";

exitWith;

};

if not ([glbbattery,_fMission] call BIS_ARTY_F_IsAvailable) then

{

Hint "Artillery unavailable at this time.";

exitWith;

};

If not ([glbbattery,_tPos,glbordtype] call BIS_ARTY_F_PosInRange) then

{

hint "out of range.";

exitWith;

};

[glbbattery,glbdispersion] call BIS_ARTY_F_SetDispersion;

[glbbattery,_tPos,_fMission] call BIS_ARTY_F_ExecuteTemplateMission;

If (glbbattery getVariable "ARTY_BADTARGET") then

{

hint "Bad Target, aborting mission";

exitwith;

};

waitUntil {glbbattery getVariable "ARTY_SHOTCALLED"};

hint "Shot fired, over";

waitUntil {glbbattery getVariable "ARTY_SPLASH"};

hint "Splash, over";

waitUntil {glbbattery getVariable "ARTY_COMPLETE"};

hint "Rounds complete, over";

};

If everything worked you should have a radio on the map screen with 3 options.

Edited by My Fing ID
Fix radio codes; removed some * in the code. If you see em get rid of em

Share this post


Link to post
Share on other sites

I'm trying to get the wiki example to work. Please don't point me in the direction of SOM, or anything else, I simply want to understand the example shown in the wiki.

I am getting this error in my rpt file.

Error in expression <template select 3 ];         
if (count _missionTemplate >= 5) then
{
_params = >
 Error position: <_missionTemplate >= 5) then
{
_params = >
 Error Undefined variable in expression: _missiontemplate
File ca\modules\ARTY\data\scripts\ARTY_CommonFunctions.sqf, line 312

I'm calling this from arty.sqf which is as follows:

_heTemplate = ['IMMEDIATE', 'HE', 0, 2];
_myBattery=lgc_art;
_targetPos=getPosASL tgt;
[_myBattery, _targetPos, _heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;

Share this post


Link to post
Share on other sites

Charliereddog: That's a known issue; however I have not observed it to affect the outcome of the fire mission. Is your fire mission working?

Share this post


Link to post
Share on other sites

Anyone with example mission with physical AI operated artyguns where I as a player can give them targets via map and then see them fire? Sorry didnt read through it all. Small pointer to an example mission if available would make my day.

Alex

Share this post


Link to post
Share on other sites

well, I'm sat next to the guns, and they don't seem to respond in any way. They certainly ain't firing. So long as it's not an error in my code, i'll not worry too much about it for now, and come back to it later on.

Share this post


Link to post
Share on other sites
EDIT: This works. Needs improvement but it does function.

I get "Out of range", regardless where I click on the map. Tried with Mortars and M119. Any Idea what may be the issue?

Share this post


Link to post
Share on other sites
72;1317630']Anyone with example mission with physical AI operated artyguns where I as a player can give them targets via map and then see them fire? Sorry didnt read through it all. Small pointer to an example mission if available would make my day.

Alex

Alex, check back a few pages. Some one posted a real basic artillery example mission. I think it's this thread. If not let me know and I'll find them on my PC and upload em somewhere.

Share this post


Link to post
Share on other sites

I give up until i have ARMA2 and then go back track all post trying to find it. Even though i see more people wanting this i dont think anyone made it yet. Dont think its that easy.

Thanks though Manzilla. ;)

Share this post


Link to post
Share on other sites

I made a little video based on the example mission by Headspace.

Share this post


Link to post
Share on other sites

Example missions aren't working in 1.02? :(

All the artillery pieces just aim up, but never fire.

Edited by Rommel

Share this post


Link to post
Share on other sites

yes I noticed that too.

does anyone have a fix?

I assume it has something to do with the modules being moved from Game Logic to their own category "Modules" in the editor, but simply replacing them does not seem to do the trick.

Share this post


Link to post
Share on other sites

Hi,

After looking at all the stuff to do with the Arty, I can't make heads or tails of it (Im a scripting noob). Im looking to have say 8 M119s at a FOB give arty support. I would then like to have the target designated via a map click and then fire without all the SOM stuff. Could someone please post instructions rarther than an example missions as I would like to do it and learn myself.

Thanks,

Hellfire

Share this post


Link to post
Share on other sites

Guys,

I've seen no issues with 1.02 so far, so if you can tell me exactly what you're doing (when it's not working) it'd be appreciated. Also note that the first (but not the later) version of VOP sound did something which caused an issue, and I believe that's been fixed.

Hellfire: If you just want to click on the map and have it happen, the tutorial in the "Quick Start" portion of the biki tells how to do that. Put your ExecuteTemplateMission command inside the action portion of a radio trigger and you'll be good to go. It may seem daunting at first, but it's rather straightforward once you do it once.

Share this post


Link to post
Share on other sites

Little bit of a complicated question ...

If I wanted to create an artillery battery when the mission is in progress, what would I have to do in order to get the group leader synced to an artillery logic? Is it possible to do after a mission has started?

Share this post


Link to post
Share on other sites

I wouldn't have thought so Beita.

Headspace: Ive managed to get the basics now. Ive gotten the Arty to fire via a Radio Trigger upon a target named "target", but I dont know how to get it to target a location clicked on the map, and Im also wondering how I can get the Strike to come available again after 5 minuntes.

Edited by Hellfire257

Share this post


Link to post
Share on other sites

@beita: I haven't tried this yet, but wouldn't using the function unit synchronizeObjectsAdd [objects] work? Where objects would be the array of artillery module names you want to sync to the GL?

Share this post


Link to post
Share on other sites

I can't get the sample arty missions working..either of them. I'm finding it very frustrating. I might be doing something really stupid, just not sure.

Here is what i'm doing...

Load either sample mission.... spawn in.. wait for some time, to give to module time to activate.

Go to the radio via the map screen...

If i click on the +1 Artillery Barrage i get a 'ping' noise.

After the 'ping' noise nothing... clicking on the map does nothing.. i've done everything i can think of.. i get no on screen hints or tips. Pointing the laser designator does nothing..

What does work: The teleport function... the random radio chatter and orders.

I haven't altered the mission in any way.. i'm loading the mission via > multiplayer > new mission.

I'm just left scratching my head. Can anyone help... i'll make a video and upload it if that will help.

Share this post


Link to post
Share on other sites

You press and hold space then when the menu pops up click on communication (just click), then hit 1 for request support then 1 again for artillery barrage. Simples!

Share this post


Link to post
Share on other sites

Thank you!! :icon_dj:

Was i being dumb and i simply missed these instructions or what.. as I never saw this mentioned! :eek: :o

Share this post


Link to post
Share on other sites

No worries mate, I just spent hours playing with it and found the space bar thing.

A question for a genius, when you manually target the mortars it gives you a time of flight (i.e 40seconds) for the ranges, how would I use get that information on the fly so that AI could call "Shot over, four-zero seconds" or something along those lines.

Also what do the lines mean I guess its simulating Probable Error For Range/Dispersion (Pr, Pd)? It just isnt entirely clear

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  

×