Skip to content

Commit

Permalink
Merge pull request #28 from MisterHLunaticwraith/DevBranch
Browse files Browse the repository at this point in the history
MRH Milsim Tools version : v.1.17.4
  • Loading branch information
MisterHLunaticwraith authored Sep 17, 2019
2 parents 89dc584 + 2faeb60 commit 7f132ed
Show file tree
Hide file tree
Showing 447 changed files with 5,624 additions and 276 deletions.
52 changes: 52 additions & 0 deletions .github/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
Changelog:
MRH Milsim Tools version : v.1.17.4

- Heli Taxi revamped:
* The heli taxi system has been deeply reworked!
* You can now also use the system with an editor placed heli. To do that:
> place the heli in the editor and sync it to the heli taxi module. Sync the module to another group, the group will then have controls over this heli. If it's destroyed they will not be able to call a new one. Heli and commanding group MUST be different groups. Do not place anyone inside the heli except its flight crew in the editor. Where the heli is at mission start is its 'homebase', it will fly back and land there when cancelled or sent back. After a while it will shut its engines down and get repaired and refueled.Editor placed helis are not affected by the max number per side setting, but they DO affect it.
* You can now choose between different types of 'final waypoints':
>Land and drop troops: the helicopter will drop troops and fly back to base or go away and despawn (for helis that are spawned).
>land and wait at LZ the heli will land and wait at LZ until instructed otherwise. After a while it will shut its engines down. You can come back to it at any time.
>Loiter: the heli will fly over the waypoint and then loiter in circles around it until instructed otherwise.
>Hover: the heli will go to the waipoint and hover until instructed otherwise.
> fastrope troops: the heli will fast rope troops at given position and fly back to base or go away and despawn (for helis that are spawned)
* Fixed: AI units should be properly left at the LZ if the land and drop troups approach is selected.
* Fixed: units controlled by zeus wille be able to properly use and command the helo defined for their side/ group its linked too.

-Full 9 liner MEDEVAC functionality
>The 9 liner medevac function is quite complex, its settings can be found in addons settings. The different lines of the calling interface change the waiting time. You can require an escort (two helis will come along and loiter around the LZ when medevac is in effect), you can set the number of patients (the mod will select bigger helis for larger numbers). Decide to include a surgeon ( an AI medic will disembark the heli, talking to them with ace interaction will heal players, they will reembark when the heli leaves. You can ask for the heli to bring supplies (if ace medical crate it will be in the ACE3 virtual cargo interface, if you request medical tents 2 will be placed in the heli's inventory).Or ask for the crew to wear NBC gear (from contact dlc, useful if you use a radiation script for example).
>Upon calling the MEDEVAC you will receive a LZ near the position you gave (within 250m). You must then reach the LZ and mark it with the selected method (smoke etc.)to launch the medevac sequence. (failing to do that the medevac will be cancelled after a while).
>You can put uncounscious or severely wounded AIs or players in the Heli and send it away. It will fly back a while later and drop the fully healed units/ players at the LZ.
>Medevac helis can still be destroyed! Only one per side can be in action at the same time, you can set cooloff delays in the options.
- Supports: Artillery /CAS/Supply drops
* Fixed CAS no longer working
* Improved coordinates function should now work on all maps. (And hopefully not break everytime arma is updated).
* Setting the available number to -1 will make each of the supports infinite.
* You can instead or also set a cool off time for each support.
* ACE self interaction>>Contact HQ>>check availability will show available supports or cool off times (including medevacs).

- Insertion handler:
*fixed gear should now be moved correctly to submarine cargo for submarine insertions.

- Core added several functions, added two free public domain fonts: Unifont and BethEllen2

- Functions added MRH_fnc_isDoctor
>[this] call MRH_fnc_isDoctor; will make a unit a doctor (talking to them with ace interaction heals player).
- Vehicle Spawner will now presort categories only on server should save loading time, haven't had time to test it properly and delve into it, expect patch/ full revamp soon.
/////////////////////////////////
Changelog:
MRH Milsim Tools version : v.1.17.3

- Insertion handler revamped:
* added different insertion types: the default static line jump, the HALO jump and submarine S.D.V. insertion.
* fixed : AI units couldn't be transfered onboard. Unchanged: this works only for AIs that are in groups with players.
*tweaked : added animation when preparing cargo.

- Added several internal functions
- Added submarine map marker
- Fixed sitOnChair function in MP

////////////////////
Changelog:
MRH Milsim Tools version : v.1.17.2

- added Laser designated tripod item (a modification of the remote laser designator introduced by the marksman DLC, can and must beused without uav controler, weighs the same as its real world counterpart) more realistic than using laser designator binoculars , or remote controlled designator).
Expand Down
4 changes: 4 additions & 0 deletions Addons/MRHFireSupport/Functions/cfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class MRH // Defines the "owner"
{};
class MilsimTools_FireSupport_conditions
{};
class MilsimTools_FireSupport_displayAvailability
{};
class MilsimTools_FireSupport_conditionsShowAvailability
{};

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ Example(s):
*/
#include "MRH_C_Path.hpp"
_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side player),10]; //temporary do 0 after settings
_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side MRH_player),10]; //temporary do 0 after settings

