Jump to content
Sign in to follow this  
SGT M

Help with automatically firing physical artillery.

Recommended Posts

Hey guys, so I have this beach assault mission with several aircraft attacking Utes. The bulk of the mission is complete but I thought it would be great if I had M270's and M119's firing off a destroyer (i.e. with attachTo) on the ride in for dramatic effect. The only problem is that I don't know how to make artillery automatically fire at a pre-determined target. All the tutorials I have found so far only show you how to configure arty for personal fire support, and not as a consistent, fixed barrage. Again just to affirm I don't necessarily want this artillery firing at something inparticular, I just want them to FIRE period. I'm utterly stuck, thought I'd ask the pro's. :)

Share this post


Link to post
Share on other sites

http://community.bistudio.com/wiki/Artillery_Module

and run the fire mission in a loop:

while {_someVariable} do {
    // firemission here.,
    // wait here for fire mission to be available again, info on that in link.
    sleep 5;  // the pause you want until repeating.
};

once you set _someVariable to be false the firing will stop repeating.

Share this post


Link to post
Share on other sites
Creating fire missions

Because there are numerous variables involved in setting up a fire mission, there is a type of array known as a fire mission template that is used to generalize specific types of fire missions. To set up a fire mission template, create an array consisting of the following elements, in respective order:

Mission Type: “IMMEDIATE†or “TIMED†The IMMEDIATE mission type will complete after a requested number of rounds have been fired.

The TIMED mission type will complete after a specific number of seconds have elapsed.

Ordnance Type: This is a string indicating the general type of ordnance to fire. Ordnance types are defined either by default or by calling the BIS_ARTY_F_AddOrdnanceType function. For each type of artillery, there are one or more ordnance types. Common default ordnance types include: “HE†- High Explosive

“WP†- White Phosphorous (“Willie Peteâ€)

“SADARM†- Search and Destroy Armor

“LASER†- Laser guided artillery shell

“ILLUM†- Flares

“SMOKE†- Non-Incendiary Smoke

Rate of Fire: The delay, in seconds, between each shot. This delay will be applied globally throughout the entire battery. For example, if gun 1 fires, there will be a delay between that event and when gun 2 fires (and so on).

Duration of Mission OR Round Count: This depends on the mission type. This value is used as follows: For IMMEDIATE missions, the number of rounds to fire.

For TIMED missions, the number of seconds to sustain fire.

For example: We want to define a fire mission template that has the battery firing 15 rounds of high explosive ammunition. To do this, we define the following template:

_heTemplate = ["IMMEDIATE", "HE", 0, 15];

Is this all I need to create a fire mission, or do I need the next section, which confuses me a little?

Share this post


Link to post
Share on other sites
Creating fire missions

Because there are numerous variables involved in setting up a fire mission, there is a type of array known as a fire mission template that is used to generalize specific types of fire missions. To set up a fire mission template, create an array consisting of the following elements, in respective order:

Mission Type: “IMMEDIATE†or “TIMEDâ€

The IMMEDIATE mission type will complete after a requested number of rounds have been fired.

The TIMED mission type will complete after a specific number of seconds have elapsed.

Ordnance Type: This is a string indicating the general type of ordnance to fire. Ordnance types are defined either by default or by calling the BIS_ARTY_F_AddOrdnanceType function. For each type of artillery, there are one or more ordnance types. Common default ordnance types include:

“HE†- High Explosive

“WP†- White Phosphorous (“Willie Peteâ€)

“SADARM†- Search and Destroy Armor

“LASER†- Laser guided artillery shell

“ILLUM†- Flares

“SMOKE†- Non-Incendiary Smoke

Rate of Fire: The delay, in seconds, between each shot. This delay will be applied globally throughout the entire battery. For example, if gun 1 fires, there will be a delay between that event and when gun 2 fires (and so on).

Duration of Mission OR Round Count: This depends on the mission type. This value is used as follows:

For IMMEDIATE missions, the number of rounds to fire.

For TIMED missions, the number of seconds to sustain fire.

For example: We want to define a fire mission template that has the battery firing 15 rounds of high explosive ammunition. To do this, we define the following template:

_heTemplate = ["IMMEDIATE", "HE", 0, 15];

Requesting Fire Support

To use your new battery in a fire support role, you can call the BIS_ARTY_F_ExecuteTemplateMission function. In order to do this, you must first have a target. Target coordinates must always be given in 3d, with the Z component being the altitude above sea level. This is particularly critical if you are not using spawn mode, because otherwise the artillery will not be able to properly calculate a firing solution.

The easiest way to test this is to set a target vehicle or unit, and then use:

_targetPos = getPosASL _targetUnit;

Then call the fire mission in on the position by using:

[_myBattery, _targetPos, _heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;

Depending on how far away you are from the battery and its initial orientation, you may have to wait a few moments for it to rotate into place. After this happens, you will hear the artillery firing on the target and soon see the shells hitting in the vicinity (or on top of) your target vehicle.

Also note that when calling any of ARTY's functions, the artillery logic itself counts as your “battery†variable.

and youll need this one to check when you can redo the firing.

waitUntil {_battery getVariable "ARTY_COMPLETE"};

hint "Artillery is rounds complete.";

Share this post


Link to post
Share on other sites

 _targetPos = getPosASL _targetUnit;

Ok so do I write the name of the unit I want targeted under "_targetUnit"? If so thats cool, but what do I write under "_targetPos"? To be honest I'm stuck when it comes to writing the values lol.

Edit: Ok disregard that, I have it semi-working here is my code, which I have placed in a trigger's ON ACTIVATION:

 [group m1, getPosASL a1, ["IMMEDIATE", "HE", 1, 10]] call BIS_ARTY_F_ExecuteTemplateMission; 

where m1 is the leader of the two grouped M119's and a1 is the target I want them to fire at. Only problem is this doesn't do anything, the guns don't fire, don't pivot, nothing. However one wierd thing I noticed is that if I remove a1 (not from the code, just from the map, i.e. delete the unit) the guns will pivot, aiming somewhere around the south-west corner of the map, and fire along the ground, obviously causing the shells/ rockets to impact about 30 metres away from the guns, I have no idea what they are aiming at, but it tells me that SOMETHING about the setup is working.

Edited by SGT M

Share this post


Link to post
Share on other sites

Any ideas why this might be happening guys?

Share this post


Link to post
Share on other sites

could the target be inside the minimum range of the M270 & the M119?

change them to a M252 or something and try like that

Share this post


Link to post
Share on other sites
could the target be inside the minimum range of the M270 & the M119?

change them to a M252 or something and try like that

Well Mr Riffic, I'd like to say that although I should have checked that in the first place, you were right. *facepalm* I had been testing it on the Desert map and I had assumed that the targets woud be far enough away if the batteries were in opposite corners of the map. Turns out I was wrong *double facepalm*. I feel like an utter idiot now, but atleast it works haha.

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  

×