Jump to content

Recommended Posts

Download:

MIL_airburst - Dropbox / Armaholic

 

Description:

I created this for VBS3 and converted it across (and fancied it up) for ArmA 3. It allows required ammunition types to be detonated for use as an airburst round. This was converted primarily for the ADF Uncut Carl Gustav 84mm HE round, however it could conceivably be used for any explosive round (also tested on vanilla RPG-42 HE and HEAT rounds).

 

Features:

    - GUI for quick input of range.
    - Engagement distances:
        - Range setting under 40m will have no affect (i.e. impact detonation).
        - Range setting between 40m and 70m will have a chance to fail to detonate.
    - Can be applied to only selected players (e.g. units who would be trained in the application of HE rounds for airburst).
    - Can account for numerous ammunition types (customisable).
    - Range setting will be "remembered" until a round is fired (pre-set a range into the next round).
    - More of a sacrifice on realism in favour of gameplay:
        - Range can be re-adjusted, including closer, without "breaking" the fuse.
        - AT gunner is the one making fuse adjustments.
        - Can potentially be used on any explosive round not featuring an adjustable fuse in reality (e.g. HEAT rounds).

 

To use:

    - Copy the folder MIL_airburst to your mission folder.
    
    - Add these lines to your description.ext

#include "MIL_airburst\defines.hpp"    //(basic level of GUI defines, nothing flash)
#include "MIL_airburst\fuseSetting_dialog.hpp"

  
    - Run this command from initPlayerLocal.sqf for MP (or init.sqf for SP) before the mission starts:

private ["_units","_ammo"];

_units = ["_unitName"];
_ammo = ["_magazineName"];

if ((str player) in _units) then {
	nul = _ammo execVM "MIL_airburst\initAirburst.sqf";
};

        _unitName - string - unit/s to be allowed to set ranges.
        _magazineName - string - magazine/s to be allowed to have their range set.
        
Example:

private ["_units","_ammo"];

_units = ["p1","p2"];
_ammo = ["RPG32_HE_F"];

if ((str player) in _units) then {
	nul = _ammo execVM "MIL_airburst\initAirburst.sqf";
};

 

Demo (1:06):

 

If anyone finds any problems please let me know.

 

Thank you.

 

Change log:

Spoiler

v1.5:

Fixed - Range text field couldn't be changed after confirming.

 

v1.4:

Fixed - initAirburst.sqf was not saving ammunition natures as intended, due to small change in the execution in initPlayerLocal.sqf that had been made. initAirburst.sqf now reflects the change that was made.

 

v1.3:

Added - Pressing backspace or delete will reset the range text field.

Added - Range text field tool-tip now also includes minimum range setting (40m) required.

Fixed - Multiple ammunition natures now properly supported.

 

v1.2:

Added - JIP compatible.

Changed - Re-worked how the function is launched (check To use).

 

v1.1:

Added - Can now close dialog with enter keys. Pressing enter will perform the same as clicking confirm.

Changed - Reduced the chance for a fuse failure when set between 40m - 70m.

Changed - Fuse setting hint now displays "Impact" if set to 0m.

Changed - Dialog now opens with text field focused (no need to click inside text field to start typing).

 

v1 - Release.

 

  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

Had a few thoughts on some changes while at work today (plus I remembered one change I wanted to include to begin with), so I've updated the script, plus the OP, to reflect the changes.

 

v1.1:

Added - Can now close dialog with enter keys. Pressing enter will perform the same as clicking confirm.

Changed - Reduced the chance for a fuse failure when set between 40m - 70m.

Changed - Fuse setting hint now displays "Impact" if set to 0m, instead of "0m".

Changed - Dialog now opens with text field focused (no need to click inside text field to start typing).

  • Like 2

Share this post


Link to post
Share on other sites

i can't get work properly on dedicated server. when i'm selfhosting, everything works fine, but when i start it on our clan-server it only works when i start the mission. when i return to lobby and rejoin the game, i have no fuse-setting option anymore.

i restart the mission and everything works again.

maybe got something to do with JIP funktion?

Share this post


