Skip to content

Commit

Permalink
Merge pull request #36 from MisterHLunaticwraith/DevBranch
Browse files Browse the repository at this point in the history
v1.18.1 release
  • Loading branch information
MisterHLunaticwraith authored Nov 22, 2019
2 parents f4baf65 + 5a5d191 commit ab0f55b
Show file tree
Hide file tree
Showing 32 changed files with 774 additions and 58 deletions.
85 changes: 85 additions & 0 deletions .github/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
# Changelog: MRH Milsim Tools version : v.1.18.1

## Core
* Added : Loadout recap in diary will now display loadout weight as well as occupied space in vest, uniform, and backpack. As with the rest it is updated everytime inventory is closed.
* Changed : Roster was only added to diary after the briefing phase, now it will be there from the start.
* Tweaked : Briefing roster should now get refreshed every time a new player gets connected.
* Added some new global variables :
**MRH_allPlayers** = All players minus headless clients.
**MRH_allAlivePlayers** = All players that are considered 'Alive' by milsim tools minus headless clients.
**MRH_allAliveAndConsciousPlayers** = All players that are considered 'Alive' by milsim tools, conscious by ACE 3 minus headless clients.
The variables are refreshed on all clients and the server :
-Whenever a player connects
-Whenever a player disconnects
-Whenever a player is killed
-Whenever a player's conscious state is changed
-Whenever a player respawns
-Whenever the setRevived function is called on a unit
* You can call MRH_fnc_MilsimTools_Core_allPlayers to manually update them on a local machine, the function also returns one of these depending on parameters sent to it, see function header for more.
* Added :
##### CBA Events
```
"MRH_playerConnected_EH", //same parametres as player connected EH but raised globally
"MRH_playerDisconnected_EH", //same parametres as player disconnected EH but raised globally
"MRH_playerOnly_ace_unconscious", // same as ace_uncounsious event, raised globally but only when a player's state changes (not raised for AIs unlike the ACE3 event its based on) params ["_unit", "_state"];
"MRH_playerKilled", Same as MPKilled
"MRH_playerRespawned_global", // raised globally when a player respawns params ["_unit", "_corpse"];
"MRH_playerWasSetAsRevived" // raised globally when an admin resets "hasDied" condition on a player (via the admin menu or the setRevived function) target player is passed as a parameter.
```

## Radio Chatter
* Changed : Volume of sounds of default radio lowered to 5 . Since arma A3 v1.91.145537 any volume exceeding 5 will not play since the function uses <a href="https://community.bistudio.com/wiki/playSound3D">playSound3D</a> ,getSoundFile function will automatically reduce returned volume to 5 if volume is above that.

## Heli Taxi :
* Tweaked: Heli taxi now makes use of the core clear waypoints function, should hopefully fix some issues when setting a new course

## Soldier tab
* Added : BluFor Tracker on tablet
> Blufor tracker only works when the tablet is connected to an antenna. On the tracker units will only show up if they are equipped with one of the following items:
1. "MRH_SoldierTab", PDA from milsim tools
2. "MRH_BluForTransponder", transponder from MRH Satellite mod
3. "ItemcTab", rugged tablet from cTab mod
4. "ItemAndroid", android device from cTab mod
5. "ACE_microDAGR" from ACE3
In addition, units will show on the blufor tracker if they are in a vehicle that's listed by the mod. by default most of vanilla, RHS USAF, RHS AFRF and RHS GREF APCs, Tanks, MRAPS, helicopters, boats and planes are included.
If you want to include a custom class of either Items or vehicles to the recognized vehicles you can use:
```
Function name:MRH_fnc_MilsimTools_Core_addToBFTenabledList
Author: Mr H.
Description: Will add the class to vehicles or items that show up on the BluFor tracker (provided a friendly unit is in them or they have item on self)
Return value: List of all allowed classes, updated with new ones
Public: Yes
Parameters:
0-<STRING> or <ARRAY> of <STRINGS> can either be vehicles classnames or items classnames
Example(s):
["My_vehicle"]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
["My_item"]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
[["My_veh1","My_veh2","My_veh3","My_item1","My_item2"]]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
```
or from an addon, add the property to a cfgVehicles class //not yet implemented for cfgWeapons items

```
mrh_satcom = 1;
```

