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