mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Second batch of cleaned up files.
This commit is contained in:
parent
9b55dd0b57
commit
0b6f02f45e
@ -16,13 +16,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_mode", "_checkAll", "_whitelist", "_logic"];
|
||||
private ["_logic"];
|
||||
|
||||
_this resize 3;
|
||||
|
||||
_mode = _this select 0;
|
||||
_checkAll = _this select 1;
|
||||
_whitelist = _this select 2;
|
||||
PARAMS_3(_mode,_checkAll,_whitelist);
|
||||
|
||||
if (isNil "_checkAll") then {
|
||||
_checkAll = false;
|
||||
|
@ -13,12 +13,8 @@
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target", "_lockTarget"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
_lockTarget = _this select 2;
|
||||
|
||||
PARAMS_3(_unit,_target,_lockTarget);
|
||||
|
||||
if (isNil "_lockTarget") then {_lockTarget = false};
|
||||
|
||||
@ -26,7 +22,7 @@ private "_owner";
|
||||
_owner = _target getVariable [QGVAR(owner), objNull];
|
||||
|
||||
if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then {
|
||||
diag_log text "[ACE] ERROR: Claiming already owned object.";
|
||||
diag_log text "[ACE] ERROR: Claiming already owned object.";
|
||||
};
|
||||
|
||||
// transfer this immediately
|
||||
|
@ -13,36 +13,35 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this spawn {
|
||||
_target = _this select 0;
|
||||
_ignoreDead = _this select 1;
|
||||
if (isNil "_ignoreDead") then {_ignoreDead = false};
|
||||
PARAMS_2(_target,_ignoreDead);
|
||||
if (isNil "_ignoreDead") then {_ignoreDead = false};
|
||||
|
||||
_vehicleTarget = vehicle _target;
|
||||
_vehiclePlayer = vehicle ACE_player;
|
||||
_inVehicle = _target != _vehicleTarget;
|
||||
_vehicleTarget = vehicle _target;
|
||||
_vehiclePlayer = vehicle ACE_player;
|
||||
_inVehicle = _target != _vehicleTarget;
|
||||
|
||||
_position = getPosASL _target;
|
||||
_position = getPosASL _target;
|
||||
|
||||
_fnc_check = {
|
||||
// either unit changed vehicles
|
||||
if (_vehiclePlayer != vehicle ACE_player) exitWith {True};
|
||||
if (_vehicleTarget != vehicle _target) exitWith {True};
|
||||
_fnc_check = {
|
||||
// either unit changed vehicles
|
||||
if (_vehiclePlayer != vehicle ACE_player) exitWith {True};
|
||||
if (_vehicleTarget != vehicle _target) exitWith {True};
|
||||
|
||||
// target died
|
||||
if (!alive _target && {!_ignoreDead}) exitWith {True};
|
||||
// target died
|
||||
if (!alive _target && {!_ignoreDead}) exitWith {True};
|
||||
|
||||
// player fell unconscious
|
||||
if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True};
|
||||
// player fell unconscious
|
||||
if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True};
|
||||
|
||||
// target moved (outside of vehicle)
|
||||
(!_inVehicle && {getPosASL _target distanceSqr _position > 1})
|
||||
};
|
||||
|
||||
waitUntil {
|
||||
if (call _fnc_check) then {
|
||||
closeDialog 0;
|
||||
call EFUNC(interaction,hideMenu);
|
||||
// target moved (outside of vehicle)
|
||||
(!_inVehicle && {getPosASL _target distanceSqr _position > 1})
|
||||
};
|
||||
|
||||
waitUntil {
|
||||
if (call _fnc_check) then {
|
||||
closeDialog 0;
|
||||
call EFUNC(interaction,hideMenu);
|
||||
};
|
||||
(isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open
|
||||
};
|
||||
(isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open
|
||||
};
|
||||
};
|
||||
|
@ -11,9 +11,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_function";
|
||||
|
||||
_function = _this select 0;
|
||||
PARAMS_1(_function);
|
||||
|
||||
if (typeName _function == "STRING") exitWith {_function};
|
||||
|
||||
|
@ -16,9 +16,7 @@
|
||||
|
||||
#define KEY_MODIFIERS [42, 54, 29, 157, 56, 184]
|
||||
|
||||
private "_key";
|
||||
|
||||
_key = _this select 0;
|
||||
PARAMS_1(_key);
|
||||
|
||||
if (_key in KEY_MODIFIERS) exitWith {_key};
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
#define DEFAULT_LOGGING_LEVEL -1
|
||||
#define DEFAULT_TEXT_DISPLAY -1
|
||||
|
||||
private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"];
|
||||
_msg = _this select 0;
|
||||
private ["_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"];
|
||||
PARAMS_1(_msg);
|
||||
_level = if (count _this > 1) then {_this select 1} else { 2 };
|
||||
|
||||
if (typeName _level != "NUMBER") then {
|
||||
|
@ -7,9 +7,10 @@
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
private ["_entity"];
|
||||
_entity = _this select 0;
|
||||
|
||||
PARAMS_1(_entity);
|
||||
|
||||
GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]);
|
||||
GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]);
|
||||
|
@ -9,11 +9,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"];
|
||||
_name = _this select 0;
|
||||
_value = _this select 1;
|
||||
_defaultGlobal = _this select 2;
|
||||
_catagory = _this select 3;
|
||||
private ["_code","_persistent"];
|
||||
|
||||
PARAMS_4(_name,_value,_defaultGlobal,_catagory);
|
||||
|
||||
_code = 0;
|
||||
_persistent = false;
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_state", "_dlg"];
|
||||
private ["_dlg"];
|
||||
|
||||
_state = _this select 0;
|
||||
PARAMS_1(_state);
|
||||
|
||||
if (_state) then {
|
||||
disableSerialization;
|
||||
|
@ -42,11 +42,10 @@
|
||||
// other constants
|
||||
#define DEFAULT_TIME 6
|
||||
|
||||
private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"];
|
||||
_iconId = _this select 0;
|
||||
_show = _this select 1;
|
||||
_icon = _this select 2;
|
||||
_color = _this select 3;
|
||||
private ["_allControls", "_refresh", "_timeAlive", "_list"];
|
||||
|
||||
PARAMS_4(_iconId,_show,_icon,_color);
|
||||
|
||||
_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME};
|
||||
|
||||
disableSerialization;
|
||||
@ -93,7 +92,7 @@ if (_show) then {
|
||||
if (_x select 0 == _iconId) exitwith {
|
||||
_list set [_foreachIndex, [_iconId, _icon, _color, time]];
|
||||
};
|
||||
}foreach _list;
|
||||
} forEach _list;
|
||||
};
|
||||
missionNamespace setvariable [QGVAR(displayIconList), _list];
|
||||
call _refresh;
|
||||
@ -112,7 +111,7 @@ if (_show) then {
|
||||
if (_x select 0 != _iconId) then {
|
||||
_newList pushback _x;
|
||||
};
|
||||
}foreach _list;
|
||||
} forEach _list;
|
||||
|
||||
missionNamespace setvariable [QGVAR(displayIconList), _newList];
|
||||
call _refresh;
|
||||
|
@ -20,11 +20,9 @@
|
||||
|
||||
_this resize 4;
|
||||
|
||||
private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"];
|
||||
_text = _this select 0;
|
||||
_sound = _this select 1;
|
||||
_delay = _this select 2;
|
||||
_priority = _this select 3;
|
||||
private ["_lastHintTime", "_lastHintPriority", "_time"];
|
||||
|
||||
PARAMS_4(_text,_sound,_delay,_priority);
|
||||
|
||||
if (isNil QGVAR(lastHint)) then {
|
||||
GVAR(lastHint) = [0, 0];
|
||||
|
@ -15,9 +15,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_text", "_image", "_imageColor", "_target"];
|
||||
_text = _this select 0;
|
||||
_image = _this select 1;
|
||||
private ["_imageColor", "_target"];
|
||||
PARAMS_2(_text,_image);
|
||||
_imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]};
|
||||
_imageColor resize 3;
|
||||
_target = if (count _this > 3) then {_this select 3} else {ACE_player};
|
||||
|
@ -16,23 +16,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_animation", "_priority", "_force"];
|
||||
private ["_force"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_animation = _this select 1;
|
||||
_priority = _this select 2;
|
||||
PARAMS_3(_unit,_animation,_priority);
|
||||
_force = False;
|
||||
|
||||
// no animation given
|
||||
if (isNil "_animation") exitWith {
|
||||
diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent];
|
||||
diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent];
|
||||
};
|
||||
|
||||
if (isNil "_priority") then {
|
||||
_priority = 0;
|
||||
_priority = 0;
|
||||
};
|
||||
if (count _this > 3) then {
|
||||
_force = _this select 3;
|
||||
_force = _this select 3;
|
||||
};
|
||||
|
||||
// don't overwrite more important animations
|
||||
@ -43,31 +41,31 @@ if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", f
|
||||
|
||||
// switchMove "" no longer works in dev 1.37
|
||||
if (_animation == "") then {
|
||||
_animation = [_unit] call FUNC(getDefaultAnim);
|
||||
_animation = [_unit] call FUNC(getDefaultAnim);
|
||||
};
|
||||
|
||||
switch (_priority) do {
|
||||
case 0 : {
|
||||
if (_unit == vehicle _unit) then {
|
||||
[_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
|
||||
[_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
case 0 : {
|
||||
if (_unit == vehicle _unit) then {
|
||||
[_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
|
||||
[_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
};
|
||||
};
|
||||
case 1 : {
|
||||
if (_unit == vehicle _unit) then {
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
case 1 : {
|
||||
if (_unit == vehicle _unit) then {
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
};
|
||||
};
|
||||
case 2 : {
|
||||
// Execute on all machines. SwitchMove has local effects.
|
||||
[_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
default {};
|
||||
case 2 : {
|
||||
// Execute on all machines. SwitchMove has local effects.
|
||||
[_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
default {};
|
||||
};
|
||||
|
||||
["Anim", [_priority, _animation]] call FUNC(log);
|
||||
|
@ -12,17 +12,13 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_unit";
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_unit = _this select 0;
|
||||
private ["_backpackObject","_holder"];
|
||||
|
||||
private "_backpackObject";
|
||||
_backpackObject = backpackContainer _unit;
|
||||
|
||||
_unit addBackpack "Bag_Base";
|
||||
removeBackpack _unit;
|
||||
|
||||
private "_holder";
|
||||
_holder = objNull;
|
||||
|
||||
{
|
||||
|
@ -1,17 +1,20 @@
|
||||
//fnc_dumpArray.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_var", "_depth", "_pad", "_i", "_x"];
|
||||
private ["_pad", "_i", "_x"];
|
||||
|
||||
PARAMS_2(_var,_depth);
|
||||
|
||||
_var = _this select 0;
|
||||
_depth = _this select 1;
|
||||
_pad = "";
|
||||
|
||||
for "_i" from 0 to _depth do {
|
||||
_pad = _pad + toString [9];
|
||||
};
|
||||
|
||||
_depth = _depth + 1;
|
||||
if(IS_ARRAY(_var)) then {
|
||||
if((count _var) > 0) then {
|
||||
|
||||
if (IS_ARRAY(_var)) then {
|
||||
if ((count _var) > 0) then {
|
||||
diag_log text format["%1[", _pad];
|
||||
{
|
||||
[_x, _depth] call FUNC(dumpArray);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
diag_log text format["REGISTERED ACE PFH HANDLERS"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
if(!isNil "ACE_PFH_COUNTER") then {
|
||||
if (!isNil "ACE_PFH_COUNTER") then {
|
||||
{
|
||||
private["_pfh"];
|
||||
_pfh = _x select 0;
|
||||
@ -16,7 +16,7 @@ if(!isNil "ACE_PFH_COUNTER") then {
|
||||
diag_log text format["ACE COUNTER RESULTS"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
|
||||
private ["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
|
||||
_counterEntry = _x;
|
||||
_iter = 0;
|
||||
_total = 0;
|
||||
|
@ -13,6 +13,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_namespace,_uid);
|
||||
PARAMS_2(_namespace,_uid);
|
||||
|
||||
_namespace setVariable [_uid, nil];
|
||||
|
@ -15,7 +15,6 @@
|
||||
disableSerialization;
|
||||
endLoadingScreen;
|
||||
|
||||
|
||||
// no message without player possible
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
@ -30,10 +29,9 @@ if (isNull (call BIS_fnc_displayMission)) exitWith {
|
||||
}, 1, _this] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
private ["_textHeader", "_textMessage", "_onOK", "_onCancel"];
|
||||
private ["_onOK", "_onCancel"];
|
||||
|
||||
_textHeader = _this select 0;
|
||||
_textMessage = _this select 1;
|
||||
PARAMS_2(_textHeader,_textMessage);
|
||||
_onOK = ARR_SELECT(_this,2,{});
|
||||
_onCancel = ARR_SELECT(_this,3,{});
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_func,_params);
|
||||
PARAMS_2(_func,_params);
|
||||
|
||||
[
|
||||
{
|
||||
|
@ -36,9 +36,9 @@ _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
|
||||
// find index to overwrite function with the same name, add to end otherwise
|
||||
_index = count _persistentFunctions;
|
||||
{
|
||||
if (_x select 2 == _name) exitWith {
|
||||
_index = _forEachIndex;
|
||||
};
|
||||
if (_x select 2 == _name) exitWith {
|
||||
_index = _forEachIndex;
|
||||
};
|
||||
} forEach _persistentFunctions;
|
||||
|
||||
// set new value
|
||||
@ -46,8 +46,8 @@ _persistentFunctions set [_index, [_arguments, _function, _name]];
|
||||
|
||||
// broadcast variable
|
||||
if (typeName _unit == "NAMESPACE") then {
|
||||
ACE_PersistentFunctions = _persistentFunctions;
|
||||
publicVariable "ACE_PersistentFunctions";
|
||||
ACE_PersistentFunctions = _persistentFunctions;
|
||||
publicVariable "ACE_PersistentFunctions";
|
||||
} else {
|
||||
_unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true];
|
||||
_unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true];
|
||||
};
|
||||
|
@ -26,46 +26,46 @@ _function = call compile (_this select 1);
|
||||
_unit = _this select 2;
|
||||
|
||||
if (isNil "_unit") then {
|
||||
_unit = 2;
|
||||
_unit = 2;
|
||||
};
|
||||
|
||||
["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log);
|
||||
|
||||
if (typeName _unit == "SCALAR") exitWith {
|
||||
switch (_unit) do {
|
||||
case 0 : {
|
||||
_arguments call _function;
|
||||
};
|
||||
case 1 : {
|
||||
if (isServer) then {
|
||||
_arguments call _function;
|
||||
} else {
|
||||
publicVariableServer QGVAR(remoteFnc);
|
||||
};
|
||||
};
|
||||
case 2 : {
|
||||
_arguments call _function;
|
||||
switch (_unit) do {
|
||||
case 0 : {
|
||||
_arguments call _function;
|
||||
};
|
||||
case 1 : {
|
||||
if (isServer) then {
|
||||
_arguments call _function;
|
||||
} else {
|
||||
publicVariableServer QGVAR(remoteFnc);
|
||||
};
|
||||
};
|
||||
case 2 : {
|
||||
_arguments call _function;
|
||||
|
||||
GVAR(remoteFnc) set [2, 0];
|
||||
publicVariable QGVAR(remoteFnc);
|
||||
GVAR(remoteFnc) set [2, 0];
|
||||
publicVariable QGVAR(remoteFnc);
|
||||
};
|
||||
case 3 : {
|
||||
if (isDedicated) then {
|
||||
_arguments call _function;
|
||||
} else {
|
||||
if (!isServer) then {publicVariableServer QGVAR(remoteFnc)};
|
||||
};
|
||||
};
|
||||
};
|
||||
case 3 : {
|
||||
if (isDedicated) then {
|
||||
_arguments call _function;
|
||||
} else {
|
||||
if (!isServer) then {publicVariableServer QGVAR(remoteFnc)};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (local _unit) then {
|
||||
_arguments call _function;
|
||||
_arguments call _function;
|
||||
} else {
|
||||
if (isServer) then {
|
||||
_id = owner _unit;
|
||||
_id publicVariableClient QGVAR(remoteFnc);
|
||||
} else {
|
||||
publicVariableServer QGVAR(remoteFnc);
|
||||
};
|
||||
if (isServer) then {
|
||||
_id = owner _unit;
|
||||
_id publicVariableClient QGVAR(remoteFnc);
|
||||
} else {
|
||||
publicVariableServer QGVAR(remoteFnc);
|
||||
};
|
||||
};
|
||||
|
@ -1,16 +1,14 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_target";
|
||||
|
||||
_target = _this select 0;
|
||||
PARAMS_1(_target);
|
||||
|
||||
{
|
||||
if (isNil "_x") then {
|
||||
diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex];
|
||||
} else {
|
||||
if (typeName _x == "ARRAY") then {
|
||||
[_x select 0, _target] call (_x select 1);
|
||||
if (isNil "_x") then {
|
||||
diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex];
|
||||
} else {
|
||||
if (typeName _x == "ARRAY") then {
|
||||
[_x select 0, _target] call (_x select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach (_target getVariable ["ACE_PersistentFunctions", []]);
|
||||
|
@ -9,61 +9,59 @@
|
||||
private "_fnc_logEntries";
|
||||
|
||||
_fnc_logEntries = {
|
||||
private ["_c", "_d", "_p", "_t", "_e"];
|
||||
private ["_p", "_t", "_e"];
|
||||
|
||||
_c = _this select 0;
|
||||
_d = _this select 1;
|
||||
PARAMS_2(_c,_d);
|
||||
|
||||
_p = inheritsFrom _c;
|
||||
_p = inheritsFrom _c;
|
||||
|
||||
_t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p];
|
||||
for "_a" from 1 to _d do {
|
||||
_t = " " + _t;
|
||||
};
|
||||
diag_log text _t;
|
||||
|
||||
_e = [];
|
||||
for "_i" from 0 to (count _c - 1) do {
|
||||
private ["_e1, _e2"];
|
||||
_e1 = _c select _i;
|
||||
|
||||
_e2 = switch (true) do {
|
||||
case (isNumber _e1): {getNumber _e1};
|
||||
case (isText _e1): {getText _e1};
|
||||
case (isArray _e1): {getArray _e1};
|
||||
case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false};
|
||||
};
|
||||
|
||||
if (typeName _e2 != "BOOL") then {
|
||||
if (typeName _e2 == "ARRAY") then {
|
||||
_e2 = toArray str _e2;
|
||||
{
|
||||
if (_x == toArray "[" select 0) then {
|
||||
_e2 set [_forEachIndex, toArray "{" select 0];
|
||||
};
|
||||
if (_x == toArray "]" select 0) then {
|
||||
_e2 set [_forEachIndex, toArray "}" select 0];
|
||||
};
|
||||
} forEach _e2;
|
||||
_e2 = toString _e2;
|
||||
_t = format ["%1[] = %2;", configName _e1, _e2];
|
||||
} else {
|
||||
_t = format ["%1 = %2;", configName _e1, str _e2];
|
||||
};
|
||||
for "_a" from 0 to _d do {
|
||||
_t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p];
|
||||
for "_a" from 1 to _d do {
|
||||
_t = " " + _t;
|
||||
};
|
||||
diag_log text _t;
|
||||
};
|
||||
};
|
||||
diag_log text _t;
|
||||
|
||||
_t = "};";
|
||||
for "_a" from 1 to _d do {
|
||||
_t = " " + _t;
|
||||
};
|
||||
diag_log text _t;
|
||||
diag_log text "";
|
||||
_e = [];
|
||||
for "_i" from 0 to (count _c - 1) do {
|
||||
private ["_e1, _e2"];
|
||||
_e1 = _c select _i;
|
||||
|
||||
_e2 = switch (true) do {
|
||||
case (isNumber _e1): {getNumber _e1};
|
||||
case (isText _e1): {getText _e1};
|
||||
case (isArray _e1): {getArray _e1};
|
||||
case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false};
|
||||
};
|
||||
|
||||
if (typeName _e2 != "BOOL") then {
|
||||
if (typeName _e2 == "ARRAY") then {
|
||||
_e2 = toArray str _e2;
|
||||
{
|
||||
if (_x == toArray "[" select 0) then {
|
||||
_e2 set [_forEachIndex, toArray "{" select 0];
|
||||
};
|
||||
if (_x == toArray "]" select 0) then {
|
||||
_e2 set [_forEachIndex, toArray "}" select 0];
|
||||
};
|
||||
} forEach _e2;
|
||||
_e2 = toString _e2;
|
||||
_t = format ["%1[] = %2;", configName _e1, _e2];
|
||||
} else {
|
||||
_t = format ["%1 = %2;", configName _e1, str _e2];
|
||||
};
|
||||
for "_a" from 0 to _d do {
|
||||
_t = " " + _t;
|
||||
};
|
||||
diag_log text _t;
|
||||
};
|
||||
};
|
||||
|
||||
_t = "};";
|
||||
for "_a" from 1 to _d do {
|
||||
_t = " " + _t;
|
||||
};
|
||||
diag_log text _t;
|
||||
diag_log text "";
|
||||
};
|
||||
|
||||
[_this, 0] call _fnc_logEntries;
|
||||
|
@ -15,10 +15,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_array", "_code", "_newArray", "_index"];
|
||||
private ["_newArray", "_index"];
|
||||
|
||||
_array = _this select 0;
|
||||
_code = _this select 1;
|
||||
PARAMS_2(_array,_code);
|
||||
|
||||
if (isNil "_array") exitWith {
|
||||
diag_log text format ["[ACE] ERROR: No array for function filter in %1", _fnc_scriptNameParent];
|
||||
@ -27,8 +26,8 @@ if (isNil "_array") exitWith {
|
||||
|
||||
_newArray = [];
|
||||
for "_index" from 0 to (count _array - 1) do {
|
||||
if ((_array select _index) call _code) then {
|
||||
_newArray pushBack (_array select _index);
|
||||
};
|
||||
if ((_array select _index) call _code) then {
|
||||
_newArray pushBack (_array select _index);
|
||||
};
|
||||
};
|
||||
_newArray
|
||||
|
@ -1,9 +1,9 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_crate", "_weapons", "_items"];
|
||||
private ["_weapons", "_items"];
|
||||
|
||||
_crate = _this select 0;
|
||||
PARAMS_1(_crate);
|
||||
|
||||
// get all weapons inside the crate
|
||||
_weapons = weaponCargo _crate;
|
||||
|
@ -18,5 +18,5 @@
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then {
|
||||
[_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation);
|
||||
[_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation);
|
||||
};
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_object", "_return", "_val", "_category"];
|
||||
_object = _this select 0;
|
||||
private ["_return", "_val", "_category"];
|
||||
PARAMS_1(_object);
|
||||
_category = if (count _this > 1) then { _this select 1 } else { "" };
|
||||
|
||||
if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith {
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_1_PVT(_this,_unit);
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (isNull _unit) exitWith {[
|
||||
"",
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"];
|
||||
private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []];
|
||||
|
||||
@ -21,9 +21,9 @@ _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(bin
|
||||
|
||||
_unitCaptivityReasons = [];
|
||||
{
|
||||
if (_unitCaptivityStatus select _forEachIndex) then {
|
||||
_unitCaptivityReasons pushBack _x;
|
||||
};
|
||||
if (_unitCaptivityStatus select _forEachIndex) then {
|
||||
_unitCaptivityReasons pushBack _x;
|
||||
};
|
||||
} forEach _captivityReasons;
|
||||
|
||||
_unitCaptivityReasons
|
||||
|
@ -1,10 +1,9 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_name", "_cfgClass", "_classes"];
|
||||
private ["_classes"];
|
||||
|
||||
_name = _this select 0;
|
||||
_cfgClass = _this select 1;
|
||||
PARAMS_2(_name,_cfgClass);
|
||||
|
||||
_classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass);
|
||||
_classes = [_classes, {configName _this}] call FUNC(map);
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_turret"];
|
||||
private ["_config", "_turret"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_turret"];
|
||||
private ["_config", "_turret"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
|
@ -11,9 +11,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_item";
|
||||
|
||||
_item = _this select 0;
|
||||
PARAMS_1(_item);
|
||||
|
||||
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"};
|
||||
|
||||
|
@ -11,9 +11,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_object";
|
||||
|
||||
_object = _this select 0;
|
||||
PARAMS_1(_object);
|
||||
|
||||
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"};
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_anim", "_stance"];
|
||||
private ["_anim", "_stance"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
_anim = toLower (animationState _unit);
|
||||
|
||||
// stance is broken for some animations.
|
||||
|
@ -7,5 +7,6 @@
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
+(missionNamespace getvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + (_this select 0),[]])
|
||||
|
@ -6,10 +6,10 @@ private ["_configName", "_index"];
|
||||
_configName = "";
|
||||
|
||||
for "_index" from 0 to (count configFile - 1) do {
|
||||
_config = configFile select _index;
|
||||
if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith {
|
||||
_configName = configName _config;
|
||||
};
|
||||
_config = configFile select _index;
|
||||
if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith {
|
||||
_configName = configName _config;
|
||||
};
|
||||
};
|
||||
|
||||
_configName
|
||||
|
@ -11,21 +11,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
|
||||
private ["_turrets", "_doorTurrets", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_doorTurrets = [];
|
||||
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {
|
||||
_doorTurrets pushBack _x;
|
||||
};
|
||||
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {
|
||||
_doorTurrets pushBack _x;
|
||||
};
|
||||
} forEach _turrets;
|
||||
|
||||
_doorTurrets
|
||||
|
@ -9,10 +9,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"];
|
||||
_source = _this select 0;
|
||||
_destination = _this select 1;
|
||||
_accuracy = _this select 2;
|
||||
private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result"];
|
||||
|
||||
PARAMS_3(_source,_destination,_accuracy);
|
||||
|
||||
_result = [false, [0, 0, 0]];
|
||||
|
||||
|
@ -7,12 +7,11 @@
|
||||
* @Return: [intersects BOOL, intersection PositionASL]
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"];
|
||||
_source = _this select 0;
|
||||
_destination = _this select 1;
|
||||
_accuracy = _this select 2;
|
||||
private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result"];
|
||||
|
||||
PARAMS_3(_source,_destination,_accuracy);
|
||||
|
||||
_result = [false, [0, 0, 0]];
|
||||
|
||||
|
@ -17,9 +17,9 @@ Example:
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
|
||||
private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []];
|
||||
|
||||
@ -29,9 +29,9 @@ _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC
|
||||
|
||||
_unitForceWalkReasons = [];
|
||||
{
|
||||
if (_unitForceWalkStatus select _forEachIndex) then {
|
||||
_unitForceWalkReasons pushBack _x;
|
||||
};
|
||||
if (_unitForceWalkStatus select _forEachIndex) then {
|
||||
_unitForceWalkReasons pushBack _x;
|
||||
};
|
||||
} forEach _forceWalkReasons;
|
||||
|
||||
_unitForceWalkReasons
|
||||
|
@ -31,7 +31,7 @@ _gunner = objNull;
|
||||
|
||||
// ensure that at least the pilot is returned if there is no gunner
|
||||
if (isManualFire _vehicle && {isNull _gunner}) then {
|
||||
_gunner = driver _vehicle;
|
||||
_gunner = driver _vehicle;
|
||||
};
|
||||
|
||||
_gunner
|
||||
_gunner
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_hitpoints"];
|
||||
private ["_config", "_hitpoints"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_hitpoints", "_selections"];
|
||||
private ["_config", "_hitpoints", "_selections"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
#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", "_index"];
|
||||
private ["_position", "_index"];
|
||||
|
||||
PARAMS_2(_unit,_vehicle);
|
||||
|
||||
_unit = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
_position = toLower (_this select 2);
|
||||
_index = _this select 3; // optional, please don't use
|
||||
|
||||
@ -40,107 +40,55 @@ _isInside = vehicle _unit == _vehicle;
|
||||
_script = {};
|
||||
_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;
|
||||
|
||||
switch (_position) do {
|
||||
case "driver" : {
|
||||
if (CANGETINDRIVER) then {
|
||||
_script = [
|
||||
{_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
};
|
||||
};
|
||||
|
||||
case "pilot" : {
|
||||
if (CANGETINDRIVER) then {
|
||||
_script = [
|
||||
{_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
_position = "driver";
|
||||
};
|
||||
};
|
||||
|
||||
case "gunner" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
};
|
||||
};
|
||||
|
||||
case "commander" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
};
|
||||
};
|
||||
|
||||
case "copilot" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner"
|
||||
};
|
||||
};
|
||||
|
||||
case "turret" : {
|
||||
private "_turrets";
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "gunner";
|
||||
} else {
|
||||
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
case "driver" : {
|
||||
if (CANGETINDRIVER) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
{_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "gunner";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "ffv" : {
|
||||
private "_turrets";
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
case "pilot" : {
|
||||
if (CANGETINDRIVER) then {
|
||||
_script = [
|
||||
{_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
_position = "driver";
|
||||
};
|
||||
};
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
case "gunner" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
|
||||
_position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner"
|
||||
} else {
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
};
|
||||
};
|
||||
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
case "commander" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
};
|
||||
};
|
||||
|
||||
case "copilot" : {
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
@ -148,93 +96,141 @@ switch (_position) do {
|
||||
|
||||
_position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner"
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "codriver" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
|
||||
case "turret" : {
|
||||
private "_turrets";
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
_position = "gunner";
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
} else {
|
||||
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
};
|
||||
_position = "gunner";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case "cargo" : {
|
||||
private "_positions";
|
||||
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
|
||||
case "ffv" : {
|
||||
private "_turrets";
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
|
||||
{
|
||||
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
|
||||
} forEach crew _vehicle;
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
if (_index != -1 && {_index in _positions}) then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
_position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner"
|
||||
} else {
|
||||
for "_index" from 0 to (count _turrets - 1) do {
|
||||
_turret = _turrets select _index;
|
||||
if (CANGETINTURRETINDEX) exitWith {
|
||||
_script = [
|
||||
{_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
} else {
|
||||
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
};
|
||||
_position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner"
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
default {};
|
||||
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 {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
} else {
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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 {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
} else {
|
||||
_index = _positions select 0;
|
||||
if (!isNil "_index") then {
|
||||
_script = [
|
||||
{_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];},
|
||||
{if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;}
|
||||
] select _enemiesInVehicle;
|
||||
|
||||
_position = "cargo";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
default {};
|
||||
};
|
||||
|
||||
// this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any.
|
||||
private "_fnc_getInEH";
|
||||
_fnc_getInEH = {
|
||||
private "_config";
|
||||
// config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why?
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers";
|
||||
private "_config";
|
||||
// config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why?
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers";
|
||||
|
||||
if (isClass _config) then {
|
||||
//getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats
|
||||
if !(_isInside) then {
|
||||
[_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn");
|
||||
if (isClass _config) then {
|
||||
//getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats
|
||||
if !(_isInside) then {
|
||||
[_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn");
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// if you want into the cargo and you can't, then check ffv turrets aswell
|
||||
if (_position == "cargo") exitWith {
|
||||
if (_script isEqualTo {}) then {
|
||||
[_unit, _vehicle, "ffv"] call FUNC(getInPosition);
|
||||
} else {
|
||||
call _script;
|
||||
};
|
||||
if (_script isEqualTo {}) then {
|
||||
[_unit, _vehicle, "ffv"] call FUNC(getInPosition);
|
||||
} else {
|
||||
call _script;
|
||||
};
|
||||
};
|
||||
|
||||
call _script;
|
||||
|
@ -14,9 +14,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_item";
|
||||
|
||||
_item = _this select 0;
|
||||
PARAMS_1(_item);
|
||||
|
||||
_cfgType = [_item] call FUNC(getConfigType);
|
||||
|
||||
@ -46,7 +44,7 @@ switch (true) do {
|
||||
case (_type == 2^4): {["magazine","handgun"]}; // handgun
|
||||
case (_type == 2^8): {["magazine","primary"]}; // rifle
|
||||
case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines
|
||||
//case (_type < 2^11): {["magazine","unknown"]};
|
||||
//case (_type < 2^11): {["magazine","unknown"]};
|
||||
|
||||
case (_type == 101): {["item","muzzle"]};
|
||||
case (_type == 201): {["item","optics"]};
|
||||
|
@ -12,10 +12,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_light"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_light = _this select 1;
|
||||
PARAMS_2(_vehicle,_light);
|
||||
|
||||
private "_config";
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light;
|
||||
|
@ -11,9 +11,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_weapon";
|
||||
|
||||
_weapon = _this select 0;
|
||||
PARAMS_1(_weapon);
|
||||
|
||||
private "_config";
|
||||
_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight";
|
||||
|
@ -11,25 +11,28 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
_group = _this select 0;
|
||||
private ["_leader","_vehicle","_side"];
|
||||
|
||||
PARAMS_1(_group);
|
||||
|
||||
_leader = leader _group;
|
||||
_vehicle = vehicle _leader;
|
||||
_side = side _leader;
|
||||
|
||||
if (_vehicle == _leader) exitWith {
|
||||
if (
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or
|
||||
(getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver")
|
||||
) then {
|
||||
["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
} else {
|
||||
["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if (
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or
|
||||
(getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver")
|
||||
) then {
|
||||
["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
} else {
|
||||
["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
};
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith {
|
||||
["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if (
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or
|
||||
@ -38,35 +41,35 @@ if (
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_canRepair") > 0) or
|
||||
(getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_fuelCapacityCargo") > 0)
|
||||
) exitWith {
|
||||
["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Plane") exitWith {
|
||||
["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if (_vehicle isKindOf "Air") exitWith {
|
||||
["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "StaticMortar") exitWith {
|
||||
["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith {
|
||||
["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Car") exitWith {
|
||||
["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith {
|
||||
["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
if (_vehicle isKindOf "Tank") exitWith {
|
||||
["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Ship") exitWith {
|
||||
["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0)
|
||||
};
|
||||
|
||||
// generic marker
|
||||
|
@ -12,25 +12,24 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_showEffective", "_name"];
|
||||
private ["_name"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_showEffective = _this select 1;
|
||||
PARAMS_2(_unit,_showEffective);
|
||||
|
||||
if (isNil "_showEffective") then {
|
||||
_showEffective = false;
|
||||
_showEffective = false;
|
||||
};
|
||||
|
||||
_name = "";
|
||||
|
||||
if (_unit isKindOf "CAManBase") then {
|
||||
_name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
|
||||
_name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
|
||||
} else {
|
||||
if (_showEffective) then {
|
||||
_name = [effectiveCommander _unit] call FUNC(getName);
|
||||
} else {
|
||||
_name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
};
|
||||
if (_showEffective) then {
|
||||
_name = [effectiveCommander _unit] call FUNC(getName);
|
||||
} else {
|
||||
_name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
};
|
||||
};
|
||||
|
||||
_name
|
||||
|
@ -10,9 +10,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit","_magazine"];
|
||||
_unit = _this select 0;
|
||||
_magazine = _this select 1;
|
||||
PARAMS_2(_unit,_magazine);
|
||||
|
||||
_return = 0;
|
||||
if (_unit isKindOf "CAManBase") then {
|
||||
@ -20,7 +18,7 @@ if (_unit isKindOf "CAManBase") then {
|
||||
} else {
|
||||
{
|
||||
_return = _return + {_x == _magazine} count magazines _x;
|
||||
}foreach (crew _unit);
|
||||
} forEach (crew _unit);
|
||||
|
||||
_return = _return + ({_x == _magazine} count getMagazineCargo _unit);
|
||||
};
|
||||
|
@ -13,9 +13,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_hitpoints", "_selections"];
|
||||
private ["_config", "_hitpoints", "_selections"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
@ -24,8 +24,8 @@ _selections = [];
|
||||
|
||||
// iterate through all parents
|
||||
while {isClass _config} do {
|
||||
private "_class";
|
||||
_class = _config >> "Reflectors";
|
||||
private "_class";
|
||||
_class = _config >> "Reflectors";
|
||||
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private ["_entry", "_selection"];
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_1_PVT(_this,_name);
|
||||
PARAMS_1(_name);
|
||||
|
||||
private ["_value"];
|
||||
_value = [];
|
||||
|
@ -19,26 +19,26 @@ if (missionName == "") exitWith {""};
|
||||
_mission = toArray toLower loadFile "mission.sqm";
|
||||
_mission resize 65536;
|
||||
{
|
||||
if (_x < 33) then {
|
||||
_mission set [_forEachIndex, -1];
|
||||
}
|
||||
if (_x < 33) then {
|
||||
_mission set [_forEachIndex, -1];
|
||||
}
|
||||
} forEach _mission;
|
||||
_mission = toString (_mission - [-1]);
|
||||
|
||||
{_path set [_forEachIndex, toLower _x]} forEach _path;
|
||||
|
||||
for "_a" from 0 to (count _path - 2) do {
|
||||
_class = format ["class%1{", _path select _a];
|
||||
_class = format ["class%1{", _path select _a];
|
||||
|
||||
_index = _mission find _class;
|
||||
_index = _mission find _class;
|
||||
|
||||
_array = toArray _mission;
|
||||
for "_b" from 0 to (_index + count toArray _class - 1) do {
|
||||
_array set [_b, -1];
|
||||
};
|
||||
_array = _array - [-1];
|
||||
_array = toArray _mission;
|
||||
for "_b" from 0 to (_index + count toArray _class - 1) do {
|
||||
_array set [_b, -1];
|
||||
};
|
||||
_array = _array - [-1];
|
||||
|
||||
_mission = toString _array;
|
||||
_mission = toString _array;
|
||||
};
|
||||
|
||||
_entry = format ["%1=", _path select (count _path - 1)];
|
||||
@ -47,7 +47,7 @@ if (_index == -1) exitWith {""};
|
||||
|
||||
_array = toArray _mission;
|
||||
for "_b" from 0 to (_index + count toArray _entry - 1) do {
|
||||
_array set [_b, -1];
|
||||
_array set [_b, -1];
|
||||
};
|
||||
_mission = toString (_array - [-1]);
|
||||
|
||||
|
@ -13,11 +13,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_interval", "_maxDistance", "_minDistance", "_position", "_laser", "_line", "_distance", "_iteration"];
|
||||
private ["_position", "_laser", "_line", "_distance", "_iteration"];
|
||||
|
||||
_interval = _this select 0;
|
||||
_maxDistance = _this select 1;
|
||||
_minDistance = _this select 2;
|
||||
PARAMS_3(_interval,_maxDistance,_minDistance);
|
||||
|
||||
_position = ATLToASL positionCameraToWorld [0, 0, 0];
|
||||
_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)];
|
||||
@ -29,15 +27,15 @@ _distance = _maxDistance;
|
||||
_iteration = _distance;
|
||||
|
||||
while {
|
||||
_iteration > _interval / 2
|
||||
_iteration > _interval / 2
|
||||
} do {
|
||||
_iteration = _iteration / 2;
|
||||
_iteration = _iteration / 2;
|
||||
|
||||
_laser = ATLToASL positionCameraToWorld [0, 0, _distance];
|
||||
_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)];
|
||||
_line set [1, _laser];
|
||||
_laser = ATLToASL positionCameraToWorld [0, 0, _distance];
|
||||
_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)];
|
||||
_line set [1, _laser];
|
||||
|
||||
_distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration);
|
||||
_distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration);
|
||||
};
|
||||
|
||||
_distance = _interval * round (_distance / _interval);
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_maxDistance", "_position", "_laser", "_intersects"];
|
||||
private ["_position", "_laser", "_intersects"];
|
||||
|
||||
_maxDistance = _this select 0;
|
||||
PARAMS_1(_maxDistance);
|
||||
|
||||
_position = ATLToASL positionCameraToWorld [0, 0, 0];
|
||||
_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)];
|
||||
|
@ -11,9 +11,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_vehicle";
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
if (!isLightOn _vehicle) exitWith {[]};
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
private ["_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
|
@ -12,28 +12,27 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"];
|
||||
private ["_index", "_offset", "_config2", "_foundClasses"];
|
||||
|
||||
_config = _this select 0;
|
||||
_turretIndex = _this select 1;
|
||||
PARAMS_2(_config,_turretIndex);
|
||||
|
||||
for "_index" from 0 to (count _turretIndex - 1) do {
|
||||
_config = _config >> "Turrets";
|
||||
_config = _config >> "Turrets";
|
||||
|
||||
_offset = 0;
|
||||
_config2 = _config select 0;
|
||||
_offset = 0;
|
||||
_config2 = _config select 0;
|
||||
|
||||
_foundClasses = 0;
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
if (isClass _config2) then {
|
||||
_foundClasses = _foundClasses + 1;
|
||||
} else {
|
||||
_offset = _offset + 1;
|
||||
_foundClasses = 0;
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
if (isClass _config2) then {
|
||||
_foundClasses = _foundClasses + 1;
|
||||
} else {
|
||||
_offset = _offset + 1;
|
||||
};
|
||||
_config2 = _config select (_turretIndex select _index) + _offset;
|
||||
|
||||
if (_foundClasses == _turretIndex select _index) exitWith {};
|
||||
};
|
||||
_config2 = _config select (_turretIndex select _index) + _offset;
|
||||
|
||||
if (_foundClasses == _turretIndex select _index) exitWith {};
|
||||
};
|
||||
_config = _config2;
|
||||
_config = _config2;
|
||||
};
|
||||
_config
|
||||
|
@ -11,20 +11,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
private ["_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith {
|
||||
_turret = _x;
|
||||
};
|
||||
if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith {
|
||||
_turret = _x;
|
||||
};
|
||||
} forEach _turrets;
|
||||
|
||||
_turret
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_vehicle,_position);
|
||||
PARAMS_2(_vehicle,_position);
|
||||
private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"];
|
||||
|
||||
_turret = [_vehicle, _position] call CBA_fnc_getTurret;
|
||||
@ -25,7 +25,7 @@ TRACE_3("", _pov, _gunBeg, _gunEnd);
|
||||
_povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) );
|
||||
_povDir = [0,0,0];
|
||||
|
||||
if(_pov == "pip0_pos") then {
|
||||
if (_pov == "pip0_pos") then {
|
||||
_pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) );
|
||||
_povDir = _pipDir vectorDiff _povPos;
|
||||
} else {
|
||||
|
@ -11,20 +11,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
private ["_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if (getNumber (_config >> "primaryGunner") == 1) exitWith {
|
||||
_turret = _x;
|
||||
};
|
||||
if (getNumber (_config >> "primaryGunner") == 1) exitWith {
|
||||
_turret = _x;
|
||||
};
|
||||
} forEach _turrets;
|
||||
|
||||
_turret
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_vehicle", "_turrets", "_units", "_index"];
|
||||
private ["_vehicle", "_turrets", "_units", "_index"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
_vehicle = vehicle _unit;
|
||||
|
||||
if (_unit == _vehicle) exitWith {[]};
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_type", "_config", "_turrets", "_fnc_addTurret"];
|
||||
private ["_config", "_turrets", "_fnc_addTurret"];
|
||||
|
||||
_type = _this select 0;
|
||||
PARAMS_1(_type);
|
||||
|
||||
_varName = format ["ACE_CachedTurrets_%1", _type];
|
||||
_turrets = + (uiNamespace getVariable _varName);
|
||||
@ -24,26 +24,25 @@ _config = configFile >> "CfgVehicles" >> _type;
|
||||
|
||||
_turrets = [];
|
||||
_fnc_addTurret = {
|
||||
private ["_config", "_path", "_count", "_offset", "_index", "_path2", "_config2"];
|
||||
private ["_count", "_offset", "_index", "_path2", "_config2"];
|
||||
|
||||
_config = _this select 0;
|
||||
_path = _this select 1;
|
||||
PARAMS_2(_config,_path);
|
||||
|
||||
_config = _config >> "Turrets";
|
||||
_count = count _config;
|
||||
_config = _config >> "Turrets";
|
||||
_count = count _config;
|
||||
|
||||
_offset = 0;
|
||||
for "_index" from 0 to (_count - 1) do {
|
||||
_path2 = _path + [_index - _offset];
|
||||
_config2 = _config select _index;
|
||||
_offset = 0;
|
||||
for "_index" from 0 to (_count - 1) do {
|
||||
_path2 = _path + [_index - _offset];
|
||||
_config2 = _config select _index;
|
||||
|
||||
if (isClass _config2) then {
|
||||
_turrets pushBack _path2;
|
||||
[_config2, _path2] call _fnc_addTurret;
|
||||
} else {
|
||||
_offset = _offset + 1;
|
||||
if (isClass _config2) then {
|
||||
_turrets pushBack _path2;
|
||||
[_config2, _path2] call _fnc_addTurret;
|
||||
} else {
|
||||
_offset = _offset + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[_config, []] call _fnc_addTurret;
|
||||
|
@ -11,20 +11,20 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
private ["_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if (getNumber (_config >> "isPersonTurret") == 1) then {
|
||||
_turret pushBack _x;
|
||||
};
|
||||
if (getNumber (_config >> "isPersonTurret") == 1) then {
|
||||
_turret pushBack _x;
|
||||
};
|
||||
} forEach _turrets;
|
||||
_turret
|
||||
|
@ -11,24 +11,24 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
private ["_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if ( getNumber (_config >> "isCopilot") != 1
|
||||
&& {getNumber (_config >> "primaryGunner") != 1}
|
||||
&& {getNumber (_config >> "primaryObserver") != 1}
|
||||
&& {getNumber (_config >> "isPersonTurret") != 1}
|
||||
) then {
|
||||
_turret pushBack _x;
|
||||
};
|
||||
if ( getNumber (_config >> "isCopilot") != 1
|
||||
&& {getNumber (_config >> "primaryGunner") != 1}
|
||||
&& {getNumber (_config >> "primaryObserver") != 1}
|
||||
&& {getNumber (_config >> "isPersonTurret") != 1}
|
||||
) then {
|
||||
_turret pushBack _x;
|
||||
};
|
||||
} forEach _turrets;
|
||||
_turret
|
||||
|
@ -20,9 +20,9 @@ Example:
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_uav", "_positionArray", "_playerIndex"];
|
||||
private ["_uav", "_positionArray", "_playerIndex"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
_uav = getConnectedUAV _unit;
|
||||
if (isNull _uav) exitWith {""};
|
||||
_positionArray = UAVControl _uav;
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_cargo", "_codrivers"];
|
||||
private ["_config", "_cargo", "_codrivers"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
|
||||
@ -21,8 +21,8 @@ _cargo = [];
|
||||
_codrivers = getArray (_config >> "cargoIsCoDriver");
|
||||
|
||||
for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do {
|
||||
if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_cargo pushBack _index;
|
||||
};
|
||||
if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_cargo pushBack _index;
|
||||
};
|
||||
};
|
||||
_cargo
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_config", "_cargo", "_codrivers"];
|
||||
private ["_config", "_cargo", "_codrivers"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
PARAMS_1(_vehicle);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
|
||||
@ -21,8 +21,8 @@ _cargo = [];
|
||||
_codrivers = getArray (_config >> "cargoIsCoDriver");
|
||||
|
||||
for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do {
|
||||
if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_cargo pushBack _index;
|
||||
};
|
||||
if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
|
||||
_cargo pushBack _index;
|
||||
};
|
||||
};
|
||||
_cargo
|
||||
|
@ -12,10 +12,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_types", "_crew"];
|
||||
private ["_crew"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_types = _this select 1;
|
||||
PARAMS_2(_vehicle,_types);
|
||||
|
||||
_crew = [];
|
||||
|
||||
|
@ -12,9 +12,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weapon", "_direction", "_azimuth", "_inclination"];
|
||||
private ["_direction", "_azimuth", "_inclination"];
|
||||
|
||||
_weapon = _this select 0;
|
||||
PARAMS_1(_weapon);
|
||||
|
||||
_direction = ACE_player weaponDirection _weapon;
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_unit,_weapon);
|
||||
PARAMS_2(_unit,_weapon);
|
||||
|
||||
if (_weapon == "") exitWith {-1};
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weapon", "_modes"];
|
||||
private ["_modes"];
|
||||
|
||||
_weapon = _this select 0;
|
||||
PARAMS_1(_weapon);
|
||||
|
||||
_modes = [];
|
||||
{
|
||||
|
@ -11,9 +11,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weapon", "_muzzles"];
|
||||
private ["_muzzles"];
|
||||
|
||||
_weapon = _this select 0;
|
||||
PARAMS_1(_weapon);
|
||||
|
||||
_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
|
||||
|
||||
|
@ -12,10 +12,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
PARAMS_2(_unit,_weapon);
|
||||
|
||||
private "_muzzles";
|
||||
_muzzles = [_weapon] call FUNC(getWeaponMuzzles);
|
||||
|
@ -11,20 +11,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weapon", "_type", "_index"];
|
||||
private ["_type", "_index"];
|
||||
|
||||
_weapon = _this select 0;
|
||||
PARAMS_1(_weapon);
|
||||
|
||||
_type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber);
|
||||
|
||||
_index = 0;
|
||||
|
||||
while {!(_type select _index) && {_index < 16}} do {
|
||||
_index = _index + 1;
|
||||
_index = _index + 1;
|
||||
};
|
||||
|
||||
switch (_index) do {
|
||||
case 0 : {1};
|
||||
case 1 : {3};
|
||||
case 2 : {2};
|
||||
default {-1};
|
||||
case 0 : {1};
|
||||
case 1 : {3};
|
||||
case 2 : {2};
|
||||
default {-1};
|
||||
}
|
||||
|
@ -12,20 +12,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
switch (round (windDir / 360 * 16)) do {
|
||||
case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))};
|
||||
case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))};
|
||||
case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))};
|
||||
case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))};
|
||||
case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))};
|
||||
case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))};
|
||||
case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))};
|
||||
case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))};
|
||||
case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))};
|
||||
case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))};
|
||||
case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))};
|
||||
case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))};
|
||||
case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))};
|
||||
case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))};
|
||||
case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))};
|
||||
default {localize QUOTE(DOUBLES(STR,GVAR(S)))};
|
||||
case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))};
|
||||
case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))};
|
||||
case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))};
|
||||
case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))};
|
||||
case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))};
|
||||
case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))};
|
||||
case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))};
|
||||
case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))};
|
||||
case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))};
|
||||
case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))};
|
||||
case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))};
|
||||
case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))};
|
||||
case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))};
|
||||
case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))};
|
||||
case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))};
|
||||
default {localize QUOTE(DOUBLES(STR,GVAR(S)))};
|
||||
};
|
||||
|
@ -11,11 +11,8 @@
|
||||
* Nothing
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_eventName", "_eventArgs"];
|
||||
|
||||
_eventName = _this select 0;
|
||||
_eventArgs = _this select 1;
|
||||
|
||||
PARAMS_2(_eventName,_eventArgs);
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
publicVariable "ACEg";
|
||||
|
@ -11,22 +11,20 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_unit";
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
try {
|
||||
if (_unit == vehicle _unit) then {
|
||||
switch (currentWeapon _unit) do {
|
||||
case "" : {throw "AmovPknlMstpSnonWnonDnon"};
|
||||
case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"};
|
||||
case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"};
|
||||
case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"};
|
||||
case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"};
|
||||
if (_unit == vehicle _unit) then {
|
||||
switch (currentWeapon _unit) do {
|
||||
case "" : {throw "AmovPknlMstpSnonWnonDnon"};
|
||||
case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"};
|
||||
case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"};
|
||||
case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"};
|
||||
case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"};
|
||||
};
|
||||
};
|
||||
};
|
||||
} catch {
|
||||
if (stance _unit != "PRONE") then {
|
||||
[_unit, _exception] call FUNC(doAnimation);
|
||||
};
|
||||
if (stance _unit != "PRONE") then {
|
||||
[_unit, _exception] call FUNC(doAnimation);
|
||||
};
|
||||
};
|
||||
|
@ -13,8 +13,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
_vector1 = _this select 0;
|
||||
_vector2 = _this select 1;
|
||||
PARAMS_2(_vector1,_vector2);
|
||||
|
||||
_newVector = [];
|
||||
|
||||
|
@ -10,13 +10,13 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit","_magazine","_return"];
|
||||
_unit = _this select 0;
|
||||
_magazine = _this select 1;
|
||||
private ["_return"];
|
||||
PARAMS_2(_unit,_magazine);
|
||||
|
||||
if (_magazine != "") then {
|
||||
_return = (_magazine in magazines _unit);
|
||||
} else {
|
||||
_return = false;
|
||||
};
|
||||
|
||||
_return
|
@ -1,11 +1,11 @@
|
||||
//fnc_hashGet.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hash", "_key", "_val", "_index"];
|
||||
private ["_val", "_index"];
|
||||
// diag_log text format["%1 HASH GET: %2", diag_tickTime, _this];
|
||||
|
||||
_hash = _this select 0;
|
||||
_key = _this select 1;
|
||||
PARAMS_2(_hash,_key);
|
||||
|
||||
ERRORDATA(2);
|
||||
_val = nil;
|
||||
try {
|
||||
|
@ -1,11 +1,11 @@
|
||||
//fnc_hashHasKey.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hash", "_key", "_val", "_index"];
|
||||
private ["_val", "_index"];
|
||||
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
|
||||
|
||||
_hash = _this select 0;
|
||||
_key = _this select 1;
|
||||
PARAMS_2(_hash,_key);
|
||||
|
||||
ERRORDATA(2);
|
||||
_val = false;
|
||||
try {
|
||||
|
@ -1,9 +1,10 @@
|
||||
//fnc_hashListCreateHash.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hashList", "_hashKeys"];
|
||||
private ["_hashKeys"];
|
||||
|
||||
PARAMS_1(_hashList);
|
||||
|
||||
_hashList = _this select 0;
|
||||
ERRORDATA(1);
|
||||
_hashKeys = [];
|
||||
try {
|
||||
|
@ -1,7 +1,6 @@
|
||||
//fnc_hashListCreateList.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_keys"];
|
||||
PARAMS_1(_keys);
|
||||
|
||||
_keys = _this select 0;
|
||||
[_keys,[]];
|
||||
|
@ -1,10 +1,8 @@
|
||||
//fnc_hashListPush.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hashList", "_value"];
|
||||
PARAMS_2(_hashList,_value);
|
||||
|
||||
_hashList = _this select 0;
|
||||
_value = _this select 1;
|
||||
ERRORDATA(2);
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
|
@ -1,10 +1,9 @@
|
||||
//fnc_hashListSelect.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hashList", "_index", "_hash", "_keys", "_hashes", "_values"];
|
||||
private ["_hash", "_keys", "_hashes", "_values"];
|
||||
|
||||
_hashList = _this select 0;
|
||||
_index = _this select 1;
|
||||
PARAMS_2(_hashList,_index);
|
||||
ERRORDATA(2);
|
||||
_hash = nil;
|
||||
try {
|
||||
|
@ -1,11 +1,9 @@
|
||||
//fnc_hashListSet.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hashList", "_index", "_value", "_vals"];
|
||||
private ["_vals"];
|
||||
|
||||
_hashList = _this select 0;
|
||||
_index = _this select 1;
|
||||
_value = _this select 2;
|
||||
PARAMS_3(_hashList,_index,_value);
|
||||
ERRORDATA(3);
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
|
@ -1,10 +1,9 @@
|
||||
//fnc_hashRem.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hash", "_key", "_val", "_index"];
|
||||
private ["_val", "_index"];
|
||||
|
||||
_hash = _this select 0;
|
||||
_key = _this select 1;
|
||||
PARAMS_2(_hash,_key);
|
||||
ERRORDATA(2);
|
||||
_val = nil;
|
||||
try {
|
||||
|
@ -1,12 +1,11 @@
|
||||
//fnc_hashSet.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hash", "_key", "_val", "_index"];
|
||||
private ["_index"];
|
||||
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
|
||||
|
||||
_hash = _this select 0;
|
||||
_key = _this select 1;
|
||||
_val = _this select 2;
|
||||
PARAMS_3(_hash,_key,_val);
|
||||
|
||||
ERRORDATA(3);
|
||||
try {
|
||||
if(VALIDHASH(_hash)) then {
|
||||
|
@ -10,13 +10,16 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit","_return","_aslPos"];
|
||||
_unit = _this select 0;
|
||||
private ["_return","_aslPos"];
|
||||
|
||||
PARAMS_1(_unit);
|
||||
_return = false;
|
||||
|
||||
if ((surfaceIsWater getPos _unit)) then {
|
||||
_aslPos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
||||
if ((_aslPos select 2) <= 0) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
_return;
|
||||
|
||||
_return;
|
||||
|
@ -10,9 +10,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_configEntry","_configMatch", "_match"];
|
||||
_configEntry = _this select 0;
|
||||
_configMatch = _this select 1;
|
||||
private ["_match"];
|
||||
PARAMS_2(_configEntry,_configMatch);
|
||||
|
||||
if (configName _configEntry == _configMatch) exitWith { true };
|
||||
if (configName _configEntry == ",") exitWith { false };
|
||||
|
@ -1,10 +1,9 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_array", "_value", "_min", "_max"];
|
||||
private ["_min", "_max"];
|
||||
|
||||
_array = _this select 0;
|
||||
_value = _this select 1;
|
||||
PARAMS_2(_array,_value);
|
||||
|
||||
_min = _array select floor _value;
|
||||
_max = _array select ceil _value;
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit","_return"];
|
||||
_unit = _this select 0;
|
||||
private ["_return"];
|
||||
PARAMS_1(_unit);
|
||||
|
||||
(!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false]));
|
||||
|
@ -20,8 +20,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_unit";
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1]
|
||||
|
@ -11,8 +11,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_unit";
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1]
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
#define DISTANCE 10
|
||||
|
||||
private ["_unit", "_position", "_positionX", "_positionY", "_positionZ", "_intersections"];
|
||||
private ["_position", "_positionX", "_positionY", "_positionZ", "_intersections"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_position = eyePos _unit;
|
||||
_positionX = _position select 0;
|
||||
|
@ -11,23 +11,23 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"];
|
||||
private ["_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"];
|
||||
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
_vehicle = vehicle _unit;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_animation = animationState _unit;
|
||||
|
||||
if (_unit == driver _vehicle) then {
|
||||
_action = getText (_config >> "driverAction");
|
||||
_inAction = getText (_config >> "driverInAction");
|
||||
_action = getText (_config >> "driverAction");
|
||||
_inAction = getText (_config >> "driverInAction");
|
||||
} else {
|
||||
_turretIndex = [_unit] call FUNC(getTurretIndex);
|
||||
_turretIndex = [_unit] call FUNC(getTurretIndex);
|
||||
|
||||
_config = [_config, _turretIndex] call FUNC(getTurretConfigPath);
|
||||
_config = [_config, _turretIndex] call FUNC(getTurretConfigPath);
|
||||
|
||||
_action = getText (_config >> "gunnerAction");
|
||||
_inAction = getText (_config >> "gunnerInAction");
|
||||
_action = getText (_config >> "gunnerAction");
|
||||
_inAction = getText (_config >> "gunnerInAction");
|
||||
};
|
||||
|
||||
if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false};
|
||||
|
@ -12,15 +12,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_lightSource"];
|
||||
private ["_unitPos","_lightLevel"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_lightSource = _this select 1;
|
||||
PARAMS_2(_unit,_lightSource);
|
||||
|
||||
private "_unitPos";
|
||||
_unitPos = _unit modelToWorld (_unit selectionPosition "spine3");
|
||||
|
||||
private "_lightLevel";
|
||||
_lightLevel = 0;
|
||||
|
||||
if (_lightSource isKindOf "CAManBase") then {
|
||||
|
@ -2,29 +2,24 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if ((_this select 0) in (missionNamespace getVariable ["ACE_Debug", []])) then {
|
||||
private ["_type", "_argument", "_function", "_showInGame"];
|
||||
_this resize 4;
|
||||
|
||||
_this resize 4;
|
||||
PARAMS_4(_type,_argument,_function,_showInGame);
|
||||
|
||||
_type = _this select 0;
|
||||
_argument = _this select 1;
|
||||
_function = _this select 2;
|
||||
_showInGame = _this select 3;
|
||||
if (isNil "_function") then {
|
||||
_function = {_this};
|
||||
};
|
||||
|
||||
if (isNil "_function") then {
|
||||
_function = {_this};
|
||||
};
|
||||
if (isNil "_showInGame") then {
|
||||
_showInGame = true;
|
||||
};
|
||||
|
||||
if (isNil "_showInGame") then {
|
||||
_showInGame = true;
|
||||
};
|
||||
private "_result";
|
||||
_result = _argument call _function;
|
||||
|
||||
private "_result";
|
||||
_result = _argument call _function;
|
||||
if (_showInGame) then {
|
||||
systemChat format ["%1", _result];
|
||||
};
|
||||
|
||||
if (_showInGame) then {
|
||||
systemChat format ["%1", _result];
|
||||
};
|
||||
|
||||
diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result];
|
||||
diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result];
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user