Jump to content
Drongo69

Drongos Artillery (an advanced artillery system)

Recommended Posts

@CommanderX

You need to run the code after the system has initialized. Try making a script that adds the desired units and put a sleep of 5 or 10 seconds at the start.

Okay, it works now. Thanks. Is it possible in future versions to get that a bit simpler? Maybe something like linking the module with the soldier or much better an item that allows you to communicate with the artillery? :D :D

Share this post


Link to post
Share on other sites

Another thing that would be great, if the "Module" (hopefully it will come someday) is not only linkable to units, but also to items/objects. For example the Arty is only avaliable when you sit in a designated vehicle or building and you need a forward operator transmitting targets via TFAR/ACRE

Share this post


Link to post
Share on other sites

Mr. Drongo, does NoInitialInaccuracy module actually work? Because I still constistently get 100-150 m errors at 5-7 km distance.

Also, after the PLOT command, artillery doesnt want to execute a saved firemission (though claims that rounds are out).

Share this post


Link to post
Share on other sites

It works for me.

I am currently overhauling this mod, but some BIS bugs are making it very hard work.

Share this post


Link to post
Share on other sites

Courtesy of me and BlackAlpha at tier1ops.eu:

How to stop them from pointing away when firing:

   gunner _tube setskill ["aimingSpeed", 0];
   _tube setvariable ["FIRED",0];
   _firedwait = _tube addeventhandler ["fired",{(_this select 0) setvariable ["FIRED",1];}];
   sleep 1;
   // Fire
   _tube fire [_tubeType,_charge,_warheadType];
   waituntil {(_tube getvariable "FIRED") == 1; };
   _tube removeEventHandler ["fired",_firedwait];
   gunner _tube setskill ["aimingspeed", 1];

They'll still be swerving their turrets away from the target, but only after they've fired and the round is headed where it was intended. An additional sleep could help with that.

ps. No initial inaccuracy doesn't work for me either. Make sure you test it on high altitude targets.

Share this post


Link to post
Share on other sites
Courtesy of me and BlackAlpha at tier1ops.eu:

How to stop them from pointing away when firing:

   gunner _tube setskill ["aimingSpeed", 0];
   _tube setvariable ["FIRED",0];
   _firedwait = _tube addeventhandler ["fired",{(_this select 0) setvariable ["FIRED",1];}];
   sleep 1;
   // Fire
   _tube fire [_tubeType,_charge,_warheadType];
   waituntil {(_tube getvariable "FIRED") == 1; };
   _tube removeEventHandler ["fired",_firedwait];
   gunner _tube setskill ["aimingspeed", 1];

...An additional sleep could help with that.

To clarify, the above code should fix the problem already. The problem is caused by a game bug in which artillery decide to target the wrong area when being ordered to fire (by default they seem to want to point north and high up). We tested the above fix with vanilla mortar, vanilla 155mm and vanilla rocket artillery. They all worked. If you do happen to find a situation in which the above fix doesn't work, try putting a "sleep 1" behind the waitUntil line. But we're 99% certain the above fix should solve the problem.

The only issue we ran into was that the rocket artillery using a low trajectory would overshoot the target by 1 or 2 KM. We assumed this was a bug in the mod rather than that game bug. High trajectory rocket artillery worked fine.

To explain the above fix a bit more: You freeze the turret after the AI has aimed at the target and before the AI has fired, then after a round has left the barrel, you unfreeze the turret to allow the AI to aim at the next target pos. This is done by changing the aimingSpeed. The eventhandler ensures the aiming speed is only changed back after the shell has left the barrel. After firing, you can sometimes see the turret jerk a bit as the AI tries to aim north and high up, but that's OK because the shell is already in the air by that time and a split second later the AI continues to aim properly again.

We really like your mod, keep up the good work!

Edited by BlackAlpha

Share this post


Link to post
Share on other sites

Thanks very much for the detailed testing and solution guys. I haven't tried implementing it yet, but I am very pleased to hear you have figured this out. I have spent hours screaming abuse at the arty due to this bug. I tried all sorts of weird and unlikely things to stop it.

I'll also take a look at no initial inaccuracy and the rockets accuracy when I have time.

Cheers fellas :)

Share this post


Link to post
Share on other sites

Hey Drongo,

This thing is awesome, I'm having tons of fun with it.

I'd like to suggest something, can you add the GTL (gun-target-line, basically direction of fire) and the Max Ord (highest altitude attained by the projectile, vanilla arty computer has this value)?

I'm pretty sure jtac's would like those values to be there ;)

Thanks!

Share this post


Link to post
Share on other sites

G'day Drongo. I was wondering whether you would consider adding support for the Iowa class battleship into your artillery mod? I think it would allow for some great naval fire support missions.

Share this post


Link to post
Share on other sites
Thanks very much for the detailed testing and solution guys. I haven't tried implementing it yet, but I am very pleased to hear you have figured this out. I have spent hours screaming abuse at the arty due to this bug. I tried all sorts of weird and unlikely things to stop it.

I'll also take a look at no initial inaccuracy and the rockets accuracy when I have time.