_numberAvailableArty = ["MRH_MilsimTools_FireSupport_ArtyShots"] call cba_settings_fnc_get;
if ((parseNumber _numberAvailableArty)<0) then {_availableShots = 9999};//if setting is at a negative value then give infinite

_requestTedNumberOfShots = parseNumber (lbData [2100,lbcursel 2100]);
if (_requestTedNumberOfShots > _availableShots) ExitWith {systemchat localize "STR_MRH_FireSupport_NoArtyLeft"};
_leftShotsNew = _availableShots - _requestTedNumberOfShots;
missionNamespace setVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side player),_leftShotsNew,true];
missionNamespace setVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side MRH_player),_leftShotsNew,true];

_typeOfAmmo = lbData [2101,lbcursel 2101];

Expand All @@ -26,7 +30,7 @@ _ctrl = FDIS(1400);

_isValid = [_requestedPos] FUNC(checkGridValidity);
if !(_isValid) ExitWith {systemChat format [localize "STR_MRH_FireSupport_SC_Bad_coord",_requestedPos];};
player setVariable ["MRH_FireSupport_PreviouslyEnteredGridRef",_requestedPos];
MRH_player setVariable ["MRH_FireSupport_PreviouslyEnteredGridRef",_requestedPos];
_requestedPosFormated = [_requestedPos] FUNC(ParseCoordinates);
_radius = 10; //to improve
_delay = random [1,5,8];
Expand Down Expand Up @@ -63,30 +67,34 @@ sounds: Array of strings - (Optional, default []) Ssounds to be played on the in
*/
closeDialog 0;
missionNamespace setVariable ["MRH_FireSupport_ARTYisInActionFor_"+ (str side MRH_player),true,true];
_ETA = random [30,40,60];

_slowAmmo = ["rhs_ammo_m314_ilum","Flare_82mm_AMOS_White","rhsusf_40mm_white"];
if (_typeOfAmmo in _slowAmmo) then {_speed = 0.001; _alt = 150; _typeOfAmmo = "F_40mm_White";};