Link to post
Share on other sites
28 minutes ago, madpat3 said:

maybe got something to do with JIP funktion?

Taking a look at it: It's not JIP compatible at all. But that results simply from the way the fuse action and fired-evh is added to the units. That could be handled JIP compatible without much hazzle - the execution on the server is not at all necessary (no function is actually executed on the server, they're all local to the player who's firing). You only have to edit the initAirburst.sqf to make sure that the remoteExec-Call is changed into a regular call (with an if (str player in _units)-check for example) and the publicVariable-command is removed. Then you can execute the script from init.sqf or even initPlayerLocal.sqf.

Like so (not tested):

params ["_units","_ammo"];

missionNamespace setVariable ["MIL_AirburstAmmo",_ammo];

MIL_fnc_addAirburstToPlayer = compileFinal preprocessFileLineNumbers "MIL_airburst\addAirburstToPlayer.sqf";
MIL_fnc_airburst = compileFinal preprocessFileLineNumbers "MIL_airburst\airburst.sqf";
MIL_fnc_fuseSetting_updater = compileFinal preprocessFileLineNumbers "MIL_airburst\fuseSetting_updater.sqf";

waitUntil {({!isNil _x} count ["MIL_fnc_addAirburstToPlayer","MIL_fnc_airburst","MIL_fnc_fuseSetting_updater"]) == 3};

_units apply {toUpper _x};

if ( hasInterface && toUpper (str player) in _units ) then { call MIL_fnc_addAirburstToPlayer; };

 

Share this post


Link to post
Share on other sites

so i changed the initAirburst.sqf to this:

 

params ["_units","_ammo"];

missionNamespace setVariable ["MIL_AirburstAmmo",_ammo,true];

MIL_fnc_addAirburstToPlayer = compileFinal preprocessFileLineNumbers "MIL_airburst\addAirburstToPlayer.sqf";
MIL_fnc_airburst = compileFinal preprocessFileLineNumbers "MIL_airburst\airburst.sqf";
MIL_fnc_fuseSetting_updater = compileFinal preprocessFileLineNumbers "MIL_airburst\fuseSetting_updater.sqf";

waitUntil {({!isNil _x} count ["MIL_fnc_addAirburstToPlayer","MIL_fnc_airburst","MIL_fnc_fuseSetting_updater"]) == 3};

_units apply {toUpper _x};

if ( hasInterface && toUpper (str player) in _units ) then { call MIL_fnc_addAirburstToPlayer; };

{publicVariable _x} forEach ["MIL_fnc_addAirburstToPlayer","MIL_fnc_airburst","MIL_fnc_fuseSetting_updater"];

 

deleted the initServer.sqf and put this into the init.sqf:

nul = [[commandant, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, z1, z2, z3, z4, z5, z6, z7],["BWA3_CarlGustaf_HE", "rhs_mag_maaws_HE"]] execVM "MIL_airburst\initAirburst.sqf";

 

but it doesn't work

Share this post


Link to post
Share on other sites

Of course it won't. You have to put in the strings of the units (["commandant","a","b",...,"z7"]). The publicVariable-line has to go as well. And at best remove the boolean from the missionNamespace setVariable ["MIL_AirburstAmmo",_ammo]; too.

Share this post


Link to post
Share on other sites

like this?

 

//if (!isServer) exitWith {};

params ["_units","_ammo"];

//missionNamespace setVariable ["MIL_AirburstAmmo",_ammo,true];

MIL_fnc_addAirburstToPlayer = compileFinal preprocessFileLineNumbers "MIL_airburst\addAirburstToPlayer.sqf";
MIL_fnc_airburst = compileFinal preprocessFileLineNumbers "MIL_airburst\airburst.sqf";
MIL_fnc_fuseSetting_updater = compileFinal preprocessFileLineNumbers "MIL_airburst\fuseSetting_updater.sqf";

waitUntil {({!isNil _x} count ["MIL_fnc_addAirburstToPlayer","MIL_fnc_airburst","MIL_fnc_fuseSetting_updater"]) == 3};

_units apply {toUpper _x};