Cheers fellas :)

Another thing, it may be a good idea to put the aimingSpeed on maximum (1) before ordering the AI to aim at the target, and then after ordering him to aim add some sort of waitUntil that checks if he's aiming at the right spot, then add a sleep 1 or 2 just to be sure the AI is given enough time to aim at the right spot. That way it should probably work with all artillery, all skill scripts/settings and all future mods. The thing to keep in mind is that if you freeze the turret while the AI is still rotating the turret to the right spot, he will end up aiming at the wrong place and will probably miss.

You got to make sure you only freeze the turret after the AI has finished rotating the turret and is aiming at the right spot.

Also keep in mind certain mods/scripts that change AI skills might set the aimingSpeed to a pretty low value, making it so that it takes a while for the AI to rotate the turret.

EDIT: By the way, something we noticed is that on a dedicated server the artillery unit must be local to the server. The mod doesn't seem to work if the artillery is local to a player (you see some chat messages but no shells arrive). For example, if you spawn the artillery using a script that spawns the unit on the server, it will work fine. If you use a pre-placed unit, it will be local to the server and so it will work fine too. But if you spawn the artillery with Zeus, it will spawn it on a player's client and then it will not work. You may want to add that information somewhere in your readme, so that people know how to properly place artillery for this mod.

EDIT2: And there are many undefined variable errors that keep popping up. Would be nice if you could fix that in the next version. Remember that such errors might actually break stuff in the future when BIS decides to be become more strict. Might not happen at the moment, but it might a year, two, three years from now.

Edited by BlackAlpha

Share this post


Link to post
Share on other sites

@geraldbolso1899

Gun-target-line should be pretty easy to implement. Not sure about Max Ord. My system uses a different method to the BIS arty computer, so I am not sure how to derive this value.

@Wanzec_6

I am currently overhauling the mod and my first priority is to make it auto-detect all artillery-capable vehicles. The ship may be a special case, but it isn't too much work to hard-code.

@BlackAlpha

I don't use Zeus, so I was unaware of that limitation. Most of my scripting is still based on OFP, this was my first major .sqf project. At the moment the mod assumes that the assets are AI-controlled and thus (by OFP rules) local to the server. I'll try changing the locality checks to the vehicle's locality.

Also, could you please give me some examples of the undefined variables? I thought I had them all squashed, but with so much code it is easy to overlook some.

Share this post


Link to post
Share on other sites

I'm a bit surprised you don't get the errors. Do you have showscripterrors enabled? It should show the errors on the fly. You can also find all errors in the RPT log file. For instance, they happen as soon as you open the artillery window. There are also one or two Generic Errors popping up when doing certain actions (I don't remember which actions).

---------- Post added at 00:16 ---------- Previous post was at 23:42 ----------

When opening the artillery menu by pressing the up key on the keyboard...

KeyPressed.sqf
Line 23
There's a sleep command in the exitWith. exitWith does not allow sleep commands. It gives an error message.

I noticed this in one of the files while searching for the above error...

Check.sqf
Line 28
There's a sleep command in the exitWith. exitWith does not allow sleep commands. It gives an error message.

After choosing a target by clicking on the map...

 0:03:29 Error in expression < 10;
};

dtaHaveAimpoint = true;
nul = [_prePlotted] execVM "DrongosArtillery\Di>
0:03:29   Error position: <_prePlotted] execVM "DrongosArtillery\Di>
0:03:29   Error Undefined variable in expression: _preplotted
0:03:29 File DrongosArtillery\Dialog\InputAimpointMapclickProcess.sqf, line 62

After choosing a target by clicking on the map...

 0:03:29 Error in expression <



_prePlotted = _this select 0;

if ((_prePlotted) AND ((count dtaSelectedPreP>
0:03:29   Error position: <_prePlotted) AND ((count dtaSelectedPreP>
0:03:29   Error Undefined variable in expression: _preplotted
0:03:29 File DrongosArtillery\Dialog\ControlAsset.sqf, line 6

After choosing a target by clicking on the map...

 0:03:29 Error in expression <tWith {closeDialog 0;	sleep 0.3; nul = [_prePlotted] execVM "DrongosArtillery\Di>
0:03:29   Error position: <_prePlotted] execVM "DrongosArtillery\Di>
0:03:29   Error Undefined variable in expression: _preplotted
0:03:29 File DrongosArtillery\Dialog\ControlAsset.sqf, line 10

After choosing a target by clicking on the map...

 0:03:29 Error in expression <;



if ((NOT dtaHaveAimpoint) AND (NOT _prePlotted)) exitWith {nul = [_prePlott>
0:03:29   Error position: <_prePlotted)) exitWith {nul = [_prePlott>
0:03:29   Error Undefined variable in expression: _preplotted
0:03:29 File DrongosArtillery\Dialog\Control.sqf, line 17

After choosing a target by clicking on the map...

 0:03:29 Error in expression <irburstHeightIndex = 0;












if (_prePlotted) then {
_fireMission = dtaSe>
0:03:29   Error position: <_prePlotted) then {
_fireMission = dtaSe>
0:03:29   Error Undefined variable in expression: _preplotted
0:03:29 File DrongosArtillery\Dialog\Control.sqf, line 69

I think there were more, I'll post them if I can find them again.

EDIT2: Here's one more...

When the debug module has been enabled and you fire the artillery:

 0:29:04 Error in expression <layer sideChat "FIRED";

dtaTestShots = dtaTestShots + 1;
nul = [_unit,_round] e>
0:29:04   Error position: <dtaTestShots + 1;
nul = [_unit,_round] e>
0:29:04   Error Undefined variable in expression: dtatestshots
0:29:04 File DrongosArtillery\Test\Fired.sqf, line 7

Edited by BlackAlpha

Share this post


Link to post
Share on other sites

@BlackAlpha

Thanks for your error reports, they are very helpful. I usually run Arma with -nologs, I had no idea of all these errors. I'll try to fix them all in the next release.

In the latest dev version artillery units are now automatically detected as long as they inherit from staticMortar, staticCannon or the base classes for BLUFOR SPG and MLRS. I have gun-target line displayed also. The control dialog will be redesigned as well.

Share this post


Link to post
Share on other sites

Is there a way to make it so an artillery unit won't be detected? Like adding a variable to the unit and then your mod checking for that variable before deciding to add it to the assets list?

Share this post


Link to post
Share on other sites

I'll make an array called dtaRestricted and make it possible to exclude by any group, vehicle and vehicleClass present in this array.

Share this post


Link to post
Share on other sites

just amazing. today started using it in mission editor and just learning how to use...

I'd love to see this for RHS units. especially with a BM-21 GRAD. I'd love to see real russian power ЗÐЛПОВЫЙ ОГОÐЬ!

Share this post


Link to post
Share on other sites

The latest patch seems to have broken doFireArtillery to a state even worse than usual, which means drifting wasted rounds due to guns trying to fire without a loaded magazine. This happens in cases such as switching from HE rounds to cluster. So I am appealing for help again to solve the following problem:

How do you force a vehicle to load a certain magazine before firing?

I have implemented control over single tubes within a battery, GTL, auto-detection of 3rd party mods and some other stuff. I have also redone the dialog:

DRA.jpg

Share this post


Link to post
Share on other sites

Awesome work, I look forward to your next overhaul for more artillery compatability. RHS in particular.

Thank you.

Share this post


Link to post
Share on other sites

First post updated with version 0.30. Changes:

  • Allowed control over each individual tube in a battery
  • Redesigned dialog
  • Added code to prevent some of the "drifting rounds" bug (big thanks to MaHuJa and BlackAlpha of tier1ops.eu)
  • Made the system automatically detect most (all?) 3rd party artillery units
  • Removed most of the hard-coded unit detection code
  • Added distance and gun-target line to the dialog
  • Added ability to exclude groups using the array dtaExclude (add group, leader vehicle or leader vehicle classname)
  • Removed doArtilleryFire commands for preloading ammo as this command is still hopelessly broken
  • Added a new module called "Track Rounds" to help with testing
  • Changed locality check for firing from server to whereever the asset is local
  • Redisgned the repeat mission system so only a single dialog is used
  • Reduced report spam
  • Added elevation of target and selected asset to the main dialog
  • Added dta_fnc_PlaceMarker for testing purposes
  • Fixed a bug in Tube.sqf that prevented sheafs from working properly
  • Dramatically increased the speed of MLRS firing
  • Added an M4 Scorcher to the AAF
  • Added an M5 MLRS to the AAF
  • Added M4 Platoon, M4 Section and M5 Section to the AAF
  • Changed cfgPatches entry from dta to DrongosArtillery (may require deleting the addOns[] and addOnsAuto[] entry from mission.sqm files to update missions)
  • Added debug markers for adjusting fire when dtaDebug is true
  • Tweaked the adjust code a little (seems to be working reliably now)
  • Brought back the XMIT button

New dialog:

DTA.jpg

NOTE: I have made a lot of changes in the latest update and have likely broken a few things. If you run into a bug, please post in this thread.

Roadmap:

The next update will most likely address the ongoing accuracy issues (eg. rockets overshooting their targets). Once that is resolved, the next step will be to properly implement WP, nuke and chem rounds.

Share this post


Link to post
Share on other sites

Excellent work mate. Adds so much to Arma III, playing missions with this. Great stuff!

Share this post


Link to post
Share on other sites

Please let me know if the mod does/doesn't work with 3rd party artillery addons.

Share this post


Link to post
Share on other sites

the current release seems to be in debug / script mode

dtaScriptMode = true;
[...]

/ For development debugging
dtaKey = 0xDB;
if (dtaScriptMode) then {
dtaKey = 0xDB;findDisplay 46 displayAddEventHandler ["KeyDown", "if (_this select 1 == dtaKey) then {nul = [] execVM ""DrongosArtillery\Dialog\Check.sqf""};"];
dtaDebug = true; dtaNoDelay = true; dtaRealisticTimes = true; dtaNoInitialInaccuracy = true;dtaTrackRounds = true;
};
// End script version

:)

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

×