Skip to content

Commit 6789ecc

Browse files
committed
v1.1.5
1 parent 0709d58 commit 6789ecc

37 files changed

+502
-199
lines changed

@AIO_SPPack/addons/AIO_AIMENU.pbo

162 KB
Binary file not shown.
562 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AIO_AIMENU

@AIO_SPPack/addons/AIO_AIMENU/cfgFunctions.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ class CfgFunctions
115115
class task_disassemble {};
116116
class task_resupply {};
117117
class task_rearm {};
118+
class task_assembleUAV {};
119+
class task_disassembleUAV {};
118120
};
119121
class unit_tasking
120122
{
@@ -150,6 +152,8 @@ class CfgFunctions
150152
class disassemble {};
151153
class assembleProxy {};
152154
class assembleStatic {};
155+
class assembleUAV {};
156+
class disassembleUAV {};
153157
};
154158
class unit_medical
155159
{
94 KB
Binary file not shown.

@AIO_SPPack/addons/AIO_AIMENU/config.cpp

Lines changed: 0 additions & 33 deletions
This file was deleted.

@AIO_SPPack/addons/AIO_AIMENU/functions/cheats/fn_fullHeal.sqf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ _units pushBack player;
1010
_unit setUnconscious false;
1111
_unit setCaptive false;
1212
_unit setDamage 0;
13-
(vehicle _unit) setDamage 0;
13+
_veh = vehicle _unit;
14+
if (_veh != _unit) then {
15+
_veh setDamage 0;
16+
_veh setFuel 1;
17+
};
1418
if (AIO_UseAceMedical) then {
1519
_unit setVariable ["ACE_MEDICAL_pain", 0, true];
1620
_unit setVariable ["ACE_MEDICAL_morphine", 0, true];

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,52 +59,54 @@ for "_i" from 0 to _size step _step1 do {
5959
};
6060
};
6161

62+
_contacts = [_contacts, [], {10*_x#1 + _x#2}, "ASCEND"] call BIS_fnc_sortBy; //tail is the first contact point
63+
_tail = _contacts select 0;
6264

63-
_tails = [_contacts select [0,3], [], {_x select 2}, "ASCEND"] call BIS_fnc_sortBy; //tail is the first contact point
64-
_tail = _tails select 0;
65-
66-
_contacts = [_contacts, [], {_x select 2}, "ASCEND"] call BIS_fnc_sortBy; //skid (or wheel) is at the bottom
67-
65+
_contacts = [_contacts, [], {-1*_x#1 + 5*_x#2}, "ASCEND"] call BIS_fnc_sortBy; //skid (or wheel) is at the bottom
6866
_skidL1 = _contacts select 0;
6967

70-
_skidL_H = _skidL1 select 2;
71-
72-
_contacts = _contacts select {abs(_skidL_H - (_x select 2)) <= 0.25 && {_x distance2D _skidL1 > 2}}; //find other skid points (or wheels)
73-
74-
_contacts = [_contacts, [], {_x select 1}, "ASCEND"] call BIS_fnc_sortBy;
75-
76-
_cnt = count _contacts;
68+
_avgX = 0;
69+
{
70+
_avgX = _avgX + (_x#0);
71+
} forEach _contacts;
7772

78-
_skidL2 = if (_cnt != 0) then {_contacts select _cnt-1} else {_skidL1};
73+
_contacts = [_contacts, [], {_x#0}, "ASCEND"] call BIS_fnc_sortBy; //skid (or wheel) is at the bottom
7974

80-
_SkidR1 = [-1*(_skidL1 select 0), _skidL1 select 1, _skidL1 select 2]; //mirror the left skid to get the right skid
81-
_SkidR2 = [-1*(_skidL2 select 0), _skidL2 select 1, _skidL2 select 2];
75+
_avgX = _avgX/(count _contacts);
8276

83-
_skids = [_skidL1, _skidL2];
77+
_skidL1 set [0, (_avgX + _contacts#0#0)/2];
8478

85-
//Make sure skids are far apart; close points only waste performance without doing any good!
86-
if (_SkidR1 distance2D _skidL1 > 1) then {_skids pushBack _SkidR1};
87-
if (_SkidR1 distance2D _SkidR2 > 1) then {_skids pushBack _SkidR2};
79+
_bottomHeight = _skidL1#2;
8880

81+
_SkidR1 = [-1*(_skidL1 select 0), _skidL1 select 1, _bottomHeight]; //mirror the left skid to get the right skid
8982

9083
_cfgVeh = configFile >> "cfgVehicles";
84+
9185
_bladeCenter = _tempVeh selectionPosition getText(_cfgVeh >> _vehType >>"mainBladeCenter");
86+
9287
_bladeRadius = getNumber(_cfgVeh >> _vehType >>"mainBladeRadius");
9388

9489
//Also detect primary blade contact points
95-
_bladeCenter = _bladeCenter vectorDiff [0,0,1];
90+
_bladeCenter = _bladeCenter vectorDiff [0,0,0.25];
9691
_bladeR = _bladeCenter vectorAdd [_bladeRadius, 0, 0];
9792
_bladeL = _bladeCenter vectorAdd [-_bladeRadius, 0, 0];
9893
_bladeF = _bladeCenter vectorAdd [0, _bladeRadius, 0];
9994
_bladeFL = (_bladeL vectorAdd _bladeF) apply {_x/2};
10095
_bladeFR = (_bladeR vectorAdd _bladeF) apply {_x/2};
10196
deleteVehicle _tempVeh;
10297

103-
_skids = _skids apply {_x vectorAdd [0,0,0.1]};
98+
_center = +_bladeCenter;
99+
_front = +_bladeF;
100+
101+
_center set [2, _bottomHeight];
102+
_front set [2, _bottomHeight];
104103

105-
_veh setVariable ["AIO_sensitivePoints", (_skids + [_bladeF, _bladeL, _bladeR,_bladeFL,_bladeFR,_tail])];
106-
_veh setVariable ["AIO_skidPoints", _skids];
104+
_center = ((_front vectorAdd _center) vectorAdd _tail) apply {_x/3};
107105

106+
_veh setVariable ["AIO_sensitivePoints", [_bladeF, _bladeL, _bladeR,_tail]];
107+
_veh setVariable ["AIO_skidPoints", [_center, _skidL1, _skidR1]];
108+
_veh setVariable ["AIO_modelCenter", _center];
109+
_veh setVariable ["AIO_copilots", (allTurrets _veh select {getNumber ([_veh, _x] call BIS_fnc_turretConfig >> "isCopilot") > 0})];
108110
//Default heli mechanics is based on Littlebird, so adjust for other helicopters for realism
109111

110112
_hasContact = isTouchingGround _veh;
@@ -118,7 +120,7 @@ _hasContact = isTouchingGround _veh;
118120
} forEach _skids;
119121
*/
120122

121-
if !(_addToSuperHeli) exitWith {_hasContact};
123+
if !(_addToSuperHeli) exitWith {};
122124

123125
_maxSpeed = (getNumber(_cfgVeh >> _vehType >>"maxSpeed")) min 400;
124126

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ params ["_veh"];
22
AIO_superHelicopters = AIO_superHelicopters - [_veh];
33
AIO_AI_superHelicopters = AIO_AI_superHelicopters - [_veh];
44

5+
if (count AIO_superHelicopters == 0) then {
6+
["AIO_helicopter_control", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
7+
};
8+
59
_veh setVariable ["AIO_forcePitch", false];
610
_veh setVariable ["AIO_forcePitchCoeff", 1];
711
_veh setVariable ["AIO_loiter", 0];
8-
9-
if (count AIO_superHelicopters == 0) then {
10-
["AIO_helicopter_control", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
11-
};
12+
_veh land "NONE";
13+
_veh setVariable ["AIO_flightHeight", 40];
14+
_veh flyInHeight 40;
15+
_veh engineOn true;

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
{
55
_veh = _x;
66
_driver = driver _veh;
7-
_aliveDriver = if (isNull _driver) then {_veh getVariable ["AIO_landContact", true]} else {alive _driver};
7+
_hasContact = isTouchingGround _veh;
8+
_aliveDriver = alive _driver || {_hasContact || {-1 != (_veh getVariable ["AIO_copilots", []]) findIf {alive (_veh turretUnit _x)}}};
89
if (canMove _veh && _aliveDriver && isEngineOn _veh && {time - (_veh getVariable ["AIO_engineOn", 0]) >= 18 || {time >= (_veh getVariable ["AIO_engineReady", 0])}}) then {
910

1011
_fps = diag_fps max 1;
1112
_acc = accTime;
1213

13-
_weightCoeff = _acc*(_veh getVariable ["AIO_weightCoeff", 1]);
14+
_weightCoeff = _acc*(_veh getVariable ["AIO_weightCoeff", 1]); //acceleration coeff
1415
_manouverCoeff = _acc*(_veh getVariable ["AIO_manouverCoeff", 1]);
15-
_AiCoeff = [1,0.5] select (_veh getVariable ["AIO_AiPilot", false]);
16+
_AiCoeff = [1,0.5] select (_veh getVariable ["AIO_AiPilot", false]); //smooth AI movement
1617

17-
_controlCoeff = _manouverCoeff*_AiCoeff;
18+
_controlCoeff = _manouverCoeff*_AiCoeff; //maneuberability coeff; how fast it can pitch/bank
1819

1920
_velocity = _veh getVariable ["AIO_lastVelocity", [0,0,0]];
2021
_speed = vectorMagnitude _velocity;
2122

2223
_currentCollective = _velocity select 2;
2324
_desiredColl = _veh getVariable ["AIO_collective", 0];
2425

25-
_hasContact = isTouchingGround _veh;
26-
2726
if (_hasContact) then {_desiredColl = _desiredColl max -1};
2827

2928
_verticalVelocity = _currentCollective + _acc/_fps*(_desiredColl - _currentCollective);
@@ -90,7 +89,7 @@
9089

9190
_cos = ([_vecDirX, _vecDirY,0] vectorCos [_velocityDirX, _velocityDirY, 0]);
9291
_bankSpeed = acos(abs _cos);
93-
if (str _bankSpeed == "-1.#IND") then {_bankSpeed = 0} else {_bankSpeed = _bankSpeed*(_cos + 1)*_speed/_maxSpeed*3};
92+
if (!finite _bankSpeed) then {_bankSpeed = 0} else {_bankSpeed = _bankSpeed*(_cos + 1)*_speed/_maxSpeed*3};
9493
};
9594

9695
//drawLine3D [_bladeCenter, _bladeCenter vectorAdd (_newVUP apply {_x*10}), [0,0,1,1]];
@@ -103,10 +102,8 @@
103102
_factor = linearConversion [0, 0.75*_maxSpeed, _speed, 0, 1, true];
104103

105104
_newDir = (_desiredDir*7.5*(1-_factor/1.1) - _factor*_turn*_bankSpeed)/_fps;
106-
107-
_skids = _veh getVariable ["AIO_skidPoints", []];
108-
109105
/*
106+
_skids = _veh getVariable ["AIO_skidPoints", []];
110107
{
111108
_skid = _veh modelToWorldWorld _x;
112109
_skidbottom = _skid vectorDiff [0,0,0.38];
@@ -131,7 +128,7 @@
131128
};
132129

133130
_veh setVariable ["AIO_lastVelocity", _velocity];
134-
_veh setVariable ["AIO_landContact", _hasContact];
131+
135132
//drawLine3D [_bladeCenter, _bladeCenter vectorAdd _velocity, [1,1,0,1]];
136133

137134
if (!(_veh getVariable ["AIO_isBanking", false]) || _hasContact) then {

0 commit comments

Comments
 (0)