OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: trooper543 on 31 May 2009, 00:14:28
-
Hi there all, i was wondering if you someone could explain to me on how to set up the artillery module in arma 2 . i have followed all the instructions (http://community.bistudio.com/wiki/Artillery_Module (http://community.bistudio.com/wiki/Artillery_Module) on how to place the battery etc but the part where i loose the plot is how to use or define the different fire missions. I have the german version of the game (couldnt resist the tempation)
Any help would be appreciated
Many thanks in advance
-
At the moment we all have the German edition :)
-
I think the instructions are very detailed, so I'm not sure where you are falling down. Are you trying to script a single fire mission or are you trying to add the mission to socom or are you wanting to get really advanced and define an entirely new type of fire mission?
e.g.
// mortarBattery is name of the the artillery gamelogic you synced with your mortar unit.
// _enemy is a unit you want to shoot at, though you could define the target position from a marker or a player mouse-click.
// Will fire 15 HE rounds (allowing for ammo, of course!) with every mortar firing at once (0 delay) rather
// than in a rolling fire (one gun firing after the other, to get continuous barrage).
[mortarBattery, getPos _enemy, ["IMMEDIATE", "HE", 0, 15]] call BIS_ARTY_F_ExecuteTemplateMission;
Don't worry about spawned and non-spawned. Spawned is a lot better and is the default anyway.
Give plenty of time for the gunners to have their sandwiches though. They will sit there for a minute or two before they decide they like the idea of firing ;)
-
They will sit there for a minute or two before they decide they like the idea of firing
At least with the basic artillery it takes about 15 seconds for them to start firing, not minutes. ;)
Whether they want to fire depends on the distance to the target though (I'm talking about non-spawned here), don't even try to have the MLRS engage anything if the target is not far away..
-
Gentlemen (@Spooner & Hoz)
Again Many thanks for the response I will try this out as per your instructions there and reply with my finidings
Again many thanks
-
I'm glad someone figured out how to use it. I was starting to think my instructions weren't detailed enough.
Don't worry about spawned and non-spawned. Spawned is a lot better and is the default anyway.
Non-Spawned is the default. Spawned only turns on if you set it to, or if you use the Secop Manager without a battery (as per the documentation).
-
There does seem to be an issue about the artillery type though. I've only managed to get mortars to work...
-
With AI or with the player?
While using it as a player, have you loaded magazines appropriate for the Artillery Module as detailed in the documentation?
No need to quote the previous post folks...
-
Yeah, with player they all seem fine (Really like the GUI!). I am talking about using the direct call (not socom) to initiate AI fire. Sorry for being unclear.
-
I am not able to get AI arty to work, too.
SOM version works fine, but that is not what I want.
If I read the biki entry right, I think AI also needs ARTY mags to work. Did not get virtual arty to work neither, though.
Anybody knows out of the head how to let AI controlled arty pieces have only ARTY-mags and none of the standard ones?
-
Yeah, you need correct ammo, but there is also a bug you need to workaround. Here is a simple init which is probably only appropriate for testing, but you get the idea:
#define NUM_MAGS 10
#define M119_AMMO ["ARTY_30Rnd_105mmHE_M119", "ARTY_30Rnd_105mmWP_M119", "ARTY_30Rnd_105mmSADARM_M119", "ARTY_30Rnd_105mmLASER_M119", "ARTY_30Rnd_105mmSMOKE_M119", "ARTY_30Rnd_105mmILLUM_M119"];
#define M252_AMMO ["ARTY_8Rnd_81mmHE_M252", "ARTY_8Rnd_81mmWP_M252", "ARTY_8Rnd_81mmILLUM_M252"];
#define MLRS_AMMO ["ARTY_12Rnd_227mmHE_M270"]
{
_vehicle = _x;
if (_vehicle isKindOf "m119") then
{
_vehicle setVehicleAmmo 0;
{
for "_i" from 0 to NUM_MAGS do
{
_vehicle addMagazine _x;
};
} forEach M119_AMMO;
}
else{if (_vehicle isKindOf "M252") then
{
_vehicle setVehicleAmmo 0;
{
for "_i" from 0 to NUM_MAGS do
{
_vehicle addMagazine _x;
};
} forEach M252_AMMO;
}
else{if (_vehicle isKindOf "MLRS") then
{
_vehicle setVehicleAmmo 0;
{
for "_i" from 0 to NUM_MAGS do
{
_vehicle addMagazine _x;
};
} forEach MLRS_AMMO;
}; }; };
} forEach vehicles;
_target = getPosASL enemy;
// THIS IS A TEMPORARY WORKAROUND FOR A BUG IN THE MODULE SCRIPTS!
// You MUST set the variable _missionTemplate before you run the template function;
// you cannot just put the template array directly in the function call.
// I've been assured this will be fixed in the next version, but this workaround
// will continue to work when the issue is fixed, so I'd just use this exact syntax for now:
_missionTemplate = ["IMMEDIATE", "HE", 0, 15];
[mortars, _target, _missionTemplate] call BIS_ARTY_F_ExecuteTemplateMission;
-
Spooner:
Forgive me for saying so, but you are jumping the gun here.
A few things to keep in mind:
First, the module is going to load its own ammo if it's told to fire under a certain mission profile. Manually loading it is absolutely unnecessary. If you tell it to fire a WP mission, it will load WP on its own, provided that ordnance type is defined in the module for that gun. The only time you'll ever need to load your own magazines is if you're firing it manually as a player.
Second, the bug you speak of WILL NOT prevent BIS_ARTY_F_ExecuteTemplateMission from being used with any template variable you want to specify. It only affects a subsystem of the Artillery Module for which documentation has not yet been released, and only when you have more than three parameters in your fire mission template.
Third, I'm not sure who assured you that feature would be fixed "in the next release," but if I gave you that impression, it was not my intent. Please do not assume anything unless it's an official announcement from BIS.
Carry on. :)
-
Ah yes, this was also a demo mission I was using for testing the full range of ammo types under player control. So, ok, I didn't need to mess with the ammo to use SOM/template missions. Actually, I'd prefer it if it did use its own ammo, since otherwise you could ask SOM to fire it continually through the mission. I expect that limiting available strikes is configurable, but undocumented, so I won't worry about it for now.
Ah, sorry, but I wasn't using any undocumented features at all! That mission template is copied directly from the BIKI documentation. If you just use:
[mortars, _target, ["IMMEDIATE", "HE", 0, 15]] call BIS_ARTY_F_ExecuteTemplateMission;
it won't work.
Yeah, very sorry that I made a big assumption about this being fixed in "the next version", I think because I'd given you the fix for it (literally renaming one variable in one function). However, I am fully aware from experience that even the most trivial of fixes need significant documentation, testing and review before they get into a full release. Thus, I should have known better than to make such a naive assumption!
EDIT: Sorry, yes, you are quite right Headspace, regarding BIS_ARTY_F_ExecuteTemplateMission. My test mission was faulty, thus I made bad deductions, I think.
-
Edit again:
Don't know what I did different, but I finally got it working the way it is supposed to be with the logic as battery variable. Disregard the original post, it was bollocks.
Edit... well again:
Working example at first post second page
-
I put in the name of the arty logic synced with the group. If you give the name of the battery leader, then if the leader is destroyed, then the function call wouldn't work any more, even if there were more guns in the battery.
-
Uploaded a sample mission again, this time it should be correct.
Use radio alpha to request an artillery strike, note that the rounds need some time to reach their target. There also seems to be a minimum engagement range for all artillery.
-
There is a minimum distance. Best way to use artillery is to hook it up with the SOM (Secondary Operations Module) which draws min/max ranging bars on the map when you are requesting fire missions. Even if you want to manage your artillery manually, using this system during testing can give you a better idea of what ranges will work.
You can find out the ranges during a mission using:
_min = batteryLogic getVariable "ARTY_MIN_RANGE";
_max = batteryLogic getVariable "ARTY_MAX_RANGE";
Since the artillery module just ignores you if a fire mission is requested outside acceptable ranges, it probably helps to always check that the range you want to use is OK before asking the module to run it for you.
-
Well, but where do you put the code spooner mentioned?
The artillery demo mission from the Biki works perfect for me, yet I cannot do artillery for myself as I have no idea how far or close to put it to the player.
-
yes where do we putthis code? :
_min = batteryLogic getVariable "ARTY_MIN_RANGE";
_max = batteryLogic getVariable "ARTY_MAX_RANGE";