[[player,_ETA,_requestedPosFormated,_requestTedNumberOfShots],{
[[MRH_player,_ETA,_requestedPosFormated,_requestTedNumberOfShots],{
params ["_player","_ETA","_LZ","_requestTedNumberOfShots"];
_ETA = [_ETA, 0] call BIS_fnc_cutDecimals;

if ((group player) != (group _player)) ExitWith {};
if ((group MRH_player) != (group _player)) ExitWith {};
//playSound "";
_player sideChat format [localize "STR_MRH_FireSupport_RequestArtyDialog1",([_LZ] call MRH_fnc_MilsimTools_Core_realisticGrid),str _requestTedNumberOfShots,(_player getVariable "MRH_MilsimTools_Core_PlayerIntel") select 0];
sleep 4;
//playSound "MRH_HeliTaxi_HeliEnRoute";
leader group player directSay "mp_groundsupport_45_artillery_BHQ_2";
leader group MRH_player directSay "mp_groundsupport_45_artillery_BHQ_2";
[side _player, "HQ"] sideChat format [localize "STR_MRH_FireSupport_RequestArtyDialog2",([_LZ] call MRH_fnc_MilsimTools_Core_realisticGrid),_ETA,(_player getVariable "MRH_MilsimTools_Core_PlayerIntel") select 0,str _requestTedNumberOfShots];
}] RemoteExec ["Spawn", [-2,0] select isServer];

sleep _ETA;
[[player,_ETA,_requestedPosFormated,_requestTedNumberOfShots],{
[[MRH_player,_ETA,_requestedPosFormated,_requestTedNumberOfShots],{
params ["_player","_ETA","_LZ","_requestTedNumberOfShots"];
if ((group player) != (group _player)) ExitWith {};
if ((group MRH_player) != (group _player)) ExitWith {};
//playSound "MRH_HeliTaxi_HeliEnRoute";
leader group player directSay "mp_groundsupport_45_artillery_BHQ_1";
leader group MRH_player directSay "mp_groundsupport_45_artillery_BHQ_1";
[side _player, "HQ"] sideChat format [localize "STR_MRH_FireSupport_RequestArtyDialog3",([_LZ] call MRH_fnc_MilsimTools_Core_realisticGrid),_ETA,(_player getVariable "MRH_MilsimTools_Core_PlayerIntel") select 0,str _requestTedNumberOfShots];
}] RemoteExec ["Spawn", [-2,0] select isServer];
_fireOrder = [_requestedPosFormated,_typeOfAmmo,_radius,_requestTedNumberOfShots,_delay,_conditionEnd,_safezone,_alt,_speed,_sounds] spawn BIS_fnc_fireSupportVirtual;

missionNamespace setVariable [("MRH_MilsimTools_Arty_DelayBetween_"+ (str (side MRH_Player))),CBA_missionTime,true];
missionNamespace setVariable ["MRH_FireSupport_ARTYisInActionFor_"+ (str side MRH_player),false,true];
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ Example(s):
*/
#include "MRH_C_Path.hpp"
_availability = missionNamespace getVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side player),true];
_availability = missionNamespace getVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side MRH_player),true];
if !(_availability) ExitWith {systemChat localize "STR_MRH_FireSupport_CASUnavailableMessage"};
_availableCAS = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side player),10]; //temporary do 0 after settings

_availableCAS = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side MRH_player),10]; //temporary do 0 after settings

_numberAvailableCAS = ["MRH_MilsimTools_FireSupport_CASShots"] call cba_settings_fnc_get;
if ((parseNumber _numberAvailableCAS) < 0) then {_availableCAS = 9999}; //if setting is at a negative value then give infinite cas




if (_availableCAS < 1) ExitWith {systemchat localize "STR_MRH_FireSupport_CASnoCASleft"};

Expand Down Expand Up @@ -48,24 +55,25 @@ if !(_isValid) ExitWith {systemChat format [localize "STR_MRH_FireSupport_SC_Bad
} foreach (_vehicle call bis_fnc_weaponsEntityType);//getarray (_planeCfg >> "weapons");
if (count _weapons == 0) exitwith {systemchat format [localize "STR_MRH_FireSupport_CASnotThisTypeOfAttack",_vehicle,_weaponTypes];};
//----------
missionNamespace setVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side player),false,true];
missionNamespace setVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side MRH_player),false,true];
missionNamespace setVariable ["MRH_FireSupport_CASisInActionFor_"+ (str side MRH_player),true,true];
_leftCASNew = _availableCAS - 1;
missionNamespace setVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side player),_leftCASNew,true];
missionNamespace setVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side MRH_player),_leftCASNew,true];


player setVariable ["MRH_FireSupport_PreviouslyEnteredGridRefCAS",_requestedPos];
MRH_player setVariable ["MRH_FireSupport_PreviouslyEnteredGridRefCAS",_requestedPos];
_requestedPosFormated = [_requestedPos] FUNC(ParseCoordinates);

