-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e7104d
commit bf29a1e
Showing
2 changed files
with
69 additions
and
0 deletions.
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
67 changes: 67 additions & 0 deletions
67
cScripts/functions/systems/fn_training_addTargetComputer.sqf
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Author: SGT.Brostrom.A | ||
* This function allow you to keep targets down as well as resetting the targets | ||
* | ||
* Arguments: | ||
* 0: resetButtonObject <OBJECT> | ||
* 1: listOfTargets <ARRAY> | ||
* 1: actionCaption <STRING> (Optional) | ||
* | ||
* Example: | ||
* [this, [MyTargetVariableName], "Reset Range Targets"] call cScripts_fnc_training_addTargetComputer; | ||
* [this, [T1,T2,T3,T4]] call cScripts_fnc_training_addTargetComputer; | ||
*/ | ||
|
||
params [ | ||
["_object", objNull, [objNull]], | ||
["_targets",[], [[]]], | ||
["_action", "Reset Range Targets", [""]] | ||
]; | ||
|
||
{ | ||
diag_log _x; | ||
_x setVariable ["BIS_poppingEnabled", false]; | ||
_x setVariable ["BIS_isPopping", false]; | ||
_x addEventHandler ["HitPart", { | ||
(_this select 0) params ["_target"]; | ||
|
||
_target setVariable ["nopop", true]; | ||
|
||
_target setVariable ["BIS_isLeaning", false]; | ||
_target setVariable ["BIS_leaningEnabled", false]; | ||
private _rpm = _target getVariable ["BIS_rpm", 6]; | ||
_target animate [format ["Swivel_%1rpm_rot", _rpm], _target animationPhase (format ["Swivel_%1rpm_rot", _rpm])]; | ||
_target setVariable ["BIS_isPopping", false]; | ||
|
||
_target animate ["Terc", 1]; | ||
|
||
}]; | ||
} forEach _targets; | ||
|
||
[ | ||
_object, | ||
_action, | ||
"", "", | ||
"true", "true", | ||
{}, | ||
{}, | ||
{ | ||
params ["", "", "", "_arguments"]; | ||
_arguments params ["_targets"]; | ||
{ | ||
_x setVariable ["nopop", nil]; | ||
|
||
_x setVariable ["BIS_isLeaning", _x getVariable ["BIS_leaningEnabled", false]]; | ||
_x setVariable ["BIS_poppingEnabled", false]; | ||
_x setVariable ["BIS_isPopping", false]; | ||
_x animate ["terc", 0]; | ||
|
||
_x setVariable ["BIS_leaningEnabled", true]; | ||
if (_x getVariable ["BIS_leaningEnabled", false]) then { | ||
_x animate [_x getVariable ["BIS_animName", "Swivel_6rpm_rot"], _x getVariable ["BIS_animPhaseTarget", _x animationPhase (_x getVariable ["BIS_animName", "Swivel_6rpm_rot"])]]; | ||
}; | ||
} forEach _targets; | ||
}, | ||
{}, | ||
[_targets], 0, nil, false, false | ||
] call BIS_fnc_holdActionAdd; |