Jump to content

Recommended Posts

I have looked at wiki and everything but i still do not know how to get an artillery fire mission.

How do you get a group of artillery to fire at an exact time, without calling it in yourself. For example if i put a vehicle in the middle of a town, how would i get the artillery to target it?

Share this post


Link to post
Share on other sites

i need real artillery, tried using the wiki for the artillerry module but i couldn't get it to work after about two hours of testing.

Pretend you are explaining it to a 5 year-old, because i'm not very good at scripting.

Share this post


Link to post
Share on other sites

1. Create groups of AI-manned artillery. They all have to be the same type in a given group, say Russian mortars.

2. Add an artillery module for each of those groups and synch it to the leader of that given group. Also give each module a unique name to make it easy to reference by script. I use ABattery, BBattery, etc.

3. Add this script, arty_strike.sqf, to your mission.

_battery = _this select 0;
_coords = _this select 1;
_type = _this select 2;
_count = _this select 3;
_mils = _this select 4;

_mission = ["IMMEDIATE", _type, 0.4, _count];

if ( [_battery, _mission] call BIS_ARTY_F_StillViable ) then {
//	hint format["%1 firing at %2, %3 rounds of %4, %5 mils", _battery, _coords, _count, _type, _mils];
[_battery, 10*_mils] call BIS_ARTY_F_SetDispersion;
[_battery, _coords, _mission] spawn BIS_ARTY_F_ExecuteTemplateMission;
} else {
//	hint format["%1 cannot fire at %2, %3 rounds of %4", _battery, _coords, _count, _type, _mils];
};

4. When you want a unit to fire, execVM that script with the fire mission data.

ok = [YBattery, _pos, "HE", 6, 15.0] execVM "arty_strike.sqf";

will tell the group associated with the YBattery module to fire on the location in _pos, using high-explosive rounds, 6 shells, 15 mils of dispersion.

Share this post


Link to post
Share on other sites

Did you check the "Search this Forum" feature? The wiki doesn't really have much as you've seen already. There are a bunch of threads and various example missions around this part of the forum that give some different examples. I'm guilty of asking about this same thing in a few different threads around here so I speak from experience. ;) Unfortunately there's really no simple way to make this happen using the AI, some scripting is required.

Besides Evil_Echo's example, there are a few other ways to do it that have been provided by other community members. Basically you just have to find the one that works the best for your mission but at least in this instance there is some good discussion(s) and examples of the various ways to do this. The only problem is that the discussion(s) are not centralized in one thread but instead spread across many threads.

I can't remember the exact thread names or post locations but Evil_Echo(as you've seen already) and TRexian have posted some stuff about getting a good fire support mission going.

My apologies for the lack of substance in my post, I'd post the example missions I had if I didn't erase them from my HD. :( Evil_Echo had a method I was using that kicked ass, not sure if that's the same one he posted above.

Good luck and take care.

Edited by Manzilla

Share this post


Link to post
Share on other sites
Evil_Echo had a method I was using that kicked ass, not sure if that's the same one he posted above.

The code posted here is from the technique I had shared with Manzilla, just drove the targeting selection system for my AI via a FSM and called in fire missions just like I posted. Makes for some very realistic feeling artillery and quite nasty to be on the wrong end of.

ACE has come out with a variant of the BI artillery that is supposed to be more MP-friendly. Once I figure out the details of that I'll try to put up a guide for it on the FreeACE wiki. But for SP mission the vanilla BI method is just fine.

Share this post


Link to post
Share on other sites
i need real artillery, tried using the wiki for the artillerry module but i couldn't get it to work after about two hours of testing.

Pretend you are explaining it to a 5 year-old, because i'm not very good at scripting.

Its really simple to set up the artillery with the SOM. Here is a simple way of doing it taken from one of the youtube videos.

1) Create unit

2)Create SOM and call it som1

3)Sync unit and som1

4)Create trigger activated by game logic with min mid max of 1.

5)In the condition box write the following code:

som1 getVariable "initDone"

6) On the On Act. Box write the following code:

[["artillery_barrage"], player, [[RIPPER, [1,2,3,4,5,6,7,8,9]]]] call BIS_SOM_addSupportRequestFunc;

7)Create another trigger activated by Radio, delete Axis a and Axis b numbers and write the following code in the On Act. box

[["artillery_barrage"], player, [[RIPPER, [1,7,9]]]] call BIS_SOM_addSupportRequestFunc;

8) Place Artillery Units on the map. Give one of the a higher rank and the other ones low rank, the group them (F2)

9) Place Artillery Module on the map and call it RIPPER.

10)Sync ARTY module with the main a Artillery Unit. Lets say you have three beloved MLRS, just Sync the SOM with the MLRS leader and that's it.

11)Done. Enjoy!

I also made a simple artillery script. Here is the link and is very simple to set up/ Im working on the version 2.0 that will add a lot of new stuff, and that will be more easy to use: http://forums.bistudio.com/showthread.php?t=100237

Is not real artillery but its simple and useful.

P.S. If you want to eliminate the SOM secondary ops just add to the Sec Ops Module init the following line of code:

this setVariable ["settings", [[], true, nil, nil, false]];

This way you will only get the artillery and not the sec ops.

