-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HALO #324
Merged
HALO #324
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
60764be
Fix backpack inventory duplication
Kexanone d0309f2
Improve paradrop accuracy
Kexanone d2910d3
Add HALO option for reinforcements
Kexanone a2b6559
Improved the fitted function for HALO
Kexanone fc56fd9
Fix error in function for HALO parameter
Kexanone e9e1566
More frequent checking time for height, since 1 sec can make a lot of…
Kexanone 21d9365
Achilles_fnc_chute: Add default value for delay and reset chute deplo…
Kexanone 9679e05
Reinforcement: Set aircraft to carless, restrict HALO for planes only
Kexanone b322950
Add HALO option to teleport module
Kexanone 65d1111
Address point in review
Kexanone 2514583
Address points in review (part 2)
Kexanone 8ff61bb
update change log
Kexanone 07fb08c
Reinforcment: Fix CUP planes
Kexanone 9ad691d
Achilles_fnc_chute: change chute deployment height to 120m
Kexanone d4cafda
Update changelog.md
Kexanone 7afbeeb
Use proper syntax for link in changlog
Kexanone 1283c03
Merge branch 'master' into HALO
Kexanone 67168aa
Remove the extra space in the changelog
Kexanone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,8 @@ 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 | ||
|
@@ -65,30 +66,51 @@ if (_vehsType isKindOf "Helicopter") then | |
_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; | ||
|
||
// 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,_wp_pos,_radius] spawn | ||
{ | ||
params ["_vehsGroup", "_wp_pos", "_radius"]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. camelCase |
||
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 _wp_pos < _radius) exitWith | ||
{ | ||
[_vehsGroup] call Achilles_fnc_eject_passengers; | ||
_vehsRdy = true; | ||
}; | ||
} forEach (_vehsGroup select {alive _x}); | ||
|
||
if (_aliveCount == 0) then {_vehsRdy = true}; | ||
sleep 1; | ||
_vehsRdy; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ private _dialogResult = | |
["COMBOBOX", localize "STR_AMAE_VEHICLE", [], 0, false, [["LBSelChanged","VEHICLE"]]], | ||
["COMBOBOX", localize "STR_AMAE_VEHICLE_BEHAVIOUR", [localize "STR_AMAE_RTB_DESPAWN", localize "STR_AMAE_STAY_AT_LZ"]], | ||
["COMBOBOX", localize "STR_AMAE_LZ_DZ", _lzOptions], | ||
["COMBOBOX", localize "STR_AMAE_TYPE",[localize "STR_A3_CfgWaypoints_Land",localize "STR_AMAE_FASTROPING",localize "STR_AMAE_PARADROP"]], | ||
["COMBOBOX", localize "STR_AMAE_TYPE",[localize "STR_A3_CfgWaypoints_Land",localize "STR_AMAE_FASTROPING",localize "STR_AMAE_PARADROP",localize "STR_AMAE_HALO"]], | ||
["COMBOBOX", [localize "STR_AMAE_GROUP", localize "STR_AMAE_FACTION"] joinString " ", [], 0, false, [["LBSelChanged","GROUP_FACTION"]]], | ||
["COMBOBOX", localize "STR_AMAE_INFANTRY_GROUP", [], 0, false, [["LBSelChanged","GROUP"]]], | ||
["COMBOBOX", localize "STR_AMAE_UNIT_RP", _rpOptions], | ||
|
@@ -162,46 +162,15 @@ private _rpSize = 20; // TODO make this a dialog parameters? | |
private _lzLogic = [_spawn_position, _allLzLogics, _lzdz_algorithm] call Achilles_fnc_logicSelector; | ||
private _lzPos = position _lzLogic; | ||
|
||
// Adjust spawn position for HALO | ||
if (_lzdz_type isEqualTo 3) then {_spawn_position set [2, 3000]}; | ||
|
||
// 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"; | ||
}; | ||
|
||
// 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 | ||
{ | ||
// 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 | ||
}; | ||
_vehicleInfo params ["_vehicle", "", "_vehicleGroup"]; | ||
|
||
// 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 altitude for HALO | ||
if (_lzdz_type isEqualTo 3) then {_vehicle flyInHeight 3000}; | ||
|
||
// Add vehicle to curator | ||
[[_vehicle]] call Ares_fnc_AddUnitsToCurator; | ||
|
@@ -260,6 +229,45 @@ 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 (_lzdz_type > 0)) then | ||
{ | ||
_vehicleUnloadWp setWaypointType "SCRIPTED"; | ||
private _script = ["\achilles\functions_f_achilles\scripts\fn_wpParadrop.sqf", "\achilles\functions_f_achilles\scripts\fn_wpFastrope.sqf"] select (_lzdz_type isEqualTo 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Multiple lines |
||
_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 (leader _vehicleGroup))) setSkill 1; | ||
|
||
if (_vehicle_type 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 (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;"]; | ||
}; | ||
|
||
// print a confirmation | ||
[localize "STR_AMAE_REINFORCEMENT_DISPATCHED"] call Ares_fnc_showZeusMessage; | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing