Skip to content
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

Improved code quality for the the Halo and Line Jump script #1191

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion cScripts/functions/mission/fn_addHaloJump.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ params [
// Check so the options arent added twice.
if (!isNil {_vehicle getVariable QEGVAR(VehicleFunc,HaloAction)}) exitWith {SHOW_WARNING_1("HaloJump", "Aircraft halo jump setting already applied for %1.", _vehicle)};

private _conditionHoldAction = format ["((_target getCargoIndex player) != -1) && ((_target animationPhase 'ramp_bottom' > 0.64) or (_target animationPhase 'door_2_1' == 1) or (_target animationPhase 'door_2_2' == 1) or (_target animationPhase 'jumpdoor_1' == 1) or (_target animationPhase 'jumpdoor_2' == 1) or (_target animationPhase 'back_ramp_switch' == 1) or (_target animationPhase 'back_ramp_half_switch' == 1) or (_target doorPhase 'RearDoors' > 0.5) or (_target doorPhase 'Door_1_source' > 0.5) or (_target animationSourcePhase 'ramp_anim' > 0.5)) && ((getPosVisual _target) select 2 >= %1)", _minAltetude];
private _doors = tostring {
((_target animationPhase 'ramp_bottom' > 0.64) || // RHS_C130J
(_target animationPhase 'door_2_1' == 1) || // RHS_C130J
(_target animationPhase 'door_2_2' == 1) || // RHS_C130J
(_target animationPhase 'jumpdoor_1' == 1) ||
(_target animationPhase 'jumpdoor_2' == 1) ||
(_target animationPhase 'back_ramp_switch' == 1) ||
(_target animationPhase 'back_ramp_half_switch' == 1) ||
(_target doorPhase 'RearDoors' > 0.5) ||
(_target doorPhase 'Door_1_source' > 0.5) ||
(_target animationSourcePhase 'ramp_anim' > 0.5) ||
(_target animationPhase 'Ramp' < 0.5)) // TF373_RAF_HC5, TF373_SOAR_MH47G_No_Rear_Guns
};

private _conditionHoldAction = format ["((_target getCargoIndex player) != -1) && (%1) && ((getPosVisual _target) select 2 >= %2)", _doors, _minAltetude];

// Add hold action for jump
private _actionID = [
Expand Down
16 changes: 15 additions & 1 deletion cScripts/functions/mission/fn_addLineJump.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@ params [
// Check so the options arent added twice.
if (!isNil {_vehicle getVariable QEGVAR(VehicleFunc,JumpAction)}) exitWith {SHOW_WARNING_1("JumpAction", "Aircraft jump setting already applied for %1.", _vehicle)};

private _conditionHoldAction = format ["((_target getCargoIndex player) != -1) && ((_target animationPhase 'ramp_bottom' > 0.64) or (_target animationPhase 'door_2_1' == 1) or (_target animationPhase 'door_2_2' == 1) or (_target animationPhase 'jumpdoor_1' == 1) or (_target animationPhase 'jumpdoor_2' == 1) or (_target animationPhase 'back_ramp_switch' == 1) or (_target animationPhase 'back_ramp_half_switch' == 1) or (_target doorPhase 'RearDoors' > 0.5) or (_target doorPhase 'Door_1_source' > 0.5) or (_target animationSourcePhase 'ramp_anim' > 0.5) or (_target animationPhase 'Ramp' < 0.5)) && ((getPosVisual _target) select 2 >= %1) && ((getPosVisual _target) select 2 <= %2) && (speed _target <= %3)", _minAltetude, _maxAltetude, _maxSpeed];
private _doors = tostring {
((_target animationPhase 'ramp_bottom' > 0.64) || // RHS_C130J
(_target animationPhase 'door_2_1' == 1) || // RHS_C130J
(_target animationPhase 'door_2_2' == 1) || // RHS_C130J
(_target animationPhase 'jumpdoor_1' == 1) ||
(_target animationPhase 'jumpdoor_2' == 1) ||
(_target animationPhase 'back_ramp_switch' == 1) ||
(_target animationPhase 'back_ramp_half_switch' == 1) ||
(_target doorPhase 'RearDoors' > 0.5) ||
(_target doorPhase 'Door_1_source' > 0.5) ||
(_target animationSourcePhase 'ramp_anim' > 0.5) ||
(_target animationPhase 'Ramp' < 0.5)) // TF373_RAF_HC5, TF373_SOAR_MH47G_No_Rear_Guns
};

private _conditionHoldAction = format ["((_target getCargoIndex player) != -1) && (%1) && ((getPosVisual _target) select 2 >= %2) && ((getPosVisual _target) select 2 <= %3) && (speed _target <= %4)", _doors, _minAltetude, _maxAltetude, _maxSpeed];

// Add hold action for jump
private _actionID = [
Expand Down