mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
First batch of cleaned up files
This commit is contained in:
parent
32f7854bf6
commit
9b55dd0b57
@ -2,18 +2,17 @@
|
||||
// internal handler for net events
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"];
|
||||
private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"];
|
||||
|
||||
_eventType = _this select 0;
|
||||
_event = _this select 1;
|
||||
PARAMS_2(_eventType,_event);
|
||||
|
||||
if(_eventType == "ACEg") then {
|
||||
if (_eventType == "ACEg") then {
|
||||
_eventName = _event select 0;
|
||||
_eventArgs = _event select 1;
|
||||
|
||||
_eventNames = GVAR(events) select 0;
|
||||
_eventIndex = _eventNames find _eventName;
|
||||
if(_eventIndex != -1) then {
|
||||
if (_eventIndex != -1) then {
|
||||
_events = (GVAR(events) select 1) select _eventIndex;
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
@ -22,7 +21,7 @@ if(_eventType == "ACEg") then {
|
||||
#endif
|
||||
|
||||
{
|
||||
if(!isNil "_x") then {
|
||||
if (!isNil "_x") then {
|
||||
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
|
||||
#ifdef DEBUG_EVENTS_CALLSTACK
|
||||
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
|
||||
@ -32,14 +31,14 @@ if(_eventType == "ACEg") then {
|
||||
};
|
||||
};
|
||||
|
||||
if(_eventType == "ACEc") then {
|
||||
if(isServer) then {
|
||||
if (_eventType == "ACEc") then {
|
||||
if (isServer) then {
|
||||
_eventName = _event select 0;
|
||||
_eventTargets = _event select 1;
|
||||
_eventArgs = _event select 2;
|
||||
|
||||
_sentEvents = [];
|
||||
if(!IS_ARRAY(_eventTargets)) then {
|
||||
if (!IS_ARRAY(_eventTargets)) then {
|
||||
_eventTargets = [_eventTargets];
|
||||
};
|
||||
|
||||
@ -52,14 +51,14 @@ if(_eventType == "ACEc") then {
|
||||
_serverFlagged = false;
|
||||
{
|
||||
_owner = _x;
|
||||
if(IS_OBJECT(_x)) then {
|
||||
if (IS_OBJECT(_x)) then {
|
||||
_owner = owner _x;
|
||||
};
|
||||
if(!(_owner in _sentEvents)) then {
|
||||
if (!(_owner in _sentEvents)) then {
|
||||
PUSH(_sentEvents, _owner);
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
if(isDedicated || {_x != ACE_player}) then {
|
||||
if(isDedicated && {local _x} && {!_serverFlagged}) then {
|
||||
if (isDedicated || {_x != ACE_player}) then {
|
||||
if (isDedicated && {local _x} && {!_serverFlagged}) then {
|
||||
_serverFlagged = true;
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
} else {
|
||||
|
@ -18,33 +18,26 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"];
|
||||
private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_displayName = _this select 1;
|
||||
_action = _this select 2;
|
||||
_condition = _this select 3;
|
||||
_statement = _this select 4;
|
||||
_condition2 = _this select 5;
|
||||
_statement2 = _this select 6;
|
||||
_priority = _this select 7;
|
||||
PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority);
|
||||
|
||||
if (isNil "_priority") then {_priority = 0};
|
||||
|
||||
if (typeName _condition == "STRING") then {
|
||||
_condition = compile _condition;
|
||||
_condition = compile _condition;
|
||||
};
|
||||
|
||||
if (typeName _statement == "STRING") then {
|
||||
_statement = compile _statement;
|
||||
_statement = compile _statement;
|
||||
};
|
||||
|
||||
if (typeName _condition2 == "STRING") then {
|
||||
_condition2 = compile _condition2;
|
||||
_condition2 = compile _condition2;
|
||||
};
|
||||
|
||||
if (typeName _statement2 == "STRING") then {
|
||||
_statement2 = compile _statement2;
|
||||
_statement2 = compile _statement2;
|
||||
};
|
||||
|
||||
_name = format ["ACE_ActionMenu_%1", _action];
|
||||
@ -61,20 +54,20 @@ missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _s
|
||||
_actionIDs pushBack _id;
|
||||
|
||||
_addAction = call compile format [
|
||||
"[
|
||||
'%2',
|
||||
{if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}},
|
||||
nil,
|
||||
%4,
|
||||
false,
|
||||
true,
|
||||
'%1',
|
||||
""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)""
|
||||
]",
|
||||
_action,
|
||||
_displayName,
|
||||
_nameVar,
|
||||
_priority
|
||||
"[
|
||||
'%2',
|
||||
{if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}},
|
||||
nil,
|
||||
%4,
|
||||
false,
|
||||
true,
|
||||
'%1',
|
||||
""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)""
|
||||
]",
|
||||
_action,
|
||||
_displayName,
|
||||
_nameVar,
|
||||
_priority
|
||||
];
|
||||
|
||||
_actionID = _unit addAction _addAction;
|
||||
|
@ -7,7 +7,7 @@ disableSerialization;
|
||||
_dlg = ctrlParent _this;
|
||||
|
||||
_dlg displayAddEventHandler ["unload", {
|
||||
if (_this select 1 == 1) then {
|
||||
[missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent);
|
||||
};
|
||||
if (_this select 1 == 1) then {
|
||||
[missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent);
|
||||
};
|
||||
}];
|
||||
|
@ -11,14 +11,15 @@
|
||||
* Event handler ID number (for use with fnc_removeEventHandler)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_eventName", "_eventCode", "_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"];
|
||||
_eventName = _this select 0;
|
||||
_eventCode = _this select 1;
|
||||
|
||||
private ["_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"];
|
||||
|
||||
PARAMS_2(_eventName,_eventCode);
|
||||
|
||||
_eventNames = GVAR(events) select 0;
|
||||
_eventFunctions = [];
|
||||
_eventIndex = _eventNames find _eventName;
|
||||
if(_eventIndex != -1) then {
|
||||
if (_eventIndex != -1) then {
|
||||
_eventFunctions = (GVAR(events) select 1) select _eventIndex;
|
||||
} else {
|
||||
_eventNameCount = count _eventNames;
|
||||
@ -27,6 +28,6 @@ if(_eventIndex != -1) then {
|
||||
};
|
||||
|
||||
_eventFunctionCount = count _eventFunctions;
|
||||
_eventFunctions set[_eventFunctionCount, _eventCode];
|
||||
_eventFunctions set [_eventFunctionCount, _eventCode];
|
||||
|
||||
_eventFunctionCount;
|
@ -11,12 +11,12 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
private ["_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
|
||||
_statement = _this select 0;
|
||||
PARAMS_1(_statement);
|
||||
|
||||
if (typeName _statement == "STRING") then {
|
||||
_statement = compile _statement;
|
||||
_statement = compile _statement;
|
||||
};
|
||||
|
||||
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
|
||||
@ -26,8 +26,8 @@ _actionIDs = _actionsVar select 1;
|
||||
_actions = _actionsVar select 2;
|
||||
|
||||
if (_id == 0) then {
|
||||
uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers];
|
||||
("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"];
|
||||
uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers];
|
||||
("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"];
|
||||
};
|
||||
|
||||
_actionIDs pushBack _id;
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
private ["_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
|
||||
_statement = _this select 0;
|
||||
PARAMS_1(_statement);
|
||||
|
||||
if (typeName _statement == "STRING") then {
|
||||
_statement = compile _statement;
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_8_PVT(_this,_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value);
|
||||
PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value);
|
||||
|
||||
_settingData = [_name] call FUNC(getSettingData);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_unit,_classname);
|
||||
PARAMS_2(_unit,_classname);
|
||||
DEFAULT_PARAM(2,_container,"");
|
||||
DEFAULT_PARAM(3,_ammoCount,-1);
|
||||
|
||||
|
@ -17,9 +17,9 @@ Example:
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_forceWalkNumber"];
|
||||
private ["_forceWalkNumber"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
_forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
|
||||
|
||||
_unit forceWalk (_forceWalkNumber > 0);
|
||||
|
@ -23,16 +23,16 @@ _array = [];
|
||||
_array resize _minLength;
|
||||
|
||||
for "_index" from 0 to (_minLength - 1) do {
|
||||
_array set [_index, false];
|
||||
_array set [_index, false];
|
||||
};
|
||||
|
||||
_index = 0;
|
||||
|
||||
while {_number > 0} do {
|
||||
_rest = _number mod 2;
|
||||
_number = floor (_number / 2);
|
||||
_rest = _number mod 2;
|
||||
_number = floor (_number / 2);
|
||||
|
||||
_array set [_index, _rest == 1];
|
||||
_index = _index + 1;
|
||||
_array set [_index, _rest == 1];
|
||||
_index = _index + 1;
|
||||
};
|
||||
_array
|
||||
|
@ -10,11 +10,11 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_id", "_show"];
|
||||
_id = _this select 0;
|
||||
private ["_show"];
|
||||
PARAMS_1(_id);
|
||||
_show = if (count _this > 1) then {_this select 1} else {false};
|
||||
|
||||
if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
|
||||
if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
|
||||
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
|
||||
};
|
||||
if (typeName _show == typeName 0) then {
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration);
|
||||
PARAMS_5(_params,_function,_namespace,_uid,_duration);
|
||||
|
||||
if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
|
||||
_namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
|
||||
|
@ -19,12 +19,11 @@
|
||||
#define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1}
|
||||
#define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1}
|
||||
|
||||
private ["_unit", "_vehicle", "_position", "_checkDistance", "_index"];
|
||||
private ["_position", "_checkDistance", "_index"];
|
||||
|
||||
_this resize 5;
|
||||
|
||||
_unit = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
PARAMS_2(_unit,_vehicle);
|
||||
_position = toLower (_this select 2);
|
||||
_checkDistance = _this select 3;
|
||||
_index = _this select 4; // optional, please don't use
|
||||
@ -44,218 +43,217 @@ _radius = 0;
|
||||
|
||||
_enemiesInVehicle = false; //Possible Side Restriction
|
||||
{
|
||||
if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true};
|
||||
if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
_return = false;
|
||||
switch (_position) do {
|
||||
case "driver" : {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
|
||||
if (_vehicle isKindOf "Tank") then {
|
||||
_selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2];
|
||||
};
|
||||
|
||||
_return = CANGETINDRIVER;
|
||||
};
|
||||
|
||||
case "pilot" : {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
|
||||
_return = CANGETINDRIVER;
|
||||
};
|
||||
|
||||
case "gunner" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "commander" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "copilot" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "turret" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
}) then {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "ffv" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
}) then {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "codriver" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
case "driver" : {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
if (_vehicle isKindOf "Tank") then {
|
||||
_selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2];
|
||||
};
|
||||
|
||||
_return = true
|
||||
};
|
||||
_return = CANGETINDRIVER;
|
||||
};
|
||||
};
|
||||
|
||||
case "cargo" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
case "pilot" : {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
};
|
||||
_return = CANGETINDRIVER;
|
||||
};
|
||||
};
|
||||
|
||||
default {};
|
||||
case "gunner" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "commander" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "copilot" : {
|
||||
private "_turretConfig";
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = CANGETINTURRETINDEX
|
||||
};
|
||||
|
||||
case "turret" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
}) then {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "ffv" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
}) then {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "codriver" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "cargo" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
} else {
|
||||
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_radius = getNumber (_config >> "getInRadius");
|
||||
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
|
||||
|
||||
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
|
||||
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
|
||||
};
|
||||
|
||||
_return = true
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
default {};
|
||||
};
|
||||
|
||||
private "_fnc_isInRange";
|
||||
_fnc_isInRange = {
|
||||
if (_radius == 0) exitWith {true};
|
||||
if (_radius == 0) exitWith {true};
|
||||
|
||||
private ["_unitPosition", "_distance"];
|
||||
_unitPosition = getPos _unit;
|
||||
private ["_unitPosition", "_distance"];
|
||||
_unitPosition = getPos _unit;
|
||||
|
||||
_distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
|
||||
_distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
|
||||
|
||||
if (!isNil "_selectionPosition2") then {
|
||||
_distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2));
|
||||
};
|
||||
if (!isNil "_selectionPosition2") then {
|
||||
_distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2));
|
||||
};
|
||||
|
||||
_distance < _radius
|
||||
_distance < _radius
|
||||
};
|
||||
|
||||
// if you want into the cargo and you can't, then check ffv turrets aswell
|
||||
if (_position == "cargo") exitWith {
|
||||
if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else {
|
||||
[_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition);
|
||||
}
|
||||
if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else {
|
||||
[_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition);
|
||||
};
|
||||
};
|
||||
|
||||
_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}
|
||||
|
@ -8,6 +8,9 @@
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_return"];
|
||||
_unit = _this select 0;
|
||||
|
||||
private ["_return"];
|
||||
|
||||
PARAMS_1(_unit);
|
||||
|
||||
(((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested)))
|
@ -14,10 +14,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target", "_exceptions"];
|
||||
private ["_exceptions"];
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
_exceptions = if (count _this > 2) then {
|
||||
_this select 2;
|
||||
} else {
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
// returns true if the unit is on foot or in a ffv position
|
||||
|
||||
private ["_unit", "_config"];
|
||||
private ["_config"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (_unit == vehicle _unit) exitWith {true};
|
||||
|
||||
|
@ -14,11 +14,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"];
|
||||
private ["_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"];
|
||||
|
||||
_projectile = _this select 0;
|
||||
_adjustDir = _this select 1;
|
||||
_adjustUp = _this select 2;
|
||||
PARAMS_3(_projectile,_adjustDir,_adjustUp);
|
||||
|
||||
_adjustSpeed = if (count _this > 3) then {
|
||||
_this select 3
|
||||
|
Loading…
Reference in New Issue
Block a user