Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/(0.0.8)'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexanone committed Jul 6, 2017
2 parents f4a341c + fdbab3b commit 42da794
Show file tree
Hide file tree
Showing 55 changed files with 345 additions and 224 deletions.
Binary file modified @AresModAchillesExpansion/addons/data_f_achilles.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified @AresModAchillesExpansion/addons/data_f_ares.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified @AresModAchillesExpansion/addons/functions_f_achilles.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AUTHOR: Kex
// DATE: 9/2/16
// VERSION: 1.0
// DATE: 6/19/16
// VERSION: 2.0
// FILE: functions_f_achilles\functions\common\functions\fn_arrayMean.sqf
// DESCRIPTION: Determines the mean of an array
//
Expand All @@ -16,9 +16,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private ["_sum"];

_sum = 0;
private _n_items = count _this;
if (_n_items == 0) exitWith {0};
private _sum = 0;
{
_sum = _sum + _x;
} forEach _this;
_sum / (count _this);
_sum / _n_items;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AUTHOR: Kex
// DATE: 5/28/17
// VERSION: 1.0
// DATE: 6/25/17
// VERSION: 2.0
// DESCRIPTION: opens the "ammo" dialog for vehicles.
//
// ARGUMENTS:
Expand All @@ -14,52 +14,28 @@
// [_vehicle] call Achilles_fnc_changePylonAmmo;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (isNil {uiNamespace getVariable "Achilles_var_PylonMagDataCache"}) then
{
private _pylonMagDataCache = [];
private _mag_cfgs = (configFile >> "cfgMagazines") call BIS_fnc_returnChildren;
{
private _hardpoints = [_x, "hardpoints", []] call BIS_fnc_returnConfigEntry;
if (count _hardpoints > 0) then
{
_pylonMagDataCache pushBack [_x, _hardpoints];
};
} forEach _mag_cfgs;
_pylonMagDataCache = [_pylonMagDataCache, [], {getText (_x select 0 >> "displayName")}] call BIS_fnc_sortBy;
uiNamespace setVariable ["Achilles_var_PylonMagDataCache", _pylonMagDataCache];
};

params ["_plane"];
private _planeType = typeOf _plane;
if (not isClass (configFile >> "cfgVehicles" >> _planeType >> "Components" >> "TransportPylonsComponent")) exitWith {[localize "STR_NO_DYNAMIC_LOADOUT"] call Ares_fnc_ShowZeusMessage; playSound "FD_Start_F"; nil};

private _allCurrentPylonMagazines = getPylonMagazines _plane;
private _pylon_cfgs = (configFile >> "cfgVehicles" >> _planeType >> "Components" >> "TransportPylonsComponent" >> "pylons") call BIS_fnc_returnChildren;
private _entries = [];
private _allPylonMagIndices = [];
{
private _pylon_cfg = _x;
private _pylonIndex = _forEachIndex + 1;
private _pylonMagIndices = [-1];
private _magazineNames = ["Empty"];
private _refHardpoints = [_pylon_cfg, "hardpoints", []] call BIS_fnc_returnConfigEntry;
private _defaultIndex = 0;
{
_x params ["_mag_cfg","_hardpoints"];
private _intersect = _refHardpoints arrayIntersect _hardpoints;
if (count _intersect > 0) then
{
_magazineNames pushBack format ["%1 (%2)", getText (_mag_cfg >> "displayName"), getText (_mag_cfg >> "DisplayNameShort")];
_pylonMagIndices pushBack _forEachIndex;
if (configName _mag_cfg == _allCurrentPylonMagazines select (_pylonIndex - 1)) then {_defaultIndex = count _pylonMagIndices - 1};
};
} forEach (uiNamespace getVariable "Achilles_var_PylonMagDataCache");
_mag_cfg = (configFile >> "cfgMagazines" >> _x);
_magazineNames pushBack format ["%1 (%2)", getText (_mag_cfg >> "displayName"), getText (_mag_cfg >> "DisplayNameShort")];
if (configName _mag_cfg == _allCurrentPylonMagazines select (_pylonIndex - 1)) then {_defaultIndex = _forEachIndex + 1};
} forEach (_plane getCompatiblePylonMagazines _pylonIndex);

_entries pushBack [configName _pylon_cfg, _magazineNames, _defaultIndex, true];
_allPylonMagIndices pushBack _pylonMagIndices;
} forEach _pylon_cfgs;