closeDialog 0;
_ETA = random [0,10,20];


playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio2.wss",player];
[[player,_ETA,_requestedPosFormated],{
playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio2.wss",MRH_player];
[[MRH_player,_ETA,_requestedPosFormated],{
params ["_player","_ETA","_LZ"];
_ETA = [_ETA, 0] call BIS_fnc_cutDecimals;

if ((group player) != (group _player)) ExitWith {};
if ((group MRH_player) != (group _player)) ExitWith {};
//playSound "";

_player sideChat format [localize "STR_MRH_FireSupport_CASrequestDialog1",([_LZ] call MRH_fnc_MilsimTools_Core_realisticGrid),(_player getVariable "MRH_MilsimTools_Core_PlayerIntel") select 0];
Expand All @@ -76,10 +84,10 @@ playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio2.wss",player];
}] RemoteExec ["Spawn", [-2,0] select isServer];

sleep _ETA;
playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio6.wss", player];
[[player],{
playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio6.wss", MRH_player];
[[MRH_player],{
params ["_player"];
if ((group player) != (group _player)) ExitWith {};
if ((group MRH_player) != (group _player)) ExitWith {};
//playSound "MRH_HeliTaxi_HeliEnRoute";
//leader group player directSay "mp_groundsupport_45_artillery_BHQ_1";
[side _player, "HQ"] sideChat format [localize "STR_MRH_FireSupport_CASrequestDialog3",(_player getVariable "MRH_MilsimTools_Core_PlayerIntel") select 0];
Expand All @@ -93,14 +101,18 @@ playSound3D ["A3\Sounds_F\sfx\radio\ambient_radio6.wss", player];

//systemChat format ["Veh %1 type %2 pos %3", str _vehicle, _typeOfAttack, str _requestedPosFormated];


_center = createCenter sideLogic;
_group = createGroup _center;
_pos = _requestedPosFormated;
_cas = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""];
_cas setDir random [0,180,360];
_cas setVariable ["vehicle",_vehicle,true];
_cas setVariable ["type", _typeOfAttack,true];
_cas setVariable [ "bis_fnc_initModules_disableAutoActivation", false, !isServer ];
[[_requestedPosFormated,_vehicle,_typeOfAttack],{
params ["_requestedPosFormated","_vehicle","_typeOfAttack"];
_center = createCenter sideLogic;
_group = createGroup _center;
_pos = _requestedPosFormated;
_cas = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""];
_cas setDir random [0,180,360];
_cas setVariable ["vehicle",_vehicle,true];
_cas setVariable ["type", _typeOfAttack,true];
_cas setVariable [ "bis_fnc_initModules_disableAutoActivation", false, !isServer ];
}] remoteExec ["Call",2]; //needs to happen on server
sleep 20;
missionNamespace setVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side player),true,true];
missionNamespace setVariable ["MRH_FireSupport_isAvailableCASfor_"+ (str side MRH_player),true,true];
missionNamespace setVariable [("MRH_MilsimTools_CAS_DelayBetween_"+ (str (side MRH_Player))),CBA_missionTime,true];
missionNamespace setVariable ["MRH_FireSupport_CASisInActionFor_"+ (str side MRH_player),false,true];
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ disableSerialization;
_allShellMagazines = missionNamespace getVariable "MRH_FireSupport_TypesOfArtyMags";
_handle = createDialog "MRHArtilleryInterface";
_ctrlGridRef = FDIS(1400);
_savedGridGref = player getVariable ["MRH_FireSupport_PreviouslyEnteredGridRef","00000-00000"];
_savedGridGref = MRH_player getVariable ["MRH_FireSupport_PreviouslyEnteredGridRef","00000-00000"];
_ctrlGridRef ctrlSetText _savedGridGref;
_ctrlAvailable = FDIS(1103);
_ctrlNumberCombo = FDIS(2100);
_ctrlAmmotypeCombo = FDIS(2101);

_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side player),0]; //temporary do 0 after settings
_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableArtilleryShots" + (str side MRH_player),0]; //temporary do 0 after settings
_ctrlAvailable ctrlSetStructuredText parseText (str _availableShots);
_numberAvailableArty = ["MRH_MilsimTools_FireSupport_ArtyShots"] call cba_settings_fnc_get;
if ((parseNumber _numberAvailableArty)<0) then {_ctrlAvailable ctrlSetStructuredText parseText ""};
{
_index = _ctrlNumberCombo lbAdd (str _x);
_ctrlNumberCombo lbSetData [_index,str _x];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Example(s):
#include "MRH_C_Path.hpp"

disableSerialization;
_allAvailablePlanes = missionNamespace getVariable ["MRH_FireSupport_TypesCASPLANES"+ (str side player),[]];
_allAvailablePlanes = missionNamespace getVariable ["MRH_FireSupport_TypesCASPLANES"+ (str side MRH_player),[]];
if (_allAvailablePlanes isEqualTo []) exitWith {systemChat localize "STR_MRH_FireSupport_CASnoCASForYourSide"};
_handle = createDialog "MRHArtilleryInterface";
//redefine from arty interface
Expand All @@ -27,14 +27,20 @@ _availableTIP ctrlSetStructuredText parseText (localize "STR_MRH_FireSupport_CAS


_ctrlGridRef = FDIS(1400);
_savedGridGref = player getVariable ["MRH_FireSupport_PreviouslyEnteredGridRefCAS","00000-00000"];
_savedGridGref = MRH_player getVariable ["MRH_FireSupport_PreviouslyEnteredGridRefCAS","00000-00000"];
_ctrlGridRef ctrlSetText _savedGridGref;
_ctrlAvailable = FDIS(1103);
_ctrlNumberCombo = FDIS(2100);
_ctrlAmmotypeCombo = FDIS(2101);

_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side player),0]; //temporary do 0 after settings
_availableShots = missionNamespace getVariable ["MRH_FireSupport_NumberOfAvailableCAS" + (str side MRH_player),0]; //temporary do 0 after settings
_ctrlAvailable ctrlSetStructuredText parseText (str _availableShots);

