diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf index 33a532eb..22a7f15a 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf @@ -17,7 +17,7 @@ // [player,3] spawn Achilles_fnc_chute; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -params ["_unit", "_delay"]; +params ["_unit", ["_delay", 0, [0]]]; sleep _delay; @@ -38,23 +38,24 @@ if (!isPlayer _unit) then private _item_cargo = getItemCargo _container; removeBackpack _unit; - waitUntil {sleep 1; !alive _unit || getPos _unit select 2 < 150}; + waitUntil {sleep 0.1; !alive _unit || getPos _unit select 2 < 120}; private _chuteClass = ["b_parachute", _backpackClass] select (getText (configfile >> "CfgVehicles" >> _backpackClass >> "backpackSimulation") isEqualTo "ParachuteSteerable"); _unit addBackpack _chuteClass; _unit action ["openParachute"]; _unit addBackpack _backpackClass; + clearAllItemsFromBackpack _unit; _container = backpackContainer _unit; {_container addWeaponCargo [_x, (_weapon_cargo select 1) select _forEachIndex]} forEach (_weapon_cargo select 0); {_container addMagazineCargo [_x, (_magazine_cargo select 1) select _forEachIndex]} forEach (_magazine_cargo select 0); {_container addItemCargo [_x, (_item_cargo select 1) select _forEachIndex]} forEach (_item_cargo select 0); } else { - waitUntil {sleep 1; !alive _unit || getPos _unit select 2 < 150}; + waitUntil {sleep 0.1; !alive _unit || getPos _unit select 2 < 120}; _unit addBackpack "b_parachute"; _unit action ["openParachute"]; }; // prevent AI to be killed by fall damage - waitUntil {isTouchingGround _unit or (!alive _unit)}; + waitUntil {sleep 0.1; isTouchingGround _unit or (!alive _unit)}; _unit removeEventHandler ["HandleDamage",_id]; } else @@ -87,6 +88,7 @@ if (!isPlayer _unit) then waitUntil {isTouchingGround _unit or (getPos _unit select 2) < 1 or (!alive _unit)}; deleteVehicle _packHolder; _unit addBackpack _backpack_class; + clearAllItemsFromBackpack _unit; _container = backpackContainer _unit; {_container addWeaponCargo [_x, (_weapon_cargo select 1) select _forEachIndex]} forEach (_weapon_cargo select 0); {_container addMagazineCargo [_x, (_magazine_cargo select 1) select _forEachIndex]} forEach (_magazine_cargo select 0); diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/scripts/fn_wpParadrop.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/scripts/fn_wpParadrop.sqf index aec0d82d..e23b800f 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/scripts/fn_wpParadrop.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/scripts/fn_wpParadrop.sqf @@ -12,7 +12,7 @@ Returns: BOOL */ -params [["_group", grpNull, [grpNull]], ["_end_pos", [], [[]], 3], ["_target", objNull, [objNull]]]; +params [["_group", grpNull, [grpNull]], ["_endPos", [], [[]], 3], ["_target", objNull, [objNull]]]; ////////////////////////////////////// // executed on second script call @@ -31,8 +31,8 @@ if (isNil "Achilles_var_eject_init_done") then publicVariableServer "Achilles_fnc_eject_passengers"; Achilles_var_eject_init_done = true; }; -private _wp_index = currentwaypoint _group; -private _wp = [_group,_wp_index]; +private _wpIndex = currentwaypoint _group; +private _wp = [_group,_wpIndex]; _wp setwaypointdescription localize "STR_AMAE_PARADROP"; _wp setWaypointName localize "STR_AMAE_PARADROP"; @@ -54,41 +54,65 @@ private _vehsType = ""; // Kex: prevent pilot from being stupid _group allowFleeing 0; -_vehsType = typeOf (_vehsGroup select 0); +_vehsGroup params ["_firstVeh"]; +_vehsType = typeOf _firstVeh; private _radius = 0; private _vector = []; // displace effective target position for flyby -private _start_pos = position leader _group; +private _startPos = position leader _group; if (_vehsType isKindOf "Helicopter") then { - _vector = _end_pos vectorDiff _start_pos; + _vector = _endPos vectorDiff _startPos; _vector set [2,0]; _vector = vectorNormalized _vector; _vector = _vector vectorMultiply 1000; - _radius = 1200; + _radius = 1000; } else { _vector = [0,0,0]; - _radius = 100; + _radius = 0; }; -private _wp_pos = _end_pos vectorAdd _vector; +private _wpPos = _endPos vectorAdd _vector; -[_vehsGroup,_wp_pos,_radius] spawn +// adjust distance for deployment according to crew count and velocity +private _speed = getNumber (configfile >> "CfgVehicles" >> _vehsType >> "maxSpeed"); +private _coefName = ["normalSpeedForwardCoef", "limitedSpeedCoef"] select (speedMode _group == "LIMITED"); +_speed = _speed * getNumber (configfile >> "CfgVehicles" >> _vehsType >> _coefName); + +// every second a unit ejects. We want the middle unit right above the location +private _crew = crew _firstVeh; +private _passengerCount = {(assignedVehicleRole _x) select 0 == "CARGO"} count _crew; +_radius = _radius + _passengerCount/2 * _speed/3.6; + +// account for speed displacement +if (getPos _firstVeh select 2 > 150) then { + // fitted function for HALO + _radius = _radius + 4.2e-4 * _speed^3 * (1 - 1/(1 + (75/_speed)^2.2)); +} +else +{ + // fitted function for HAHO + _radius = _radius + 0.338 * _speed; +}; + +[_vehsGroup,_wpPos,_radius] spawn +{ + params ["_vehsGroup", "_wpPos", "_radius"]; + private _vehsRdy = false; waituntil { - params ["_vehsGroup","_wp_pos","_radius"]; - private "_veh"; - private _vehsRdy = false; + private _aliveCount = 0; { - _veh = _x; - if ((position _veh) distance2D _wp_pos < _radius and !_vehsRdy) then + private _veh = _x; + _aliveCount = _aliveCount + 1; + if ((position _veh) distance2D _wpPos < _radius) exitWith { [_vehsGroup] call Achilles_fnc_eject_passengers; _vehsRdy = true; }; } forEach (_vehsGroup select {alive _x}); - + if (_aliveCount == 0) then {_vehsRdy = true}; sleep 1; _vehsRdy; }; @@ -96,8 +120,8 @@ private _wp_pos = _end_pos vectorAdd _vector; _group setVariable ["Achilles_var_paradrop",true]; -[_group,_wp_index,_wp_pos] spawn +[_group,_wpIndex,_wpPos] spawn { - params ["_group","_wp_index","_wp_pos"]; - _group addWaypoint [_wp_pos, 100, _wp_index]; + params ["_group","_wpIndex","_wpPos"]; + _group addWaypoint [_wpPos, 100, _wpIndex]; }; diff --git a/@AresModAchillesExpansion/addons/functions_f_ares/features/fn_TeleportPlayers.sqf b/@AresModAchillesExpansion/addons/functions_f_ares/features/fn_TeleportPlayers.sqf index 8a3b57b2..f64080c7 100644 --- a/@AresModAchillesExpansion/addons/functions_f_ares/features/fn_TeleportPlayers.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_ares/features/fn_TeleportPlayers.sqf @@ -1,4 +1,10 @@ -params[["_playersToTeleport", [objNull]], ["_teleportLocation", [0,0,0]], ["_showTeleportMessage", true], ["_includeVehicles", true]]; +params +[ + ["_playersToTeleport", [objNull]], + ["_teleportLocation", [0,0,0]], + ["_showTeleportMessage", true], + ["_additionalOption", 0] +]; // Show some text to the players that are going to be teleported. if (_showTeleportMessage) then @@ -9,19 +15,29 @@ if (_showTeleportMessage) then [[], {if (player in Ares_playersToShowMessageTo) then { titleText [localize "STR_AMAE_YOU_ARE_BEING_TELEPORTED", "BLACK", 1]; sleep 1; titleFadeOut 2}}] remoteExec ["spawn", -2]; }; +private _includeVehicles = (_additionalOption == 1); +private _doHALO = (_additionalOption == 2); + +if (_doHALO) then +{ + _teleportLocation set [2, 3000]; +}; + while {!(_playersToTeleport isEqualto [])} do { private _unit_to_tp = [_playersToTeleport select 0, vehicle (_playersToTeleport select 0)] select _includeVehicles; - [_unit_to_tp, _teleportLocation, _showTeleportMessage] spawn + [_unit_to_tp, _teleportLocation, _showTeleportMessage, _doHALO] spawn { - params ["_unit", "_teleportLocation", "_showTeleportMessage"]; + params ["_unit", "_teleportLocation", "_showTeleportMessage", "_doHALO"]; if (_showTeleportMessage) then { sleep 1; }; _unit setVehiclePosition [_teleportLocation, [], 0, "FORM"]; + _unit setPos [getPos _unit select 0, getPos _unit select 1, _teleportLocation select 2]; + if (_doHALO) then {[_unit] call Achilles_fnc_chute}; }; _playersToTeleport = [_playersToTeleport - [_unit_to_tp], _playersToTeleport - crew _unit_to_tp] select _includeVehicles; diff --git a/@AresModAchillesExpansion/addons/language_f/stringtable.xml b/@AresModAchillesExpansion/addons/language_f/stringtable.xml index a92c091d..c2046daa 100644 --- a/@AresModAchillesExpansion/addons/language_f/stringtable.xml +++ b/@AresModAchillesExpansion/addons/language_f/stringtable.xml @@ -2266,6 +2266,13 @@ モード 模式 + + + Additional option + Additional option + Option supplémentaire + Zusatzoption + All objects in mission All objects in mission @@ -5168,6 +5175,12 @@ 空挺 空投 + + HALO + HALO + HALO + HALO + SEARCH BUILDING SEARCH BUILDING diff --git a/@AresModAchillesExpansion/addons/modules_f_ares/Player/functions/fn_PlayerTeleport.sqf b/@AresModAchillesExpansion/addons/modules_f_ares/Player/functions/fn_PlayerTeleport.sqf index 4fe057d9..798e521a 100644 --- a/@AresModAchillesExpansion/addons/modules_f_ares/Player/functions/fn_PlayerTeleport.sqf +++ b/@AresModAchillesExpansion/addons/modules_f_ares/Player/functions/fn_PlayerTeleport.sqf @@ -16,14 +16,16 @@ private _dialogResult = [ [localize "STR_AMAE_MODE",[localize "STR_AMAE_ZEUS", localize "STR_AMAE_ALL",localize "STR_AMAE_SELECTION",localize "STR_AMAE_SIDE", localize "STR_AMAE_PLAYERS", localize "STR_AMAE_GROUP"]], ["", [""]], [localize "STR_AMAE_SIDE","ALLSIDE"], - [localize "STR_AMAE_INCLUDE_VEHICLES",[localize "STR_AMAE_FALSE",localize "STR_AMAE_TRUE"]] + [localize "STR_ADDITIONAL_OPTION",[localize "STR_AMAE_NONE", localize "STR_AMAE_INCLUDE_VEHICLES", localize "STR_AMAE_HALO"]] ], "Achilles_fnc_RscDisplayAttributes_selectPlayers" ] call Ares_fnc_ShowChooseDialog; if (_dialogResult isEqualTo []) exitWith {}; -private _playersToTeleport = switch (_dialogResult select 0) do +_dialogResult params ["_mode", "", "_side_index", "_additionalOption"]; + +private _playersToTeleport = switch (_mode) do { case 0: { @@ -41,7 +43,6 @@ private _playersToTeleport = switch (_dialogResult select 0) do }; case 3: { - private _side_index = _dialogResult select 2; if (_side_index == 0) exitWith {[player]}; private _side = [east,west,independent,civilian] select (_side_index - 1); allPlayers select {(alive _x) and (side _x == _side)}; @@ -63,10 +64,9 @@ if (_playersToTeleport isEqualTo []) exitWith ["No players in selection!"] call Ares_fnc_ShowZeusMessage; playSound "FD_Start_F"; }; -private _includeVehicles = if ((_dialogResult select 3) == 0) then {false} else {true}; // Call the teleport function. -[_playersToTeleport, _tp_pos, true, _includeVehicles] call Ares_fnc_TeleportPlayers; +[_playersToTeleport, _tp_pos, true, _additionalOption] call Ares_fnc_TeleportPlayers; [objNull, format["Teleported %1 players to %2", (count _playersToTeleport), _tp_pos]] call bis_fnc_showCuratorFeedbackMessage; diff --git a/@AresModAchillesExpansion/addons/modules_f_ares/Reinforcements/functions/fn_ReinforcementsCreateUnits.sqf b/@AresModAchillesExpansion/addons/modules_f_ares/Reinforcements/functions/fn_ReinforcementsCreateUnits.sqf index 09e284ce..3a959f6c 100644 --- a/@AresModAchillesExpansion/addons/modules_f_ares/Reinforcements/functions/fn_ReinforcementsCreateUnits.sqf +++ b/@AresModAchillesExpansion/addons/modules_f_ares/Reinforcements/functions/fn_ReinforcementsCreateUnits.sqf @@ -9,7 +9,7 @@ disableSerialization; -private _spawn_position = position _logic; +private _spawnPosition = position _logic; // options for selecting positions private _extraOptions = [localize "STR_AMAE_RANDOM", localize "STR_AMAE_NEAREST", localize "STR_AMAE_FARTHEST"]; @@ -151,67 +151,44 @@ private _dialogResult = // Get dialog results if (_dialogResult isEqualTo []) exitWith {}; -_dialogResult params ["_side_id","_vehicle_faction_id","_vehicle_category_id","_vehicle_id","_vehicle_behaviour","_lzdz_algorithm","_lzdz_type","_group_faction_id","_group_id","_rp_algorithm","_group_behaviour"]; +_dialogResult params ["_side_id","_vehicle_faction_id","_vehicle_category_id","_vehicle_id","_vehicle_behaviour","_lzdz_algorithm","_lzdzType","_group_faction_id","_group_id","_rp_algorithm","_group_behaviour"]; private _side = SIDES select _side_id; -private _vehicle_type = (uiNamespace getVariable "Achilles_var_nestedList_vehicles") select _side_id select _vehicle_faction_id select _vehicle_category_id select _vehicle_id; +private _vehicleType = (uiNamespace getVariable "Achilles_var_nestedList_vehicles") select _side_id select _vehicle_faction_id select _vehicle_category_id select _vehicle_id; private _grp_cfg = (uiNamespace getVariable "Achilles_var_nestedList_groups") select _side_id select _group_faction_id select _group_id; private _lzSize = 20; // TODO make this a dialog parameter? private _rpSize = 20; // TODO make this a dialog parameters? // Choose the LZ based on what the user indicated -private _lzLogic = [_spawn_position, _allLzLogics, _lzdz_algorithm] call Achilles_fnc_logicSelector; +private _lzLogic = [_spawnPosition, _allLzLogics, _lzdz_algorithm] call Achilles_fnc_logicSelector; private _lzPos = position _lzLogic; // create the transport vehicle -private _vehicleInfo = [_spawn_position, _spawn_position getDir _lzPos, _vehicle_type, _side] call BIS_fnc_spawnVehicle; -_vehicleInfo params ["_vehicle", "_", "_vehicleGroup"]; -private _vehicleUnloadWp = _vehicleGroup addWaypoint [_lzPos, _lzSize]; -if (_vehicle isKindOf "Air" and (_dialogResult select 6 > 0)) then -{ - _vehicleUnloadWp setWaypointType "SCRIPTED"; - private _script = ["\achilles\functions_f_achilles\scripts\fn_wpParadrop.sqf", "\achilles\functions_f_achilles\scripts\fn_wpFastrope.sqf"] select (_dialogResult select 6 == 1); - _vehicleUnloadWp setWaypointScript _script; -} else -{ - _vehicleUnloadWp setWaypointType "TR UNLOAD"; -}; +private _vehicleInfo = [_spawnPosition, _spawnPosition getDir _lzPos, _vehicleType, _side] call BIS_fnc_spawnVehicle; +_vehicleInfo params ["_vehicle", "", "_vehicleGroup"]; -// Make the driver full skill. This makes him less likely to do dumb things -// when they take contact. -(driver (vehicle (leader _vehicleGroup))) setSkill 1; - -if (_vehicle_type isKindOf "Air") then +if (_vehicle isKindOf "Plane") then { - // Special settings for helicopters. Otherwise they tend to run away instead of land - // if the LZ is hot. - { - _x allowFleeing 0; // Especially for helos... They're very cowardly. - } forEach (crew (vehicle (leader _vehicleGroup))); - _vehicleUnloadWp setWaypointTimeout [0,0,0]; -} -else -{ - _vehicleUnloadWp setWaypointTimeout [5,10,20]; // Give the units some time to get away from truck -}; - -// Generate the waypoints for after the transport drops off the troops. -if (_vehicle_behaviour == 0) then -{ - // RTB and despawn. - private _vehicleReturnWp = _vehicleGroup addWaypoint [_spawn_position, 0]; - _vehicleReturnWp setWaypointTimeout [2,2,2]; // Let the unit stop before being despawned. - _vehicleReturnWp setWaypointStatements ["true", "deleteVehicle (vehicle this); {deleteVehicle _x} foreach thisList;"]; + // Adjust spawn and flight altitude + private _height = [80, 3000] select (_lzdzType isEqualTo 3); + _vehicle flyInHeight _height; + _vehicle setPos (_spawnPosition vectorAdd [0, 0, _height]); + + // Fix for CUP planes (somehow they don't have a start velocity despite using BIS_fnc_spawnVehicle) + private _speed = getNumber (configfile >> "CfgVehicles" >> _vehicleType >> "maxSpeed"); + private _coefName = ["normalSpeedForwardCoef", "limitedSpeedCoef"] select (speedMode _vehicleGroup == "LIMITED"); + _speed = _speed * getNumber (configfile >> "CfgVehicles" >> _vehicleType >> _coefName); + _vehicle setVelocityModelSpace [0, _speed/3.6, 0]; }; // Add vehicle to curator [[_vehicle]] call Ares_fnc_AddUnitsToCurator; -private _CrewTara = [_vehicle_type,false] call BIS_fnc_crewCount; -private _CrewBrutto = [_vehicle_type,true] call BIS_fnc_crewCount; +private _CrewTara = [_vehicleType,false] call BIS_fnc_crewCount; +private _CrewBrutto = [_vehicleType,true] call BIS_fnc_crewCount; private _CrewNetto = _CrewBrutto - _CrewTara; // create infantry group and resize it to the given cargo space if needed -private _infantry_group = [_spawn_position, _side, _grp_cfg] call BIS_fnc_spawnGroup; +private _infantry_group = [_spawnPosition, _side, _grp_cfg] call BIS_fnc_spawnGroup; // delete remaining units if vehicle is overcrouded private _infantry_list = units _infantry_group; if (count _infantry_list > _CrewNetto) then @@ -248,7 +225,7 @@ _infantry_group addWaypoint [_rpPos, _rpSize]; // Load the units into the vehicle. { - _x moveInCargo (vehicle (leader _vehicleGroup)); + _x moveInCargo _vehicle; } forEach _infantry_list; // Add infantry to curator @@ -260,6 +237,51 @@ if (_vehicle getVariable ["Achilles_var_noFastrope", false]) exitWith {deleteVehicle _x} forEach _infantry_list; }; +// create a waypoint for deploying the units +private _vehicleUnloadWp = _vehicleGroup addWaypoint [_lzPos, _lzSize]; +if (_vehicle isKindOf "Air" and (_lzdzType > 0)) then +{ + _vehicleUnloadWp setWaypointType "SCRIPTED"; + private _script = + [ + "\achilles\functions_f_achilles\scripts\fn_wpParadrop.sqf", + "\achilles\functions_f_achilles\scripts\fn_wpFastrope.sqf" + ] select (_lzdzType isEqualTo 1); + _vehicleUnloadWp setWaypointScript _script; +} else +{ + _vehicleUnloadWp setWaypointType "TR UNLOAD"; +}; + +// Make the driver full skill. This makes him less likely to do dumb things +// when they take contact. +(driver _vehicle) setSkill 1; + +if (_vehicleType isKindOf "Air") then +{ + // Special settings for helicopters. Otherwise they tend to run away instead of land + // if the LZ is hot. + { + _x allowFleeing 0; // Especially for helos... They're very cowardly. + } forEach (crew _vehicle); + // armed aircrafts are unreliable when they are not CARELESS + _vehicleGroup setBehaviour "CARELESS"; + _vehicleUnloadWp setWaypointTimeout [0,0,0]; +} +else +{ + _vehicleUnloadWp setWaypointTimeout [5,10,20]; // Give the units some time to get away from truck +}; + +// Generate the waypoints for after the transport drops off the troops. +if (_vehicle_behaviour == 0) then +{ + // RTB and despawn. + private _vehicleReturnWp = _vehicleGroup addWaypoint [_spawnPosition, 0]; + _vehicleReturnWp setWaypointTimeout [2,2,2]; // Let the unit stop before being despawned. + _vehicleReturnWp setWaypointStatements ["true", "deleteVehicle (vehicle this); {deleteVehicle _x} foreach thisList;"]; +}; + // print a confirmation [localize "STR_AMAE_REINFORCEMENT_DISPATCHED"] call Ares_fnc_showZeusMessage; diff --git a/@AresModAchillesExpansion/addons/ui_f/functions/dialogs/fn_RscDisplayAttributes_CreateReinforcement.sqf b/@AresModAchillesExpansion/addons/ui_f/functions/dialogs/fn_RscDisplayAttributes_CreateReinforcement.sqf index a2e3aece..c505e5b3 100644 --- a/@AresModAchillesExpansion/addons/ui_f/functions/dialogs/fn_RscDisplayAttributes_CreateReinforcement.sqf +++ b/@AresModAchillesExpansion/addons/ui_f/functions/dialogs/fn_RscDisplayAttributes_CreateReinforcement.sqf @@ -18,131 +18,142 @@ switch (_mode) do { case "LOADED": { - private _ctrl_side = _dialog displayCtrl IDC_COMBO_SIDE; - _ctrl_side lbSetCurSel lbCurSel _ctrl_side; + private _ctrlSide = _dialog displayCtrl IDC_COMBO_SIDE; + _ctrlSide lbSetCurSel lbCurSel _ctrlSide; }; case "SIDE": { - private _ctrl_veh_fac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; + private _ctrlVehFac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; - lbClear _ctrl_veh_fac; + lbClear _ctrlVehFac; { - _ctrl_veh_fac lbAdd _x; + _ctrlVehFac lbAdd _x; } forEach (Achilles_var_nestedList_vehicleFactions select _comboIndex); - private _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_1", 0]; - _last_choice = [(lbSize _ctrl_veh_fac) - 1, _last_choice] select (_last_choice < lbSize _ctrl_veh_fac); - _last_choice = [0,_last_choice] select (_last_choice isEqualType 0); - _ctrl_veh_fac lbSetCurSel _last_choice; + private _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_1", 0]; + _lastChoice = [(lbSize _ctrlVehFac) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlVehFac); + _lastChoice = [0,_lastChoice] select (_lastChoice isEqualType 0); + _ctrlVehFac lbSetCurSel _lastChoice; }; case "VEHICLE_FACTION": { - private _ctrl_side = _dialog displayCtrl IDC_COMBO_SIDE; - private _side_id = lbCurSel _ctrl_side; - private _ctrl_veh_cat = _dialog displayCtrl IDC_COMBO_VEHICLE_CATEGORY; - private _ctrl_veh_fac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; - private _ctrl_grp_fac = _dialog displayCtrl IDC_COMBO_GROUP_FACTION; + private _ctrlSide = _dialog displayCtrl IDC_COMBO_SIDE; + private _sideId = lbCurSel _ctrlSide; + private _ctrlVehCat = _dialog displayCtrl IDC_COMBO_VEHICLE_CATEGORY; + private _ctrlVehFac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; + private _ctrlGrpFac = _dialog displayCtrl IDC_COMBO_GROUP_FACTION; - lbClear _ctrl_veh_cat; + lbClear _ctrlVehCat; { - _ctrl_veh_cat lbAdd _x; - } forEach (Achilles_var_nestedList_vehicleCategories select _side_id select _comboIndex); - private _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_2", 0]; - _last_choice = [(lbSize _ctrl_veh_cat) - 1, _last_choice] select (_last_choice < lbSize _ctrl_veh_cat); - _last_choice = [0,_last_choice] select (_last_choice isEqualType 0); - _ctrl_veh_cat lbSetCurSel _last_choice; + _ctrlVehCat lbAdd _x; + } forEach (Achilles_var_nestedList_vehicleCategories select _sideId select _comboIndex); + private _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_2", 0]; + _lastChoice = [(lbSize _ctrlVehCat) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlVehCat); + _lastChoice = [0,_lastChoice] select (_lastChoice isEqualType 0); + _ctrlVehCat lbSetCurSel _lastChoice; - if (_ctrl_grp_fac getVariable ["first_time", true]) then + if (_ctrlGrpFac getVariable ["first_time", true]) then { - _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_7", ""]; - _ctrl_grp_fac setVariable ["first_time", false]; + _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_7", ""]; + _ctrlGrpFac setVariable ["first_time", false]; } else { - _last_choice = ""; + _lastChoice = ""; }; - lbClear _ctrl_grp_fac; - if (_last_choice isEqualTo "") then + lbClear _ctrlGrpFac; + if (_lastChoice isEqualTo "") then { - private _ref_name = _ctrl_veh_fac lbText _comboIndex; - _last_choice = 0; + private _ref_name = _ctrlVehFac lbText _comboIndex; + _lastChoice = 0; { - _ctrl_grp_fac lbAdd _x; + _ctrlGrpFac lbAdd _x; if (_ref_name == _x) then { - _last_choice = _forEachIndex; + _lastChoice = _forEachIndex; }; - } forEach (Achilles_var_nestedList_groupFactions select _side_id); + } forEach (Achilles_var_nestedList_groupFactions select _sideId); } else { { - _ctrl_grp_fac lbAdd _x; - } forEach (Achilles_var_nestedList_groupFactions select _side_id); - _last_choice = [(lbSize _ctrl_grp_fac) - 1, _last_choice] select (_last_choice < lbSize _ctrl_grp_fac); - _last_choice = [0,_last_choice] select (_last_choice isEqualType 0); + _ctrlGrpFac lbAdd _x; + } forEach (Achilles_var_nestedList_groupFactions select _sideId); + _lastChoice = [(lbSize _ctrlGrpFac) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlGrpFac); + _lastChoice = [0,_lastChoice] select (_lastChoice isEqualType 0); }; - _ctrl_grp_fac lbSetCurSel _last_choice; + _ctrlGrpFac lbSetCurSel _lastChoice; }; case "VEHICLE_CATEGORY": { - private _ctrl_side = _dialog displayCtrl IDC_COMBO_SIDE; - private _side_id = lbCurSel _ctrl_side; - private _ctrl_veh_fac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; - private _faction_id = lbCurSel _ctrl_veh_fac; + private _ctrlSide = _dialog displayCtrl IDC_COMBO_SIDE; + private _sideId = lbCurSel _ctrlSide; + private _ctrlVehFac = _dialog displayCtrl IDC_COMBO_VEHICLE_FACTION; + private _faction_id = lbCurSel _ctrlVehFac; - private _ctrl_veh = _dialog displayCtrl IDC_COMBO_VEHICLE; - lbClear _ctrl_veh; + private _ctrlVeh = _dialog displayCtrl IDC_COMBO_VEHICLE; + lbClear _ctrlVeh; { - private _lb_id = _ctrl_veh lbAdd getText (configFile >> "CfgVehicles" >> _x >> "displayName"); - _ctrl_veh lbSetData [_lb_id, _x]; - _ctrl_veh lbSetTextRight [_lb_id, ["(", (([_x, true] call BIS_fnc_crewCount) - ([_x, false] call BIS_fnc_crewCount)), ") "] joinString ""]; - } forEach (Achilles_var_nestedList_vehicles select _side_id select _faction_id select _comboIndex); - private _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_3", ""]; - _last_choice = [(lbSize _ctrl_veh) - 1, _last_choice] select (_last_choice < lbSize _ctrl_veh); - _last_choice = [0,_last_choice] select (_last_choice isEqualType 0); - _ctrl_veh lbSetCurSel _last_choice; + private _lb_id = _ctrlVeh lbAdd getText (configFile >> "CfgVehicles" >> _x >> "displayName"); + _ctrlVeh lbSetData [_lb_id, _x]; + _ctrlVeh lbSetTextRight [_lb_id, ["(", (([_x, true] call BIS_fnc_crewCount) - ([_x, false] call BIS_fnc_crewCount)), ") "] joinString ""]; + } forEach (Achilles_var_nestedList_vehicles select _sideId select _faction_id select _comboIndex); + private _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_3", ""]; + _lastChoice = [(lbSize _ctrlVeh) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlVeh); + _lastChoice = [0,_lastChoice] select (_lastChoice isEqualType 0); + _ctrlVeh lbSetCurSel _lastChoice; }; case "VEHICLE": { - if ((_ctrl lbData _comboIndex) isKindOf "Air") then + private _vehicleClass = _ctrl lbData _comboIndex; + if (_vehicleClass isKindOf "Air") then { - _ctrl = _dialog displayCtrl IDC_COMBO_WP_TYPE; - _ctrl ctrlSetFade 0; - _ctrl ctrlEnable true; - _ctrl ctrlCommit 0; - - _ctrl = _dialog displayCtrl IDC_COMBO_WP_TYPE_LABEL; - _ctrl ctrlSetFade 0; - _ctrl ctrlCommit 0; + private _ctrlWpTypeLabel = _dialog displayCtrl IDC_COMBO_WP_TYPE_LABEL; + _ctrlWpTypeLabel ctrlSetFade 0; + _ctrlWpTypeLabel ctrlCommit 0; + + private _ctrlWpType = _dialog displayCtrl IDC_COMBO_WP_TYPE; + _ctrlWpType ctrlSetFade 0; + _ctrlWpType ctrlEnable true; + _ctrlWpType ctrlCommit 0; + + // Add/remove HALO option + if (_vehicleClass isKindOf "Plane") then + { + if (lbSize _ctrlWpType == 3) then {_ctrlWpType lbAdd localize "STR_AMAE_HALO"}; + } + else + { + if (lbSize _ctrlWpType == 4) then {_ctrlWpType lbDelete 3}; + }; - _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_6", 0]; - _last_choice = [0, _last_choice] select (_last_choice isEqualType 0); - _last_choice = [(lbSize _ctrl) - 1, _last_choice] select (_last_choice < lbSize _ctrl); - _ctrl lbSetCurSel _last_choice; + _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_6", 0]; + _lastChoice = [0, _lastChoice] select (_lastChoice isEqualType 0); + _lastChoice = [(lbSize _ctrlWpType) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlWpType); + _ctrlWpType lbSetCurSel _lastChoice; } else { { - _ctrl = _dialog displayCtrl _x; - _ctrl ctrlSetFade 0.8; - _ctrl ctrlEnable false; - _ctrl ctrlCommit 0; + private _ctrlWpType = _dialog displayCtrl _x; + _ctrlWpType ctrlSetFade 0.8; + _ctrlWpType ctrlEnable false; + _ctrlWpType ctrlCommit 0; } forEach [IDC_COMBO_WP_TYPE,IDC_COMBO_WP_TYPE_LABEL]; }; }; case "GROUP_FACTION": { - private _ctrl_side = _dialog displayCtrl IDC_COMBO_SIDE; - private _side_id = lbCurSel _ctrl_side; - private _ctrl_grp = _dialog displayCtrl IDC_COMBO_GROUP; + private _ctrlSide = _dialog displayCtrl IDC_COMBO_SIDE; + private _sideId = lbCurSel _ctrlSide; + private _ctrlGrp = _dialog displayCtrl IDC_COMBO_GROUP; - lbClear _ctrl_grp; + lbClear _ctrlGrp; { - private _lb_id = _ctrl_grp lbAdd getText (_x >> "Name"); - _ctrl_grp lbSetTextRight [_lb_id, "(" + str count (_x call Achilles_fnc_returnChildren) + ") "]; - } forEach (Achilles_var_nestedList_groups select _side_id select _comboIndex); - private _last_choice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_8", 0]; - _last_choice = [(lbSize _ctrl_grp) - 1, _last_choice] select (_last_choice < lbSize _ctrl_grp); - _last_choice = [0,_last_choice] select (_last_choice isEqualType 0); - _ctrl_grp lbSetCurSel _last_choice; + private _lb_id = _ctrlGrp lbAdd getText (_x >> "Name"); + _ctrlGrp lbSetTextRight [_lb_id, "(" + str count (_x call Achilles_fnc_returnChildren) + ") "]; + } forEach (Achilles_var_nestedList_groups select _sideId select _comboIndex); + private _lastChoice = uiNamespace getVariable ["Ares_ChooseDialog_ReturnValue_8", 0]; + _lastChoice = [(lbSize _ctrlGrp) - 1, _lastChoice] select (_lastChoice < lbSize _ctrlGrp); + _lastChoice = [0,_lastChoice] select (_lastChoice isEqualType 0); + _ctrlGrp lbSetCurSel _lastChoice; }; case "GROUP": { diff --git a/@AresModAchillesExpansion/changelog.md b/@AresModAchillesExpansion/changelog.md index 34303491..ab9d0bd3 100644 --- a/@AresModAchillesExpansion/changelog.md +++ b/@AresModAchillesExpansion/changelog.md @@ -15,13 +15,20 @@ Our versioning follows the guidelines set by [Semantic Versioning 2.0](https://s ##### New * Advanced Hint (= readded vanilla training hint module). #294 ##### Revised -* Artillery Fire Mission +* Artillery Fire Mission: - Feature: Precision option. #321 * CAS - Bomb Strike - Fix: Was terribly inaccurate even for vanilla planes. #314 -* Damage Buildings +* Damage Buildings: - Fix: Did not work on certain dedicated servers. #303 -* Copy Mission SQF +* Spawn units (reinforcement): + - Fix: Armed aircrafts were distracted by enemies. + - Fix: Some CUP planes did not work (started on the floor rather than in air). + - Feature: HALO option for planes. +* Teleport Player: + - Feature: Additional Option: none, include vehicle or HALO (new). + - Note: HALO will move the player 3000 m above the location, move his backpack ventral and add a chute. +* Copy Mission SQF: - Fix: Minor script error. #185 #### Attribute windows ##### Revised @@ -30,9 +37,10 @@ Our versioning follows the guidelines set by [Semantic Versioning 2.0](https://s - Fix: Undefined variable error (by @DeliciousJaffa). #311 #### Waypoints ##### Revised -* Paradrop (also applies to the key-binding) +* Paradrop (also applies to the key-binding and reinforcement module) - Fix: Chute openning animation is smoother. #321 - - Change: Paradroopers won't open their chute immediately at high altitude (>150 m) => HALO. #321 + - Feature: AI accounts to a certain extend for paradrop displacment according to [fitted functions](https://gyazo.com/32afcfefef24ba2cdc36eaa4c0467147). + - Change: Paradroopers won't open their chute immediately at high altitude (>120 m) => HALO. #321 #### Settings ##### Revised * Faction filter