_dialogResult = [localize "STR_AMMO", _entries] call Ares_fnc_ShowChooseDialog;
_dialogResult = [localize "STR_LOADOUT", _entries] call Ares_fnc_ShowChooseDialog;

if (count _dialogResult == 0) exitWith {};
_curatorSelected = ["vehicle"] call Achilles_fnc_getCuratorSelected;
Expand All @@ -68,14 +44,15 @@ _curatorSelected = _curatorSelected select {_x isKindOf _planeType};
{
_plane = _x;
{
private _pylonMagIndex = if (_x > 0) then {_allPylonMagIndices select _forEachIndex select _x} else {-1};
private _magClassName = if (_x > 0) then {configName ((uiNamespace getVariable "Achilles_var_PylonMagDataCache") select _pylonMagIndex select 0)} else {""};
private _magIndex = _x;
private _pylonIndex = _forEachIndex + 1;
private _magClassName = if (_x > 0) then {(_plane getCompatiblePylonMagazines _pylonIndex) select (_magIndex - 1)} else {""};
if (local _plane) then
{
_plane setPylonLoadOut [_forEachIndex + 1, _magClassName];
_plane setPylonLoadOut [_pylonIndex, _magClassName];
} else
{
[_plane, [_forEachIndex + 1, _magClassName]] remoteExecCall ["setPylonLoadOut", _plane];
[_plane, [_pylonIndex, _magClassName]] remoteExecCall ["setPylonLoadOut", _plane];
};
} forEach _dialogResult;
} forEach _curatorSelected;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _entity = param [0, ObjNull, [grpNull, ObjNull]];
_is_single_unit = (typeName _entity == "OBJECT");
_ace_loaded = isClass (configfile >> "CfgPatches" >> "ace_main");