or list them in
```
class MRH_BFT_enabledClasses
{
class enabledClasses
{
classes[]={};//vehicles or items
};
};
```
* Added : In vehicles with satcom capabilities players can connect their tablet's to the vehicle's satcom system, they can also connect it from outside but distance limitations apply and you will loose the signal when going too far frome a vehicle.
> Addon builders can add the property
```
mrh_satcom = 1;
```
To their configs to add satcom capabilities to their vehicles.
> Some RHS/gref/usaf/afrf vehicles are already added by script (so as not to add a dependency.
I may release a compatibilty mod in the future for RHS if requested.

//////////////////////////////////////////////////

# Changelog: MRH Milsim Tools version : v.1.18.0
## Core
* Added : Loadout summary in diary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,18 @@ Example(s):
call MRH_fnc_MilsimTools_HeliTaxi_buttonAction;
*/
#include "MRH_C_Path.hpp"
_veh = vehicle MRH_player;
_isInFinalApp = _veh GVARDef(isInFinalApproachPhase,false);
private _veh = vehicle MRH_player;
private _isInFinalApp = _veh GVARDef(isInFinalApproachPhase,false);
if (_isInFinalApp) exitWith {closedialog 0; hintC (localize "STR_MRH_HeliTaxi_LandingChangeDeniedHint");};
_wayPointsMarkers = MRH_player GVARDef(setWaypoints,[]);
private _wayPointsMarkers = MRH_player GVARDef(setWaypoints,[]);
//check that destination is set
_color = getMarkerColor "MRH_LZ_Marker";
private _color = getMarkerColor "MRH_LZ_Marker";
if (_color == "") ExitWith {hint (localize "STR_MRH_HeliTaxi_NoDestError")};
//-- clear previous waypoints for the vehicle
_oldWaypoints = waypoints group _veh;
_hadWaypoints =false;
private _oldWaypoints = waypoints group _veh;
private _hadWaypoints =false;
if (count _oldWaypoints >1) then {
_testArrAy= [];
_waypoint0 = (group _veh) addwaypoint [getpos _veh,0];
(group _veh) setCurrentWaypoint _waypoint0;
for "_i" from 0 to ((count _oldWaypoints)+1) do
{

deleteWaypoint [group _veh, 1];

};
[group _veh] CFUNC(clearAllWayPoints);

_hadWaypoints = true;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ call MRH_fnc_MilsimTools_Core_AddBriefingRoster;
*/
#include "MRH_C_Path.hpp"

_parameters = call MRH_fnc_MilsimTools_Core_ApplyRosterTextSettings;
_rosterText = _parameters call MRH_fnc_MilsimTools_Core_GenerateRosterText;
private _parameters = call MRH_fnc_MilsimTools_Core_ApplyRosterTextSettings;
private _rosterText = _parameters call MRH_fnc_MilsimTools_Core_GenerateRosterText;

_convert = [_rosterText,"t font","font face"] call CBA_fnc_replace;
private _convert = [_rosterText,"t font","font face"] call CBA_fnc_replace;
_convert = [_convert, "t color", "font color"] call CBA_fnc_replace;
_convert = [_convert, "<img image=", "<img width='15' height='15' image="] call CBA_fnc_replace;


if !(player diarySubjectExists "MRH_Roster") then {
player createDiarySubject ["MRH_Roster",localize "STR_MRH_CORE_TEAM_ROSTERTITLE", PAAPATH(group.paa)];
private _record = player createDiaryRecord ["MRH_Roster", [localize "STR_MRH_CORE_TEAM_ROSTERTITLE",_convert]];
missionNameSpace setVariable ["MRH_diary_roster_record",_record];

player createDiarySubject ["MRH_Roster",localize "STR_MRH_CORE_TEAM_ROSTERTITLE", PAAPATH(group.paa)];
_exe = player createDiaryRecord ["MRH_Roster", [localize "STR_MRH_CORE_TEAM_ROSTERTITLE",_convert]];

}
else
{
private _record = missionNameSpace getVariable "MRH_diary_roster_record";
player setDiaryRecordText [["MRH_Roster", _record],[localize "STR_MRH_CORE_TEAM_ROSTERTITLE",_convert]];
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Function name:MRH_fnc_MilsimTools_Core_
Author: Mr H.
Description:
Return value:
Public: No
Parameters:
Example(s):
[]call MRH_fnc_MilsimTools_Core_;
*/
#include "MRH_C_Path.hpp"
params ["_units","_ctrlMap"];
private _handle = [
{
params ["_units","_ctrlMap"];
_units append [objNull]; //the last unit won't display name for some reason
{
if ([_x ]FUNC(showOnBFT)) then {
if ((isNull objectParent _x) || (objectParent _x) != (objectParent (leader group _x))) then {
_ctrlMap drawIcon
[
getText (configFile >>"cfgVehicles">>typeOf _x>>"icon"),
[([side _x, false] call BIS_fnc_sideColor),[0,1,1,1]]select (_x isEqualTo MRH_player),
getPos _x,
24,
24,
[getDir _x,0] select isFormationLeader _x,
name _x,
0,
0.05,
"Unifont",
"right"
];
};
if (isFormationLeader _x) then
{
private _icons = [group _x] FUNC(NATO_symbols_for);
_icons params ["_icon","_modifier"];
_ctrlMap drawIcon
[
_icon,
[([side _x, false] call BIS_fnc_sideColor),[0,1,1,1]]select (_x isEqualTo MRH_player),
(getPos _x)vectorAdd [0,4,0],
24,
24,
[getDir _x,0] select isFormationLeader _x,
["",groupId group _x] select isFormationLeader _x,
0,
0.05,
"Unifont",
"right"
];
_ctrlMap drawIcon
[
_modifier,
([side _x, false] call BIS_fnc_sideColor),
(getPos _x)vectorAdd [0,2,0],
24,
24,
[getDir _x,0] select isFormationLeader _x,
["",groupId group _x] select isFormationLeader _x,
0,
0.05,
"Unifont",
"right"
];
};
};

}forEach _units;

},
[_units,_ctrlMap],
{},
{
((ctrlShown (_this select 1)) && ([MRH_Player] FUNC(isConnectedToAntenna)))
}
] FUNC(conditionalPFEH);
TRACE("BFT called");
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Function name:MRH_fnc_MilsimTools_Core_
Author: Mr H.
Description:
Return value:
Public: No
Parameters:
Example(s):
[]call MRH_fnc_MilsimTools_Core_;
*/
#include "MRH_C_Path.hpp"
params ["_grp"];
private ["_icon","_modifier","_leader"];
_leader = leader _grp;
switch (true) do
{
case (isNull (objectParent _leader)):{
if ((rank _leader) in ["CAPTAIN","MAJOR","COLONEL"])then {_icon ="\A3\Ui_f\data\Map\Markers\NATO\b_hq.paa"}else {_icon ="\A3\Ui_f\data\Map\Markers\NATO\b_inf.paa"
}};
case( (objectParent _leader)isKindOf "AIR") :{_icon ="\A3\ui_f\data\map\markers\nato\b_plane.paa"};
case( (objectParent _leader)isKindOf "Car") :{_icon = "\A3\ui_f\data\map\markers\nato\b_motor_inf.paa"};
case( (objectParent _leader)isKindOf "APC_Tracked_01_base_F") :{_icon = "\A3\ui_f\data\map\markers\nato\b_mech_inf.paa"};
case( (objectParent _leader)isKindOf "Tank") :{_icon = "\A3\ui_f\data\map\markers\nato\b_armor.paa"};
case( (objectParent _leader)isKindOf "Static") :{_icon ="\A3\ui_f\data\map\markers\nato\b_mortar.paa"};
case( (objectParent _leader)isKindOf "Boat_F") :{_icon ="\A3\ui_f\data\map\markers\nato\b_naval.paa"};
default {_icon ="\A3\Ui_f\data\Map\Markers\NATO\b_inf.paa"};
};



switch (true) do
{
case (rank _leader == "PRIVATE"): {_modifier =""};
case (rank _leader == "CORPORAL"): {_modifier = "\A3\ui_f\data\map\markers\nato\group_0.paa";};
case (rank _leader == "SERGEANT"): {_modifier = "\A3\ui_f\data\map\markers\nato\group_1.paa"};
case (rank _leader == "LIEUTENANT"): {_modifier ="\A3\ui_f\data\map\markers\nato\group_3.paa"};
case (rank _leader == "CAPTAIN"): {_modifier ="\A3\ui_f\data\map\markers\nato\group_4.paa"};
case (rank _leader == "MAJOR"): {_modifier ="\A3\ui_f\data\map\markers\nato\group_5.paa"};
case (rank _leader == "COLONEL"): {_modifier ="\A3\ui_f\data\map\markers\nato\group_6.paa"};
};
[_icon,_modifier]
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ if (_uid == _x select 0) then {_deadPlayersNew deleteAt (_deadPlayersNew find _
//if (_uid == _x select 0) then {_allDeadPlayersInclude deleteAt (_allDeadPlayersInclude find _x);};
} forEach _allDeadPlayersInclude;

missionNamespace setVariable ["MRH_MilsimTools_Core_allIncludingDisconnectedDeadPlayers",_deadPlayersNew,true];
missionNamespace setVariable ["MRH_MilsimTools_Core_allIncludingDisconnectedDeadPlayers",_deadPlayersNew,true];
["MRH_playerWasSetAsRevived",_target] call CBA_fnc_globalEvent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Function name:MRH_fnc_MilsimTools_Core_addToBFTenabledList
Author: Mr H.
Description: Will add the class to vehicles or items that show up on the BluFor tracker (provided a friendly unit is in them or they have item on self)
Return value: List of all allowed classes, updated with new ones
Public: Yes
Parameters:
0-<STRING> or <ARRAY> of <STRINGS> can either be vehicles classnames or items classnames
Example(s):
["My_vehicle"]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
["My_item"]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
[["My_veh1","My_veh2","My_veh3","My_item1","My_item2"]]call MRH_fnc_MilsimTools_Core_addToBFTenabledList;
*/
#include "MRH_C_Path.hpp"
params ["_add"];
private _allowedClasses = missionNamespace getVariable ["MRH_soldierTab_BFT_enabling_items_andVehs",[]];
if ((typeName _add)isEqualTo "ARRAY")then {_allowedClasses append _add};
if ((typeName _add)isEqualTo "STRING")then {_allowedClasses pushBackUnique _add};
missionNamespace setVariable ["MRH_soldierTab_BFT_enabling_items_andVehs",_allowedClasses,true];
_allowedClasses
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Function name:MRH_fnc_MilsimTools_Core_allPlayers
Author: Mr H.
Description: Sets the variables MRH_allplayers (allplayers excluding HCs), MRH_allAlivePlayers (allplayers excluding HCs that are considered alive by Milsim Tools) and MRH_allAliveAndConsciousPlayers (allplayers excluding HCs that are considered alive by Milsim Tools and conscious by ACE3) on the LOCAL machine various events call this function on every machine.
NOTE: These are auto-updated everywhere:
-Whenever a player connects
-Whenever a player disconnects
-Whenever a player is killed
-Whenever a player's conscious state is changed
-Whenever a player respawns
-Whenever the setRevived function is called on a unit
Return value: MRH_allPlayers OR MRH_allAlivePlayers OR MRH_allAliveAndConsciousPlayers depending on the input parameter, default is MRH_allPlayers
Public: Yes
Parameters:
0- <NUMBER> optionnal, if 0 (default) will return MRH_allPlayers, 1 MRH_allAlivePlayers,2 MRH_allAliveAndConsciousPlayers
Example(s):
call MRH_fnc_MilsimTools_Core_allPlayers;
0 call MRH_fnc_MilsimTools_Core_allPlayers;
//both of the above return MRH_allPlayers
1 call MRH_fnc_MilsimTools_Core_allPlayers; //returns MRH_allAlivePlayers
2 call MRH_fnc_MilsimTools_Core_allPlayers; // returns MRH_allAliveAndConsciousPlayers
*/
#include "MRH_C_Path.hpp"
params [["_return",0]];

// MRH_allPlayers excludes HCs
MRH_allPlayers = allPlayers - entities "HeadlessClient_F";

//MRH_allAlivePlayers excludes players that are considered dead by the mod & excludes HCs
private _MRH_allAlivePlayers = [];
{
if !(_x getVariable ["MRH_MilsimTools_Core_HasDied",false]) then {_MRH_AllAlivePlayers pushBackUnique _x};
} forEach MRH_allPlayers;

MRH_allAlivePlayers = _MRH_allAlivePlayers;

//MRH_allAliveAndConsciousPlayers excludes players that are considered dead by the mod,unconscious by ACE3 & excludes HCs
private _MRH_allAliveAndConsciousPlayers =[];
{
if ([_x] call ace_common_fnc_isAwake) then {_MRH_allAliveAndConsciousPlayers pushBackUnique _x};
}forEach _MRH_allAlivePlayers;

MRH_allAliveAndConsciousPlayers = _MRH_allAliveAndConsciousPlayers;
([MRH_allPlayers,MRH_allAlivePlayers,MRH_allAliveAndConsciousPlayers] select _return)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Function name:MRH_fnc_MilsimTools_Core_
Author: Mr H.
Description:
Return value:
Public: No
Parameters:
Example(s):
[]call MRH_fnc_MilsimTools_Core_;
*/
#include "MRH_C_Path.hpp"
params ["_weight"];
private ["_weightReal","_units"];
if (systemOfUnits !=2)then {_weightReal = _weight/22;_units = "Kg."}else {_weightReal = _weight/10;_units = "Lbs."};
[_weightReal,_units]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Function name:MRH_fnc_MilsimTools_Core_
Author: Mr H.
Description:
Return value:
Public: No
Parameters:
Example(s):
[]call MRH_fnc_MilsimTools_Core_canConnectToVehSatCom;
*/
#include "MRH_C_Path.hpp"
params ["_unit"];
private _veh = objectParent _unit;
if (isNull _veh) exitWith {false};
([_veh]FUNC(vehHasSatcom))
Loading

0 comments on commit ab0f55b

Please sign in to comment.