Skip to content

Commit bc9ef6e

Browse files
authored
Added new option: sprint mode & added sounds
1 parent 2884cf0 commit bc9ef6e

File tree

2 files changed

+90
-6
lines changed

2 files changed

+90
-6
lines changed

addons/AIO_AIMENU/Menus.sqf

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,17 @@ AIO_defRadius_subMenu =
127127
AIO_defense_subMenu =
128128
[
129129
["Defense",true],
130-
["Take Cover", [2], "", -5, [["expression", "[(groupSelectedUnits player), 30, 0] execVM ""AIO_AIMENU\moveToCover.sqf"" "]], "1", "1"],
130+
["Take Cover", [2], "", -5, [["expression", "
131+
[(groupSelectedUnits player), 30, 0] execVM ""AIO_AIMENU\moveToCover.sqf"";
132+
if (AIO_useVoiceChat) then {
133+
[] spawn {
134+
private _dummy = ""#particlesource"" createVehicleLocal ASLToAGL getPosWorld player;
135+
_dummy say2D 'AIO_say_TakeCover';
136+
sleep 2;
137+
deleteVehicle _dummy;
138+
};
139+
};
140+
"]], "1", "1"],
131141
["360 Formation *", [3], "", -5, [["expression", "
132142
AIO_selectedUnits = groupSelectedUnits player;
133143
[AIO_selectedUnits, screenToWorld [0.5, 0.5], 1] execVM ""AIO_AIMENU\cursorTargetCheck.sqf"" "]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
@@ -138,8 +148,9 @@ AIO_defense_subMenu =
138148

139149
AIO_limitSpeed1_subMenu =
140150
[
141-
["Limit Unit Speed",true],
142-
["Unlimited", [], "", -5, [["expression", "[(groupSelectedUnits player), -1] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
151+
["Set Unit Speed",true],
152+
["Sprint Mode", [2], "#USER:AIO_sprintMenu", -5, [["expression", ""]], "1", "1"],
153+
["Auto", [3], "", -5, [["expression", "[(groupSelectedUnits player), -1] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
143154
["1 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 1] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
144155
["5 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 5] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
145156
["10 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 10] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
@@ -150,12 +161,12 @@ AIO_limitSpeed1_subMenu =
150161
["35 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 35] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
151162
["40 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 40] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
152163
["45 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 45] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
153-
["50 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 50] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
154164
["More", [], "#USER:AIO_limitSpeed2_subMenu", -5, [["expression", ""]], "1", "1"]
155165
];
156166
AIO_limitSpeed2_subMenu =
157167
[
158168
["Limit Unit Speed",true],
169+
["50 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 50] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
159170
["55 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 55] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
160171
["60 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 60] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
161172
["65 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 65] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
@@ -164,7 +175,6 @@ AIO_limitSpeed2_subMenu =
164175
["80 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 80] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
165176
["85 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 85] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
166177
["90 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 90] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
167-
["95 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 95] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
168178
["100 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 100] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
169179
["150 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 150] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
170180
["200 m/s", [], "", -5, [["expression", "[(groupSelectedUnits player), 200] execVM ""AIO_AIMENU\limitSpeed.sqf"" "]], "1", "1"],
@@ -184,7 +194,8 @@ AIO_infantry_subMenu =
184194
["Clear Building", [7], "", -5, [["expression", "[(groupSelectedUnits player), cursorTarget] execVM ""AIO_AIMENU\clear_Building.sqf"" "]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
185195
["", [], "", -5, [["expression", ""]], "1", "0"],
186196
["Follow Target", [8], "", -5, [["expression", "[(groupSelectedUnits player), cursorTarget] execVM ""AIO_AIMENU\follow.sqf"" "]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
187-
["Limit Unit Speed", [9], "#USER:AIO_limitSpeed1_subMenu", -5, [["expression", ""]], "1", "1"]
197+
["Set Unit Speed", [9], "#USER:AIO_limitSpeed1_subMenu", -5, [["expression", ""]], "1", "1"],
198+
["Sprint Mode", [10], "#USER:AIO_sprintMenu", -5, [["expression", ""]], "1", "1"]
188199
];
189200

190201
AIO_switchseat_subMenu =
@@ -417,6 +428,13 @@ AIO_MENU_GroupCommunication1 =
417428
["Add/Refresh Zeus", [9], "", -5, [["expression", "[0] execVM ""AIO_AIMENU\zeus.sqf"" "]], "0", "1"]
418429
];
419430

431+
AIO_sprintMenu =
432+
[
433+
["Sprint Mode",true],
434+
["Enable", [2], "", -5, [["expression", "[(groupSelectedUnits player), 1] execVM ""AIO_AIMENU\sprintMode.sqf"" "]], "1", "1"],
435+
["Disable", [3], "", -5, [["expression", "[(groupSelectedUnits player), 0] execVM ""AIO_AIMENU\sprintMode.sqf"" "]], "1", "1"]
436+
];
437+
420438
if (AIO_Zeus_Enabled) then {(AIO_MENU_GroupCommunication select 13) set [5, "1"]};
421439
if !(AIO_use_HC_driver) then {
422440
(AIO_vehicle_subMenu select 12) set [0, "Create Driver"];
@@ -453,6 +471,9 @@ if (AIO_groupSelectedUnitsCnt == 0) then {
453471
(AIO_vehicle_subMenu select 1) set [2, "#USER:AIO_switchseat_subMenu_player"];
454472
};
455473
};
474+
(AIO_sprintMenu select 1) set [6, str (1-AIO_EnableSprintMode)];
475+
(AIO_sprintMenu select 2) set [6, str AIO_EnableSprintMode];
476+
456477

457478
if (AIO_groupSelectedUnitsCnt > 2 or AIO_groupSelectedUnitsCnt == 0) then {(AIO_infantry_subMenu select 4) set [6, "0"]};
458479
if (player != hcLeader group player) then {player hcSetGroup [group player]};

addons/AIO_AIMENU/sprintMode.sqf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
params ["_units", "_mode"];
2+
AIO_defaultStances = [""];
3+
AIO_EnableSprintMode = _mode;
4+
if (_mode == 1) then {
5+
if (count _units == 0) then {_units = (units group player) -[player]};
6+
AIO_sprintingUnits = _units select {vehicle _x == _x};
7+
if (count AIO_sprintingUnits != 0) then {player groupChat "Enabling Sprint Mode"};
8+
{
9+
_unit = _x;
10+
_unit limitSpeed 1;
11+
_unit selectWeapon (primaryWeapon _unit);
12+
sleep 0.1;
13+
_unit limitSpeed 1000;
14+
_EH = _unit addEventHandler ["AnimChanged",
15+
{
16+
_unitA = _this select 0;
17+
_animU = _this select 1;
18+
private _move = "";
19+
if (_animU == "amovpercmtacsraswrfldf") then {_unitA setVariable ["AIO_unitIsTurning", 1]} else {_unitA setVariable ["AIO_unitIsTurning", 0]};
20+
//without weapon
21+
if (_animU == "AmovPercMrunSnonWnonDf") then {_move = "AmovPercMevaSnonWnonDf"};
22+
if (_animU == "AmovPercMrunSnonWnonDfl") then {_move = "AmovPercMevaSnonWnonDfl"};
23+
if (_animU == "AmovPercMrunSnonWnonDfr") then {_move = "AmovPercMevaSnonWnonDfr"};
24+
25+
if (_animU == "AmovPknlMrunSnonWnonDf") then {_move = "AmovPknlMevaSnonWnonDf"};
26+
if (_animU == "AmovPknlMrunSnonWnonDfl") then {_move = "AmovPknlMevaSnonWnonDfl"};
27+
if (_animU == "AmovPknlMrunSnonWnonDfr") then {_move = "AmovPknlMevaSnonWnonDfr"};
28+
29+
if (_animU == "AmovPpneMrunSnonWnonDf") then {_move = "AmovPpneMsprSnonWnonDf"};
30+
31+
//with weapon
32+
if (_animU == "amovpercmrunsraswrfldf") then {_move = "amovpercmevasraswrfldf"};
33+
if (_animU == "amovpercmrunsraswrfldfr") then {_move = "amovpercmevasraswrfldfr"};
34+
if (_animU == "amovpercmrunsraswrfldfl") then {_move = "amovpercmevasraswrfldfl"};
35+
if (_animU == "amovpercmrunslowwrfldf") then {_move = "amovpercmevaslowwrfldf"};
36+
if (_animU == "amovpercmrunsraswrfldf_ldst") then {_move = "amovpercmevasraswrfldf"};
37+
//Crouch
38+
if (_animU == "amovpknlmrunsraswrfldf") then {_unitA playmove "amovpknlmevasraswrfldf"};
39+
if (_animU == "amovpknlmrunslowwrfldf") then {_unitA playmove "amovpknlmevaslowwrfldf"};
40+
//prone
41+
//if (_animU == "amovppnemrunslowwrfldf") then {_unitA playmove "amovppnemevaslowwrfldf"};
42+
//ready
43+
//if (_animU == "amovpercmtacsraswrfldf") then {_unitA playmove "amovpercmevasraswrfldf"};
44+
if (_move != "") then {
45+
[_unitA, _move] spawn {
46+
params ["_unitA", "_move"];
47+
sleep 0.5;
48+
private _var = _unitA getVariable "AIO_unitIsTurning";
49+
if (_var == 1) then {sleep 1};
50+
_unitA playMove _move;
51+
};
52+
};
53+
}];
54+
_unit setVariable ["AIO_SprintAnimChanged", _EH];
55+
} forEach AIO_sprintingUnits;
56+
} else {
57+
{
58+
_EH = _x getVariable "AIO_SprintAnimChanged";
59+
_x removeEventHandler ["AnimChanged", _EH];
60+
_x setVariable ["AIO_SprintAnimChanged", nil];
61+
} forEach AIO_sprintingUnits;
62+
AIO_sprintingUnits = [];
63+
};

0 commit comments

Comments
 (0)