_skill_choices =
private _skill_choices =
[
[localize "STR_AIMING_ACCURACY","SLIDER"],
[localize "STR_AIMING_SHAKE","SLIDER"],
Expand All @@ -36,12 +36,13 @@ _skill_choices =
[localize "STR_RELOAD_SPEED","SLIDER"],
[localize "STR_COMMANIDNG","SLIDER"]
];
_curatorSelected = [];
private _curatorSelected = [];
private _skillRange = getArray (configFile >> "Cfg3DEN" >> "Attributes" >> "Skill" >> "Controls" >> "Value" >> "sliderRange");
if (_is_single_unit) then
{
{
_skill_value = _entity skill (SKILLS select _forEachIndex);
_skill_value = linearConversion [0.2,1,_skill_value,0,1,true];
_skill_value = linearConversion (_skillRange + [_skill_value,0,1,true]);
_x append [_skill_value, true];
} forEach _skill_choices;

Expand Down Expand Up @@ -75,7 +76,7 @@ if (_is_single_unit) then
_entity = leader _entity;
{
_skill_value = _entity skill (SKILLS select _forEachIndex);
_skill_value = linearConversion [0.2,1,_skill_value,0,1,true];
_skill_value = linearConversion (_skillRange + [_skill_value,0,1,true]);
_x append [_skill_value, true];
} forEach _skill_choices;

Expand Down Expand Up @@ -107,10 +108,11 @@ if (_is_single_unit) then
_code =
{
params ["_unit", "_skill_values"];
private _skillRange = getArray (configFile >> "Cfg3DEN" >> "Attributes" >> "Skill" >> "Controls" >> "Value" >> "sliderRange");
{
_skill_type = _x;
_skill_value = _skill_values select _forEachIndex;
_skill_value = linearConversion [0,1,_skill_value,0.2,1];
_skill_value = linearConversion ([0,1,_skill_value] + _skillRange);
_unit setSkill [_skill_type, _skill_value];
} forEach SKILLS;
};
Expand All @@ -135,6 +137,7 @@ if (_is_single_unit) then
_code =
{
params ["_unit", "_trait_values", "_skill_values"];
private _skillRange = getArray (configFile >> "Cfg3DEN" >> "Attributes" >> "Skill" >> "Controls" >> "Value" >> "sliderRange");
{
_trait_type = _x;
_trait_value = if (_trait_values select _forEachIndex == 0) then {false} else {true};
Expand All @@ -144,7 +147,7 @@ if (_is_single_unit) then
{
_skill_type = _x;
_skill_value = _skill_values select _forEachIndex;
_skill_value = linearConversion [0,1,_skill_value,0.2,1];
_skill_value = linearConversion ([0,1,_skill_value] + _skillRange);
_unit setSkill [_skill_type, _skill_value];
} forEach SKILLS;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ if (!isPlayer _unit) then
sleep 1;

// if the unit already has a chute
if (toLower backpack _unit == "b_parachute") then {removeBackpack _unit};

_chute = "Steerable_Parachute_F" createVehicle [0,0,0];
_chute setPos (getPos _unit);
_chute setDir (getDir _unit);
_chute setVelocity (velocity _unit);
_unit moveInDriver _chute;
if (backpack _unit != "" and {getText (configfile >> "CfgVehicles" >> backpack _unit >> "backpackSimulation") == "ParachuteSteerable"}) then
{
_unit action ["openParachute"];
} else
{
_chute = "Steerable_Parachute_F" createVehicle [0,0,0];
_chute setPos (getPos _unit);
_chute setDir (getDir _unit);
_chute setVelocity (velocity _unit);
_unit moveInDriver _chute;
};
// prevent AI to be killed by fall damage
waitUntil {isTouchingGround _unit or (!alive _unit)};
_unit removeEventHandler ["HandleDamage",_id];
Expand All @@ -51,7 +55,7 @@ if (!isPlayer _unit) then
_backpack_class = backpack _unit;

// if the unit already have a chute
if (toLower _backpack_class == "b_parachute") then {_backpack_class = ""};
if (backpack _unit != "" and {getText (configfile >> "CfgVehicles" >> backpack _unit >> "backpackSimulation") == "ParachuteSteerable"}) then {_backpack_class = ""};

if (_backpack_class != "") then
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AUTHOR: Kex
// DATE: 1/3/17
// VERSION: 3.0
// DATE: 6/26/17
// VERSION: 5.0
// DESCRIPTION: Initalization function; this function is called when the curator display is loaded for the first time
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -19,7 +19,10 @@ if (not ("achilles_modules_f_achilles" in (curatorAddons getAssignedCuratorLogic
waitUntil {sleep 1; not isNull (findDisplay 312)};

// Wait until Zeus modules are avaiable (e.g. respawns has to be placed before)
waitUntil {sleep 1; _tree_ctrl tvText [(_tree_ctrl tvCount []) - 1] == localize "STR_ZEUS"};
if (count allMissionObjects "ModuleMPTypeGameMaster_F" > 0) then
{
waitUntil {sleep 1; missionnamespace getvariable ["BIS_moduleMPTypeGameMaster_init", false]};
};

[[getAssignedCuratorLogic player],
{
Expand Down Expand Up @@ -55,7 +58,6 @@ Achilles_var_reloadVisionModes = nil;
_curatorModule = getassignedcuratorLogic player;
_curatorModule addEventHandler ["CuratorObjectPlaced", { _this call Achilles_fnc_HandleCuratorObjectPlaced; }];
_curatorModule addEventHandler ["CuratorGroupPlaced", { _this call Achilles_fnc_HandleCuratorGroupPlaced; }];
_curatorModule addEventHandler ["CuratorObjectDoubleClicked", { _this call Achilles_fnc_HandleCuratorObjectDoubleClicked; }];
_curatorModule addEventHandler ["CuratorObjectEdited", {_this call Achilles_fnc_HandleCuratorObjectEdited; }];
_curatorModule addEventHandler ["CuratorObjectDeleted", {_this call Achilles_fnc_HandleCuratorObjectDeleted; }];
_curatorModule addEventHandler ["CuratorWaypointPlaced", {_this call Achilles_fnc_HandleCuratorWpPlaced; }];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

//#include "\A3\ui_f_curator\ui\defineResinclDesign.inc"

// handle double click as remote control / switch unit instead
if(not isNull (missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull])) exitWith {};

_entity = [_this] param [0,objnull,[objnull,grpnull,[],""]];
_curator = getAssignedCuratorLogic player;
_isPlayer = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if !(isnull curatorcamera) then {
{
_effect = ppEffectCreate ["ColorCorrections", 312312];
missionNamespace setVariable ["Achilles_var_NVGBrightnessEffect", _effect];
["onLoad",
["Achilles_onLoadCuratorInterface",
{
private _curator = getAssignedCuratorLogic player;
private _modes = _curator call bis_fnc_curatorVisionModes;
Expand All @@ -60,8 +60,8 @@ if !(isnull curatorcamera) then {
{
(missionNamespace getVariable "Achilles_var_NVGBrightnessEffect") ppEffectEnable true;
};
}] call Achilles_fnc_addCuratorInterfaceEventHandler;
["onUnload", {(missionNamespace getVariable "Achilles_var_NVGBrightnessEffect") ppEffectEnable false}] call Achilles_fnc_addCuratorInterfaceEventHandler;
}] call CBA_fnc_addEventHandler;
["Achilles_onUnloadCuratorInterface", {(missionNamespace getVariable "Achilles_var_NVGBrightnessEffect") ppEffectEnable false}] call CBA_fnc_addEventHandler;
};

//--- NVG => enable brightness adjustment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AUTHOR: Kex
// DATE: 6/15/17
// VERSION: 2.0
// DATE: 6/19/17
// VERSION: 3.0
// DESCRIPTION: application of "selectPlayer" script command.
//
// ARGUMENTS:
Expand All @@ -17,11 +17,12 @@
private _error = "";
private _unit = effectiveCommander (param [0]);
if (not (side group _unit in [east,west,resistance,civilian])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";};
if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";};
if (isPlayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";};
if (not alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";};
if (isClass (configfile >> "CfgPatches" >> "ace_medical") and {_unit getVariable ["ACE_isUnconscious", false]}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";};
if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";};
if (isuavconnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";};
if (isClass (configfile >> "CfgPatches" >> "ace_medical") and {_unit getVariable ["ACE_isUnconscious", false]}) then {_error = localize "STR_ERROR_UNIT_IS_UNCONSCIOUS";};
if (isNull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";};
if (isUAVConnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";};
if (unitIsUAV vehicle _unit) then {_error = localize "STR_ERROR_VEHICLE_IS_A_DRONE";};

if (_error != "") exitWith {[_error] call Ares_fnc_ShowZeusMessage; playSound "FD_Start_F"; nil};

Expand All @@ -30,7 +31,9 @@ private _damage_allowed = isDamageAllowed _playerUnit;
_unit setVariable ["Achilles_var_switchUnit_data",[name _unit, _playerUnit, _damage_allowed], true];
bis_fnc_moduleRemoteControl_unit = _unit;

private _face = face _unit;
selectPlayer _unit;
[_unit, _face] remoteExecCall ["setFace", 0];
_playerUnit disableAI "ALL";
_playerUnit enableAI "ANIM";
_playerUnit allowDamage false;
Expand Down
Binary file modified @AresModAchillesExpansion/addons/functions_f_ares.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified @AresModAchillesExpansion/addons/language_f.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions @AresModAchillesExpansion/addons/language_f/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2778,6 +2778,12 @@
<English>no dynamic loadout available</English>
<French>Pas de l'armement dynamique</French>
<German>Keine dynamische Bewaffnung verfügbar</German>
</Key>
<Key ID="STR_LOADOUT">
<Original>LOADOUT</Original>
<English>LOADOUT</English>
<French>L'ARMEMENT</French>
<German>BEWAFFNUNG</German>
</Key>
<Key ID="STR_SWITCH_UNIT">
<Original>Switch unit</Original>
Expand Down Expand Up @@ -2996,6 +3002,18 @@
<French>Pas de joueur a été choisi!</French>
<German>Kein Spieler wurde ausgewählt!</German>
</Key>
<Key ID="STR_ERROR_UNIT_IS_UNCONSCIOUS">
<Original>Error: Unit is unconscious!</Original>
<English>Error: Unit is unconscious!</English>
<French>Erreur: L'unité est sans connaissance!</French>
<German>Fehler: Einheit ist nicht bei Bewusstsein</German>
</Key>
<Key ID="STR_ERROR_VEHICLE_IS_A_DRONE">
<Original>Error: Unit is a drone!</Original>
<English>Error: Unit is a drone!</English>
<French>Erreur: C'est un drone!</French>
<German>Fehler: Einheit ist eine Drohne</German>
</Key>
</Container>
<Container name="cfg Waypoints">
<Key ID="STR_LOITER_HELI">
Expand Down
Binary file modified @AresModAchillesExpansion/addons/modules_f_achilles.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ class Achilles_Replacement_Function_Base
file = "\achilles\modules_f_achilles\Replacement\functions";

class moduleMine;
class moduleRemoteControl;
class moduleCAS_server;
};
Loading

0 comments on commit 42da794

Please sign in to comment.