Skip to content

Commit 0697d2d

Browse files
committed
v1.1.7
1 parent 40e2f1f commit 0697d2d

File tree

12 files changed

+123
-117
lines changed

12 files changed

+123
-117
lines changed

@AIO_SPPack/addons/AIO_AIMENU.pbo

418 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

@AIO_SPPack/addons/AIO_AIMENU/XEH_preInit.sqf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ if !(AIO_enableMod) exitWith {};
135135
private _menu = commandingMenu;
136136
if (_menu == "RscGroupRootMenu" || {_menu == "" && {count (groupSelectedUnits player) != 0}}) then {[] spawn {sleep 0.001; showCommandingMenu "#USER:AIO_action_subMenu"}};
137137
}, {true}, [7, [false, false, false]], false] call CBA_fnc_addKeybind;
138-
139138
["All-In-One Custom Menus","AIO_AIMENU_menu8", ["Formation Menu", "Customized vanilla Formation Menu. Unbind this key to disable this feature."], {
140139
private _menu = commandingMenu;
141140
if (_menu == "RscGroupRootMenu" || {_menu == "" && {count (groupSelectedUnits player) != 0}}) then {[] spawn {sleep 0.001; showCommandingMenu "AIO_formationSubMenu"}};
142141
}, {true}, [9, [false, false, false]], false] call CBA_fnc_addKeybind;
143-
142+
["All-In-One Custom Menus","AIO_AIMENU_LIST", "List all menus", {
143+
if (commandingMenu == "#USER:AIO_command_subMenus") then {showCommandingMenu ""} else {[] spawn {sleep 0.001; showCommandingMenu "#USER:AIO_command_subMenus"}}
144+
}, "", [], false] call CBA_fnc_addKeybind;
145+
144146
["All-In-One Command Menu","AIO_AIMENU_FireOnMyLead", "Fire On My Lead", {
145147
if (player != leader player) exitWith {};
146148
_units = groupSelectedUnits player;
0 Bytes
Binary file not shown.

@AIO_SPPack/addons/AIO_AIMENU/functions/driver/fn_analyzeHeli.sqf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ _bladeCenter = _bladeCenter vectorDiff [0,0,0.25];
9191
_bladeR = _bladeCenter vectorAdd [_bladeRadius, 0, 0];
9292
_bladeL = _bladeCenter vectorAdd [-_bladeRadius, 0, 0];
9393
_bladeF = _bladeCenter vectorAdd [0, _bladeRadius, 0];
94-
_bladeFL = (_bladeL vectorAdd _bladeF) apply {_x/2};
95-
_bladeFR = (_bladeR vectorAdd _bladeF) apply {_x/2};
94+
_bladeFL = (_bladeL vectorAdd _bladeF) vectorMultiply 0.5;
95+
_bladeFR = (_bladeR vectorAdd _bladeF) vectorMultiply 0.5;
9696
deleteVehicle _tempVeh;
9797

9898
_center = +_bladeCenter;
@@ -101,7 +101,7 @@ _front = +_bladeF;
101101
_center set [2, _bottomHeight];
102102
_front set [2, _bottomHeight];
103103

104-
_center = ((_front vectorAdd _center) vectorAdd _tail) apply {_x/3};
104+
_center = ((_front vectorAdd _center) vectorAdd _tail) vectorMultiply 1/3;
105105

106106
_veh setVariable ["AIO_sensitivePoints", [_bladeF, _bladeL, _bladeR,_tail]];
107107
_veh setVariable ["AIO_skidPoints", [_center, _skidL1, _skidR1]];

@AIO_SPPack/addons/AIO_AIMENU/functions/driver/fn_helicopterMechanics.sqf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
["AIO_helicopter_control", "onEachFrame", {
2-
if (!isNull (findDisplay 49) && {time - (missionNamespace getVariable ["AIO_lastMissionTime", 0]) == 0}) exitWith {};
3-
missionNamespace setVariable ["AIO_lastMissionTime", time];
2+
if (isGamePaused) exitWith {};
3+
44
{
55
_veh = _x;
66
_driver = driver _veh;
@@ -46,7 +46,7 @@
4646
_VDIR = vectorDir _veh;
4747
_diff = _PB vectorDiff _VUP;
4848

49-
_newVUP = _VUP vectorAdd (_diff apply {_controlCoeff*1.5*_acc*_x/_fps});
49+
_newVUP = _VUP vectorAdd (_diff vectorMultiply _controlCoeff*1.5*_acc/_fps);
5050

5151

5252
//_bladeCenter = _veh modelToWorldVisual (_veh getVariable ["AIO_bladeCenter", [0,0,0]]);
@@ -58,7 +58,7 @@
5858

5959
_maxSpeed = _veh getVariable ["AIO_maxSpeed", 100];
6060

61-
_velocity = _velocity vectorAdd ((_newVUP vectorDiff (_velocity apply {_x/_maxSpeed/4})) apply {_weightCoeff*_x/_fps*15});
61+
_velocity = _velocity vectorAdd ((_newVUP vectorDiff (_velocity vectorMultiply 1/_maxSpeed/4)) vectorMultiply _weightCoeff/_fps*15);
6262

6363
_turn = 1;
6464

@@ -116,7 +116,7 @@
116116
if !(_veh getVariable ["AIO_disableControls", false]) then {
117117
_veh setVectorDir ([_VDIR, -_newDir*_acc] call BIS_fnc_rotateVector2D);
118118
_veh setVectorUp _newVUP;
119-
_veh setPosWorld ((getPosWorld _veh) vectorAdd (_velocity apply {_acc*_x/_fps}));
119+
_veh setPosWorld ((getPosWorldVisual _veh) vectorAdd (_velocity vectorMultiply _acc/_fps));
120120
_veh setVelocity _velocity;
121121
};
122122

@AIO_SPPack/addons/AIO_AIMENU/functions/driver/fn_pilotLoop.sqf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
waitUntil {
2-
t_points10 = [];
2+
//t_points10 = [];
33
{
44
_veh = _x;
55

@@ -23,7 +23,7 @@ waitUntil {
2323

2424
_angle = _radius atan2 _dest;
2525

26-
_destination = (_center vectorAdd ([((vectorNormalized _diff) apply {_x*_radius}), -_loiter*180*20/3.14/_radius*(_veh getVariable ["AIO_forcePitchCoeff", 1])] call BIS_fnc_rotateVector2D))
26+
_destination = _center vectorAdd ([((vectorNormalized _diff) vectorMultiply _radius), -_loiter*180*20/3.14/_radius*(_veh getVariable ["AIO_forcePitchCoeff", 1])] call BIS_fnc_rotateVector2D);
2727

2828
//(_center vectorAdd ([((vectorNormalized _diff) apply {_x*_requiredRadius}), -_loiter*_angle] call BIS_fnc_rotateVector2D))
2929
} else {
@@ -65,7 +65,7 @@ waitUntil {
6565
{
6666
_p1 = _veh modelToWorldWorld _x;
6767
_p2 = _p1 vectorAdd _velocity2;
68-
t_points10 pushBack [_p1,_p2];
68+
//t_points10 pushBack [_p1,_p2];
6969
_intersect = lineIntersectsSurfaces [_p1, _p2, _veh, getSlingLoad _veh, false, 1,"GEOM","FIRE"];
7070
_contacts append _intersect;
7171
} forEach _sensitivePoitns;
@@ -77,7 +77,7 @@ waitUntil {
7777
{
7878
_p1 = _veh modelToWorldWorld _x;
7979
_p2 = _p1 vectorAdd _velocity1;
80-
t_points10 pushBack [_p1,_p2];
80+
//t_points10 pushBack [_p1,_p2];
8181
_intersect = lineIntersectsSurfaces [_p1, _p2, _veh, getSlingLoad _veh, false, 1,"GEOM","FIRE"];
8282
_contacts1 append _intersect;
8383
} forEach _skids;
@@ -104,14 +104,14 @@ waitUntil {
104104
_normal = _firstContact select 1;
105105
_contact = _firstContact select 0;
106106
_contactDist = _pos distance _contact;
107-
_contact = _pos vectorAdd (_vecDir apply {_x*_contactDist});
107+
_contact = _pos vectorAdd (_vecDir vectorMultiply _contactDist);
108108
_vcos = abs(_normal vectorCos [0,0,1]);
109109
if (_vcos < 0.97) then {
110110
_diff = (1 - _vcos)*10;
111111
_normal = _normal vectorAdd [0,0,_diff];
112-
_normal = _normal apply {_x/(_diff+1)};
112+
_normal = _normal vectorMultiply (_diff+1);
113113
};
114-
_destination = _contact vectorAdd (_normal apply {_x*_flightHeight});
114+
_destination = _contact vectorAdd (_normal vectorMultiply _flightHeight);
115115
_collective = (([10, -10] select (_actualVZ > 0 && _speed < 10 && _hasIntersect1)) + (_veh getVariable ["AIO_collective", 0]))/2;
116116
_veh setVariable ["AIO_collective", _collective];
117117
_veh setVariable ["AIO_height", _flightHeight];
@@ -191,9 +191,9 @@ waitUntil {
191191
};
192192
};
193193

194-
if (_dist > 1) then {
194+
if (_dist + _speed > 1) then {
195195
_dir = ((_veh getVariable ["AIO_dir", 0]) + _turn*-1*(_angle min _dirFactor*5))/2;
196-
_veh setVariable ["AIO_dir", _dir]
196+
_veh setVariable ["AIO_dir", _dir];
197197
} else {
198198
_veh setVariable ["AIO_dir", 0];
199199
};

@AIO_SPPack/addons/AIO_AIMENU/functions/general/fn_exactPos.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _pos = ASLToAGL(getPosASLW _obj);
44

55
if (_correction != 0) then {
66
_vec = selectRandom [[1,0,0], [0,1,0], [-1,0,0], [0,-1,0]];
7-
_pos = _pos vectorAdd (_vec apply {_x*_correction});
7+
_pos = _pos vectorAdd (_vec vectorMultiply _correction);
88
};
99

1010
_pos

@AIO_SPPack/addons/AIO_AIMENU/functions/menu/fn_createTargetMenu.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ _targets = [_targets,[],{player distance _x},"ASCEND"] call BIS_fnc_sortBy;
1818
{
1919
if ([position player, getdir player, 75, position _x] call BIS_fnc_inAngleSector) then {
2020
_eyepos = eyePos player;
21-
_averagePos = (AGLtoASL (_x modelToWorldVisual (_x selectionPosition "pilot")) apply {_x*0.7}) vectorAdd ((getPosASL _x) apply {_x*0.3});
21+
_averagePos = (AGLtoASL (_x modelToWorldVisual (_x selectionPosition "pilot")) vectorMultiply 0.7) vectorAdd ((getPosASL _x) vectorMultiply 0.3);
2222
_l = lineIntersectsSurfaces [_eyepos, _averagePos, _x, player, true, 1,"VIEW","NONE"];
2323
if (count _l > 0) exitWith {AIO_secondaryTargets pushBack _x};
2424
AIO_primaryTargets pushBack _x;
Lines changed: 95 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,114 @@
11
waitUntil {
2-
{
3-
_animation = _x getVariable ["AIO_animation", [[], [], [], [],3+time]];
4-
_animation params ["_positions", "_finalDirection", ["_customCondition", []], ["_customAnimation", []], "_finishTime"]; //_positions: positions to pass through;
5-
_condFail = (vehicle _x != _x || time > _finishTime);
6-
_condSuccess = true;
7-
_codeFail = {};
8-
_codeSuccess = {};
9-
_params = [];
10-
if !(_customCondition isEqualTo []) then {
11-
_params = _customCondition select 4;
12-
_condFail = _condFail || (_params call (_customCondition select 0));
13-
_codeFail = _customCondition select 1;
14-
_condSuccess = _params call (_customCondition select 2);
15-
_codeSuccess = _customCondition select 3;
16-
};
17-
if (_condFail) then {
18-
_x enableAI "MOVE";
19-
_params call _codeFail;
20-
AIO_animatedUnits = AIO_animatedUnits - [_x];
21-
} else {
22-
_x disableAI "MOVE";
23-
_x doWatch objNull;
24-
if !(_positions isEqualTo []) then {
25-
_currentPos = getPosWorld _x;
26-
_nextPos = _positions select 0;
27-
_x moveTo _nextPos;
28-
if (_currentPos distance2D _nextPos < ((((speed _x)/7.2) min 2) max 1)) then { //_unit has reached the position
29-
((_x getVariable ["AIO_animation", [[], []]]) select 0) deleteAt 0;
30-
} else {
31-
_dir = 1; //used only for backward move, such as dragging
32-
if (_customAnimation isEqualTo []) then {
33-
_x playActionNow "SlowF";
2+
if (isGamePaused) then {
3+
{
4+
_animation = _x getVariable ["AIO_animation", [[], [], [], [],3+time]];
5+
_animation params ["_positions", "_finalDirection", ["_customCondition", []], ["_customAnimation", []], "_finishTime"]; //_positions: positions to pass through;
6+
_condFail = (vehicle _x != _x || time > _finishTime);
7+
_condSuccess = true;
8+
_codeFail = {};
9+
_codeSuccess = {};
10+
_params = [];
11+
if !(_customCondition isEqualTo []) then {
12+
_params = _customCondition select 4;
13+
_condFail = _condFail || (_params call (_customCondition select 0));
14+
_codeFail = _customCondition select 1;
15+
_condSuccess = _params call (_customCondition select 2);
16+
_codeSuccess = _customCondition select 3;
17+
};
18+
if (_condFail) then {
19+
_x enableAI "MOVE";
20+
_params call _codeFail;
21+
AIO_animatedUnits = AIO_animatedUnits - [_x];
22+
} else {
23+
_x disableAI "MOVE";
24+
_x doWatch objNull;
25+
if !(_positions isEqualTo []) then {
26+
_currentPos = getPosWorld _x;
27+
_nextPos = _positions select 0;
28+
_x moveTo _nextPos;
29+
if (_currentPos distance2D _nextPos < ((((speed _x)/7.2) min 2) max 1)) then { //_unit has reached the position
30+
((_x getVariable ["AIO_animation", [[], []]]) select 0) deleteAt 0;
3431
} else {
35-
_customAnimation params ["_anim", "_reverse"];
36-
_dir = _reverse;
37-
_x playMoveNow _anim;
38-
};
39-
40-
//this part rotates the unit
41-
_watchDir = _nextPos vectorDiff _currentPos;
42-
_watchDir set [2,0];
43-
_watchDir = (vectorNormalized _watchDir) apply {_x*_dir};
44-
if (_watchDir isEqualTo [0,0,0]) then {_watchDir = [0,1,0]};
45-
_vecDir = vectorDir _x;
46-
_accTime = accTime;
47-
_angle = _accTime * acos(_vecDir vectorCos _watchDir);
48-
_turn = 1;
49-
if (_angle > 0) then {
50-
_turn = [-_accTime,_accTime] select (((_x getRelDir _nextPos) + -180*(_dir - 1)/2) mod 360 > 180);
51-
52-
if (_angle > 5 * _accTime) then {
53-
_newDir = [_vecDir, 5*_turn] call BIS_fnc_rotateVector2D;
54-
_x setVectorDir _newDir;
32+
_dir = 1; //used only for backward move, such as dragging
33+
if (_customAnimation isEqualTo []) then {
34+
_x playActionNow "SlowF";
5535
} else {
56-
_x setVectorDir _watchDir;
36+
_customAnimation params ["_anim", "_reverse"];
37+
_dir = _reverse;
38+
_x playMoveNow _anim;
5739
};
58-
};
59-
};
60-
} else {
61-
if (_customAnimation isEqualTo []) then {
62-
if !(_condSuccess) exitWith {};
63-
if (_finalDirection isEqualTo []) exitWith {
64-
_x enableAI "MOVE";
65-
_params call _codeSuccess;
66-
AIO_animatedUnits = AIO_animatedUnits - [_x];
67-
};
68-
if (_finalDirection isEqualTo [0,0,0]) then {_finalDirection = [0,1,0]};
69-
_vecDir = vectorDir _x;
70-
_angle = acos(_vecDir vectorCos _finalDirection);
71-
if (_angle > 0) then {
40+
41+
//this part rotates the unit
42+
_watchDir = _nextPos vectorDiff _currentPos;
43+
_watchDir set [2,0];
44+
_watchDir = (vectorNormalized _watchDir) vectorMultiply _dir;
45+
if (_watchDir isEqualTo [0,0,0]) then {_watchDir = [0,1,0]};
46+
_vecDir = vectorDir _x;
47+
_accTime = accTime;
48+
_angle = _accTime * acos(_vecDir vectorCos _watchDir);
7249
_turn = 1;
73-
_vecDirX = _vecDir select 0;
74-
_vecDirY = _vecDir select 1;
75-
_watchDirX = _finalDirection select 0;
76-
_watchDirY = _finalDirection select 1;
77-
if (_watchDirY*_vecDirY >= 0) then {
78-
if (_watchDirX >= _vecDirX) then {_turn = -1} else {_turn = 1};
79-
} else {
80-
if (_watchDirX*_vecDirX >= 0) then {if(_vecDirX >= 0) then {_turn = -1} else {_turn = 1}} else {
81-
if (abs(_watchDirX)<=abs(_vecDirX)) then {_turn = -1} else {_turn = 1};
82-
if(_vecDirX < 0) then {_turn =-1*_turn};
50+
if (_angle > 0) then {
51+
_turn = [-_accTime,_accTime] select (((_x getRelDir _nextPos) + -180*(_dir - 1)/2) mod 360 > 180);
52+
53+
if (_angle > 5 * _accTime) then {
54+
_newDir = [_vecDir, 5*_turn] call BIS_fnc_rotateVector2D;
55+
_x setVectorDir _newDir;
56+
} else {
57+
_x setVectorDir _watchDir;
8358
};
8459
};
85-
if (_vecDirY < 0) then {_turn =-1*_turn};
86-
if (_angle > 5) then {
87-
_newDir = [_vecDir, 5*_turn] call BIS_fnc_rotateVector2D;
88-
_x setVectorDir _newDir;
60+
};
61+
} else {
62+
if (_customAnimation isEqualTo []) then {
63+
if !(_condSuccess) exitWith {};
64+
if (_finalDirection isEqualTo []) exitWith {
65+
_x enableAI "MOVE";
66+
_params call _codeSuccess;
67+
AIO_animatedUnits = AIO_animatedUnits - [_x];
68+
};
69+
if (_finalDirection isEqualTo [0,0,0]) then {_finalDirection = [0,1,0]};
70+
_vecDir = vectorDir _x;
71+
_angle = acos(_vecDir vectorCos _finalDirection);
72+
if (_angle > 0) then {
73+
_turn = 1;
74+
_vecDirX = _vecDir select 0;
75+
_vecDirY = _vecDir select 1;
76+
_watchDirX = _finalDirection select 0;
77+
_watchDirY = _finalDirection select 1;
78+
if (_watchDirY*_vecDirY >= 0) then {
79+
if (_watchDirX >= _vecDirX) then {_turn = -1} else {_turn = 1};
80+
} else {
81+
if (_watchDirX*_vecDirX >= 0) then {if(_vecDirX >= 0) then {_turn = -1} else {_turn = 1}} else {
82+
if (abs(_watchDirX)<=abs(_vecDirX)) then {_turn = -1} else {_turn = 1};
83+
if(_vecDirX < 0) then {_turn =-1*_turn};
84+
};
85+
};
86+
if (_vecDirY < 0) then {_turn =-1*_turn};
87+
if (_angle > 5) then {
88+
_newDir = [_vecDir, 5*_turn] call BIS_fnc_rotateVector2D;
89+
_x setVectorDir _newDir;
90+
} else {
91+
_x setVectorDir _finalDirection;
92+
};
8993
} else {
90-
_x setVectorDir _finalDirection;
94+
if (_condSuccess) then {
95+
_x enableAI "MOVE";
96+
_params call _codeSuccess;
97+
AIO_animatedUnits = AIO_animatedUnits - [_x];
98+
};
9199
};
92100
} else {
93-
if (_condSuccess) then {
101+
if (_condSuccess) exitWith {
94102
_x enableAI "MOVE";
95103
_params call _codeSuccess;
96104
AIO_animatedUnits = AIO_animatedUnits - [_x];
97105
};
106+
_anim = _customAnimation select 0;
107+
_x playMoveNow _anim;
98108
};
99-
} else {
100-
if (_condSuccess) exitWith {
101-
_x enableAI "MOVE";
102-
_params call _codeSuccess;
103-
AIO_animatedUnits = AIO_animatedUnits - [_x];
104-
};
105-
_anim = _customAnimation select 0;
106-
_x playMoveNow _anim;
107109
};
108110
};
109-
};
110-
} forEach AIO_animatedUnits;
111+
} forEach AIO_animatedUnits;
112+
};
111113
false
112114
};

0 commit comments

Comments
 (0)