if ( hasInterface && toUpper (["commandant", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "z", "z2", "z3", "z4", "z5", "z6", "z7"]) in _units) then {call MIL_fnc_addAirburstToPlayer; };

//{publicVariable _x} forEach ["MIL_fnc_addAirburstToPlayer","MIL_fnc_airburst","MIL_fnc_fuseSetting_updater"];

//remoteExec ["MIL_fnc_addAirburstToPlayer",_units];

 

but then this happens:https://www.dropbox.com/s/sl0p4j8kwsjkbh0/Unbenannt.jpg?dl=0

 

sorry for asking so much, but i'm a total beginner in this scripting thing

Share this post


Link to post
Share on other sites

@belbo @madpat3 I'll make the changes to it in a couple of days when I've got some time off. I don't usually do anything that involves JIP so i guess i didn't consider it for this. 

Share this post


Link to post
Share on other sites
16 hours ago, madpat3 said:

sorry for asking so much, but i'm a total beginner in this scripting thing

You replaced the toUpper (str player)-part with the array that belongs to the execVM-command. I don't know why, but you did. This is the way it has to be in the initAirburst.sqf:

_units apply {toUpper _x};

if ( hasInterface && toUpper (str player) in _units ) then { call MIL_fnc_addAirburstToPlayer; };

And this must be the line in the init.sqf/initPlayerLocal.sqf:

[["commandant","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","z1","z2","z3","z4","z5","z6","z7],["BWA3_CarlGustaf_HE","rhs_mag_maaws_HE"]] execVM "MIL_airburst\initAirburst.sqf";

Share this post


Link to post
Share on other sites

uh,

i've had it all right in first place, but i didn't know, that i had to put the names of the playable units into quotation marks inside the init.sqf.

now i get nor error massage, but the script doesn't work. 

i think i'll wait until beno changes the script by himself, for i'm not able to do so.

 

but i want to thank you for trying to help me, never the less.

good community

Share this post


Link to post
Share on other sites

Updated.

 

v1.2:

Added - JIP compatible.

Changed - Re-worked how the function is launched (check To use).

 

@madpat3 @belbo Thanks for the heads up. Please let me know how it goes if you can. I tested it hosted and dedicated with a JIP client and it worked, but this is the first time I've made anything to be JIP compatible, so hopefully it works as intended.

Share this post


Link to post
Share on other sites
7 hours ago, beno_83au said:

 

@madpat3 @belbo Thanks for the heads up. Please let me know how it goes if you can. I tested it hosted and dedicated with a JIP client and it worked, but this is the first time I've made anything to be JIP compatible, so hopefully it works as intended.

It's not magic. :D But thus far it looks good. :)

  • Haha 1

Share this post


Link to post
Share on other sites
31 minutes ago, belbo said:

It's not magic. :D But thus far it looks good. :)

 

Haha, cheers. Sometimes feels like I'm working with magic.

 

320?cb=20131101011634

 

  • Haha 1

Share this post


Link to post
Share on other sites

do i realy have to give all playable unit a variable name or can i just say "player" in the "playerLocalInit" file?

Share this post


Link to post
Share on other sites

If you want every player to be able to use it, just comment out the _units line and don't use an if...then statement. Try this instead:

_ammo = ["_magazineName"];
nul = _ammo execVM "MIL_airburst\initAirburst.sqf";

 

Just be sure to still include the ammunition natures that will be used as airburst.

  • Like 1

Share this post


Link to post
Share on other sites

can it be that there is only one ammo type allowed? 'cause i've tried it with two, like this: _ammo = ["_magazineName","_magazineName2"]; //and only the first one works. if i chenge the order like _ammo = ["_magazineName2","_magazineName"]; still only the first one (in this case _magazineName2) works.

Share this post


Link to post
Share on other sites

Updated.

 

v1.3:

Added - Pressing backspace or delete will reset the range text field.

Added - Range text field tool-tip now also includes minimum range setting (40m) required.

Fixed - Multiple ammunition natures now properly supported.

 

@madpat3Thanks for doing all the bug finding I should be doing, I appreciate it. Priorities are always shifting and changing :)

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

×