---------- Post added at 12:43 PM ---------- Previous post was at 12:16 PM ----------

1. Create groups of AI-manned artillery. They all have to be the same type in a given group, say Russian mortars.

2. Add an artillery module for each of those groups and synch it to the leader of that given group. Also give each module a unique name to make it easy to reference by script. I use ABattery, BBattery, etc.

3. Add this script, arty_strike.sqf, to your mission.

_battery = _this select 0;
_coords = _this select 1;
_type = _this select 2;
_count = _this select 3;
_mils = _this select 4;

_mission = ["IMMEDIATE", _type, 0.4, _count];

if ( [_battery, _mission] call BIS_ARTY_F_StillViable ) then {
//	hint format["%1 firing at %2, %3 rounds of %4, %5 mils", _battery, _coords, _count, _type, _mils];
[_battery, 10*_mils] call BIS_ARTY_F_SetDispersion;
[_battery, _coords, _mission] spawn BIS_ARTY_F_ExecuteTemplateMission;
} else {
//	hint format["%1 cannot fire at %2, %3 rounds of %4", _battery, _coords, _count, _type, _mils];
};

4. When you want a unit to fire, execVM that script with the fire mission data.

ok = [YBattery, _pos, "HE", 6, 15.0] execVM "arty_strike.sqf";

will tell the group associated with the YBattery module to fire on the location in _pos, using high-explosive rounds, 6 shells, 15 mils of dispersion.

Hi. How do you set the _pos? with the OnMapSingleClick or can you just set the marker name like substitute _pos with "artyTarget" ?

---------- Post added at 01:02 PM ---------- Previous post was at 12:43 PM ----------

Evil, I tried your code by giving it the MarkerPos of my target and it doesnt matter where I put the target, the units turn back and start shooting to another location. Why might that be happening?

Share this post


Link to post
Share on other sites

I had a FSM determining target locations using what the AI had spotted ( using the nearTarget command ), how well they had identified the threat, and the value of that threat. The value of _pos was set via that assessment. So the targeting of BLUFOR units was completely automatic by the opposing AI. You learned very quickly to avoid prolonged contact ( they'd zero in on you ), keep moving ( in case they had called in fire-support ) and to suppress communications to the batteries ( my FSM counted the state of local communications gear in whether a fire-mission could be made ).

The value of _pos should be a 3-d location since the BI functions adjust for elevation differences. I believe both OnMapSingleClick and MarkerPos return 2-d values that you'd need to correct for. In the case asked for by Militantsausage, he could just use the value from getPosASL on his target vehicle.

Edited by Evil_Echo

Share this post


Link to post
Share on other sites

I'll try it and post back (to change the getMarkerPos to getPosASL)

---------- Post added at 02:23 PM ---------- Previous post was at 02:20 PM ----------

... didnt work... Ill try to edit it later

Share this post


Link to post
Share on other sites
Its really simple to set up the artillery with the SOM. Here is a simple way of doing it taken from one of the youtube videos.

1) Create unit

2)Create SOM and call it som1

3)Sync unit and som1

4)Create trigger activated by game logic with min mid max of 1.

5)In the condition box write the following code:

som1 getVariable "initDone"

6) On the On Act. Box write the following code:

[["artillery_barrage"], player, [[RIPPER, [1,2,3,4,5,6,7,8,9]]]] call BIS_SOM_addSupportRequestFunc;

7)Create another trigger activated by Radio, delete Axis a and Axis b numbers and write the following code in the On Act. box

[["artillery_barrage"], player, [[RIPPER, [1,7,9]]]] call BIS_SOM_addSupportRequestFunc;

8) Place Artillery Units on the map. Give one of the a higher rank and the other ones low rank, the group them (F2)

9) Place Artillery Module on the map and call it RIPPER.

10)Sync ARTY module with the main a Artillery Unit. Lets say you have three beloved MLRS, just Sync the SOM with the MLRS leader and that's it.

11)Done. Enjoy!

I also made a simple artillery script. Here is the link and is very simple to set up/ Im working on the version 2.0 that will add a lot of new stuff, and that will be more easy to use: http://forums.bistudio.com/showthread.php?t=100237

Is not real artillery but its simple and useful.

P.S. If you want to eliminate the SOM secondary ops just add to the Sec Ops Module init the following line of code:

this setVariable ["settings", [[], true, nil, nil, false]];

This way you will only get the artillery and not the sec ops.

---------- Post added at 12:43 PM ---------- Previous post was at 12:16 PM ----------

Hi. How do you set the _pos? with the OnMapSingleClick or can you just set the marker name like substitute _pos with "artyTarget" ?

---------- Post added at 01:02 PM ---------- Previous post was at 12:43 PM ----------

Evil, I tried your code by giving it the MarkerPos of my target and it doesnt matter where I put the target, the units turn back and start shooting to another location. Why might that be happening?

I did not want to have it requsted, i wanted the enemy artillery to fire on an

Airfield while the player group has to silence them.

Share this post


Link to post
Share on other sites
I did not want to have it requsted, i wanted the enemy artillery to fire on an

Airfield while the player group has to silence them.

Oh ok, in that case go for Evil Echo alternative, it really works, even though I haven't been able to adjust the AI target properly.

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  

×