_numberAvailableCAS = ["MRH_MilsimTools_FireSupport_CASShots"] call cba_settings_fnc_get;
if ((parseNumber _numberAvailableCAS) < 0) then {
_ctrlAvailable ctrlSetStructuredText parseText "";
}; //if setting is at a negative value then give infinite cas

{
_nameofplane = getText (configFile>>"cfgVehicles">>_x>>"displayName");
_index = _ctrlNumberCombo lbAdd _nameofplane;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@ Example(s):
*/
#include "MRH_C_Path.hpp"
params ["_Coordinates"];
_CoordinatesArray = _Coordinates splitString "-";
_lat = _CoordinatesArray select 0;
_long = _CoordinatesArray select 1;
_lat = [_lat] FUNC(fiveDigitsGridFormat);
_long = [_long] FUNC(fiveDigitsGridFormat);
_result = [_lat,_long,0];
_result = [_Coordinates] CFUNC(parseCoordinates);
_result
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,6 @@ Example(s):
*/
#include "MRH_C_Path.hpp"
params ["_Coordinates"];
_valid = false;
_CoordinatesArray = _Coordinates splitString "-";
if ((count _CoordinatesArray) != 2) ExitWith {_valid};

NumberCount_fnc = {
params ["_number"];
_numberStr = _number;
_check = true;
_tocount = _numberStr splitString "";
if (((count _tocount)<3) or ((count _tocount) >5)) then {_check = false};
_check
};

_lat = _CoordinatesArray select 0;
_long = _CoordinatesArray select 1;

_latValid = true;
if ((parseNumber _lat) == 0) then {_latValid = false};
_latValid = [_lat] call NumberCount_fnc;





_longValid = true;
if ((parseNumber _long) == 0) then {_longValid = false};
_longValid = [_long] call NumberCount_fnc;

_return = false;
if (_latValid && _longValid) then {_return = true};
_return = [_Coordinates] CFUNC(checkGridValidity);
_return

Loading

0 comments on commit 7f132ed

Please sign in to comment.