Merge branch 'master' into medicalExtension

This commit is contained in:
Glowbal 2015-05-17 09:51:41 +02:00
commit d9da4211f7
428 changed files with 5148 additions and 3188 deletions

View File

@ -36,6 +36,7 @@ Anthariel <Contact@storm-simulation.com>
BlackQwar BlackQwar
Brakoviejo Brakoviejo
Brisse <brisse@outlook.com> Brisse <brisse@outlook.com>
BullHorn <bullhorn7@gmail.com>
Clon1998 <ps.patti1998@gmail.com> Clon1998 <ps.patti1998@gmail.com>
Codingboy Codingboy
Crusty Crusty
@ -73,6 +74,7 @@ Raspu86
Riccardo Petricca <petriccarcc@gmail.com> Riccardo Petricca <petriccarcc@gmail.com>
Robert Boklahánics <bokirobi@gmail.com> Robert Boklahánics <bokirobi@gmail.com>
ramius86 <pasini86@hotmail.com> ramius86 <pasini86@hotmail.com>
SilentSpike <SilentSpike100@gmail.com>
simon84 <badguy360th@gmail.com> simon84 <badguy360th@gmail.com>
Sniperwolf572 <tenga6@gmail.com> Sniperwolf572 <tenga6@gmail.com>
Tachi <zaveruha007@gmail.com> Tachi <zaveruha007@gmail.com>
@ -93,5 +95,7 @@ VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Bla1337 Bla1337
nikolauska <nikolauska1@gmail.com> nikolauska <nikolauska1@gmail.com>
adam3adam <br.ada@seznam.cz> adam3adam <br.ada@seznam.cz>
Professor <lukas.trneny@wo.cz> Professor <lukas.trneny@wo.cz>
Winter <simon@agius-muscat.net>
Dharma Bellamkonda <dharma.bellamkonda@gmail.com> Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
legman <juicemelon@msn.com>

View File

@ -1,6 +1,8 @@
// ACE - Common // ACE - Common
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent");
// Load settings from profile // Load settings from profile
if (hasInterface) then { if (hasInterface) then {
call FUNC(loadSettingsFromProfile); call FUNC(loadSettingsFromProfile);
@ -9,10 +11,9 @@ if (hasInterface) then {
// Listens for global "SettingChanged" events, to update the force status locally // Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", { ["SettingChanged", {
PARAMS_2(_name,_value); PARAMS_2(_name,_value);
if !(count _this > 2) exitWith {}; if !(count _this > 2) exitWith {};
private ["_force", "_settingData"];
_force = _this select 2; _force = _this select 2;
if (_force) then { if (_force) then {
_settingData = [_name] call FUNC(getSettingData); _settingData = [_name] call FUNC(getSettingData);
@ -54,6 +55,7 @@ QGVAR(remoteFnc) addPublicVariableEventHandler {
[missionNamespace] call FUNC(executePersistent); [missionNamespace] call FUNC(executePersistent);
private ["_currentVersion", "_previousVersion"];
// check previous version number from profile // check previous version number from profile
_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); _currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version");
_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""];
@ -131,6 +133,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
// PFH to raise varios events // PFH to raise varios events
[{ [{
private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"];
// "playerInventoryChanged" event // "playerInventoryChanged" event
_newPlayerInventory = [ACE_player] call FUNC(getAllGear); _newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
@ -212,6 +215,7 @@ GVAR(OldIsCamera) = false;
[{ [{
// "activeCameraChanged" event // "activeCameraChanged" event
private ["_isCamera"];
_isCamera = {!isNull _x} count ALL_CAMERAS > 0; _isCamera = {!isNull _x} count ALL_CAMERAS > 0;
if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { if !(_isCamera isEqualTo GVAR(OldIsCamera)) then {
// Raise ACE event locally // Raise ACE event locally

View File

@ -1,6 +1,8 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent");
ADDON = false; ADDON = false;
// ACE Common Function // ACE Common Function
@ -170,7 +172,6 @@ PREP(sortAlphabeticallyBy);
PREP(stringCompare); PREP(stringCompare);
PREP(stringToColoredText); PREP(stringToColoredText);
PREP(stringRemoveWhiteSpace); PREP(stringRemoveWhiteSpace);
PREP(subString);
PREP(switchToGroupSide); PREP(switchToGroupSide);
PREP(throttledPublicVariable); PREP(throttledPublicVariable);
PREP(toBin); PREP(toBin);
@ -302,6 +303,7 @@ if (hasInterface) then {
// PFH to update the ACE_player variable // PFH to update the ACE_player variable
[{ [{
if !(ACE_player isEqualTo (call FUNC(player))) then { if !(ACE_player isEqualTo (call FUNC(player))) then {
private ["_oldPlayer"];
_oldPlayer = ACE_player; _oldPlayer = ACE_player;
ACE_player = call FUNC(player); ACE_player = call FUNC(player);

View File

@ -2,18 +2,19 @@
// internal handler for net events // internal handler for net events
#include "script_component.hpp" #include "script_component.hpp"
private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"]; private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged", "_events"];
//IGNORE_PRIVATE_WARNING("_handleNetEvent");
_eventType = _this select 0;
_event = _this select 1;
if(_eventType == "ACEg") then { PARAMS_2(_eventType,_event);
if (_eventType == "ACEg") then {
_eventName = _event select 0; _eventName = _event select 0;
_eventArgs = _event select 1; _eventArgs = _event select 1;
_eventNames = GVAR(events) select 0; _eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName; _eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then { if (_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex; _events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
@ -22,7 +23,7 @@ if(_eventType == "ACEg") then {
#endif #endif
{ {
if(!isNil "_x") then { if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]); _eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK #ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)]; diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
@ -32,14 +33,14 @@ if(_eventType == "ACEg") then {
}; };
}; };
if(_eventType == "ACEc") then { if (_eventType == "ACEc") then {
if(isServer) then { if (isServer) then {
_eventName = _event select 0; _eventName = _event select 0;
_eventTargets = _event select 1; _eventTargets = _event select 1;
_eventArgs = _event select 2; _eventArgs = _event select 2;
_sentEvents = []; _sentEvents = [];
if(!IS_ARRAY(_eventTargets)) then { if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets]; _eventTargets = [_eventTargets];
}; };
@ -52,14 +53,14 @@ if(_eventType == "ACEc") then {
_serverFlagged = false; _serverFlagged = false;
{ {
_owner = _x; _owner = _x;
if(IS_OBJECT(_x)) then { if (IS_OBJECT(_x)) then {
_owner = owner _x; _owner = owner _x;
}; };
if(!(_owner in _sentEvents)) then { if (!(_owner in _sentEvents)) then {
PUSH(_sentEvents, _owner); PUSH(_sentEvents, _owner);
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
if(isDedicated || {_x != ACE_player}) then { if (isDedicated || {_x != ACE_player}) then {
if(isDedicated && {local _x} && {!_serverFlagged}) then { if (isDedicated && {local _x} && {!_serverFlagged}) then {
_serverFlagged = true; _serverFlagged = true;
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
} else { } else {

View File

@ -17,6 +17,8 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleSyncedEvent");
//SEH_s //SEH_s
if(isServer) then { if(isServer) then {
// Find the event name, and shovel out the events to the client // Find the event name, and shovel out the events to the client
@ -33,6 +35,7 @@ if(isServer) then {
["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent);
} else { } else {
PARAMS_2(_eventName,_eventLog); PARAMS_2(_eventName,_eventLog);
private ["_eventArgs"];
// This is the client handling the response from the server // This is the client handling the response from the server
// Start running the events // Start running the events
{ {

View File

@ -15,6 +15,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"];
//IGNORE_PRIVATE_WARNING("_count", "_index", "_return", "_target");
_unit = _this select 0; _unit = _this select 0;
_action = _this select 1; _action = _this select 1;

View File

@ -18,33 +18,27 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"];
//IGNORE_PRIVATE_WARNING("_target");
_unit = _this select 0; PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority);
_displayName = _this select 1;
_action = _this select 2;
_condition = _this select 3;
_statement = _this select 4;
_condition2 = _this select 5;
_statement2 = _this select 6;
_priority = _this select 7;
if (isNil "_priority") then {_priority = 0}; if (isNil "_priority") then {_priority = 0};
if (typeName _condition == "STRING") then { if (typeName _condition == "STRING") then {
_condition = compile _condition; _condition = compile _condition;
}; };
if (typeName _statement == "STRING") then { if (typeName _statement == "STRING") then {
_statement = compile _statement; _statement = compile _statement;
}; };
if (typeName _condition2 == "STRING") then { if (typeName _condition2 == "STRING") then {
_condition2 = compile _condition2; _condition2 = compile _condition2;
}; };
if (typeName _statement2 == "STRING") then { if (typeName _statement2 == "STRING") then {
_statement2 = compile _statement2; _statement2 = compile _statement2;
}; };
_name = format ["ACE_ActionMenu_%1", _action]; _name = format ["ACE_ActionMenu_%1", _action];
@ -61,20 +55,20 @@ missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _s
_actionIDs pushBack _id; _actionIDs pushBack _id;
_addAction = call compile format [ _addAction = call compile format [
"[ "[
'%2', '%2',
{if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}},
nil, nil,
%4, %4,
false, false,
true, true,
'%1', '%1',
""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)""
]", ]",
_action, _action,
_displayName, _displayName,
_nameVar, _nameVar,
_priority _priority
]; ];
_actionID = _unit addAction _addAction; _actionID = _unit addAction _addAction;

View File

@ -14,6 +14,8 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_conditionName", "_conditionFunc"]; private ["_conditionName", "_conditionFunc"];
//IGNORE_PRIVATE_WARNING("_player", "_target");
_conditionName = toLower (_this select 0); _conditionName = toLower (_this select 0);
_conditionFunc = _this select 1; _conditionFunc = _this select 1;

View File

@ -7,7 +7,7 @@ disableSerialization;
_dlg = ctrlParent _this; _dlg = ctrlParent _this;
_dlg displayAddEventHandler ["unload", { _dlg displayAddEventHandler ["unload", {
if (_this select 1 == 1) then { if (_this select 1 == 1) then {
[missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent);
}; };
}]; }];

View File

@ -11,14 +11,15 @@
* Event handler ID number (for use with fnc_removeEventHandler) * Event handler ID number (for use with fnc_removeEventHandler)
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_eventName", "_eventCode", "_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"];
_eventName = _this select 0; private ["_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"];
_eventCode = _this select 1;
PARAMS_2(_eventName,_eventCode);
_eventNames = GVAR(events) select 0; _eventNames = GVAR(events) select 0;
_eventFunctions = []; _eventFunctions = [];
_eventIndex = _eventNames find _eventName; _eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then { if (_eventIndex != -1) then {
_eventFunctions = (GVAR(events) select 1) select _eventIndex; _eventFunctions = (GVAR(events) select 1) select _eventIndex;
} else { } else {
_eventNameCount = count _eventNames; _eventNameCount = count _eventNames;
@ -27,6 +28,6 @@ if(_eventIndex != -1) then {
}; };
_eventFunctionCount = count _eventFunctions; _eventFunctionCount = count _eventFunctions;
_eventFunctions set[_eventFunctionCount, _eventCode]; _eventFunctions set [_eventFunctionCount, _eventCode];
_eventFunctionCount; _eventFunctionCount;

View File

@ -11,12 +11,12 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; private ["_actionsVar", "_id", "_actionIDs", "_actions"];
_statement = _this select 0; PARAMS_1(_statement);
if (typeName _statement == "STRING") then { if (typeName _statement == "STRING") then {
_statement = compile _statement; _statement = compile _statement;
}; };
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
@ -26,8 +26,8 @@ _actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2; _actions = _actionsVar select 2;
if (_id == 0) then { if (_id == 0) then {
uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers];
("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"];
}; };
_actionIDs pushBack _id; _actionIDs pushBack _id;

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; private ["_actionsVar", "_id", "_actionIDs", "_actions"];
_statement = _this select 0; PARAMS_1(_statement);
if (typeName _statement == "STRING") then { if (typeName _statement == "STRING") then {
_statement = compile _statement; _statement = compile _statement;

View File

@ -4,14 +4,14 @@
* If has only local effects. * If has only local effects.
* *
* Arguments: * Arguments:
* 0: _name (String) * 0: name <STRING>
* 1: _typeName (String) * 1: typeName <STRING>
* 2: _isClientSetable (Bool) * 2: isClientSetable <BOOL>
* 3: _localizedName (String) * 3: localizedName <STRING>
* 4: _localizedDescription (String) * 4: localizedDescription <STRING>
* 5: _possibleValues (Array) * 5: possibleValues <ARRAY>
* 6: _isForced (Bool) * 6: isForced <BOOL>
* 7: _defaultValue (Any) * 7: defaultValue (Any)
* *
* Return Value: * Return Value:
* None * None
@ -20,7 +20,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_8_PVT(_this,_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value);
private ["_settingData"];
_settingData = [_name] call FUNC(getSettingData); _settingData = [_name] call FUNC(getSettingData);

View File

@ -13,6 +13,8 @@
*/ */
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleSyncedEvent");
PARAMS_2(_name,_handler); PARAMS_2(_name,_handler);
private["_ttl", "_eventId", "_data"]; private["_ttl", "_eventId", "_data"];

View File

@ -19,13 +19,11 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_classname); PARAMS_2(_unit,_classname);
DEFAULT_PARAM(2,_container,""); DEFAULT_PARAM(2,_container,"");
DEFAULT_PARAM(3,_ammoCount,-1); DEFAULT_PARAM(3,_ammoCount,-1);
private "_addedToPlayer"; private ["_addedToPlayer", "_canAdd", "_type", "_pos"];
private "_canAdd";
private "_type";
_canAdd = false; _canAdd = false;
_addedToPlayer = true; _addedToPlayer = true;

View File

@ -17,9 +17,9 @@ Example:
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_forceWalkNumber"]; private ["_forceWalkNumber"];
_unit = _this select 0; PARAMS_1(_unit);
_forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
_unit forceWalk (_forceWalkNumber > 0); _unit forceWalk (_forceWalkNumber > 0);

View File

@ -23,16 +23,16 @@ _array = [];
_array resize _minLength; _array resize _minLength;
for "_index" from 0 to (_minLength - 1) do { for "_index" from 0 to (_minLength - 1) do {
_array set [_index, false]; _array set [_index, false];
}; };
_index = 0; _index = 0;
while {_number > 0} do { while {_number > 0} do {
_rest = _number mod 2; _rest = _number mod 2;
_number = floor (_number / 2); _number = floor (_number / 2);
_array set [_index, _rest == 1]; _array set [_index, _rest == 1];
_index = _index + 1; _index = _index + 1;
}; };
_array _array

View File

@ -10,11 +10,11 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_id", "_show"]; private ["_show"];
_id = _this select 0; PARAMS_1(_id);
_show = if (count _this > 1) then {_this select 1} else {false}; _show = if (count _this > 1) then {_this select 1} else {false};
if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
}; };
if (typeName _show == typeName 0) then { if (typeName _show == typeName 0) then {

View File

@ -17,7 +17,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration); PARAMS_5(_params,_function,_namespace,_uid,_duration);
//IGNORE_PRIVATE_WARNING("_eventName");
if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then { if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
_namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]]; _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];

View File

@ -19,12 +19,11 @@
#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", "_checkDistance", "_index"]; private ["_position", "_checkDistance", "_index"];
_this resize 5; _this resize 5;
_unit = _this select 0; PARAMS_2(_unit,_vehicle);
_vehicle = _this select 1;
_position = toLower (_this select 2); _position = toLower (_this select 2);
_checkDistance = _this select 3; _checkDistance = _this select 3;
_index = _this select 4; // optional, please don't use _index = _this select 4; // optional, please don't use
@ -44,218 +43,217 @@ _radius = 0;
_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;
_return = false; _return = false;
switch (_position) do { switch (_position) do {
case "driver" : { case "driver" : {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
if (_vehicle isKindOf "Tank") then {
_selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2];
};
_return = CANGETINDRIVER;
};
case "pilot" : {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_return = CANGETINDRIVER;
};
case "gunner" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "commander" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "copilot" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "turret" : {
private ["_turrets", "_turretConfig"];
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
}) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
} else {
for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
};
};
};
};
case "ffv" : {
private ["_turrets", "_turretConfig"];
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
}) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
} else {
for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
};
};
};
};
case "codriver" : {
private "_positions";
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
{
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
} forEach crew _vehicle;
if (_index != -1 && {_index in _positions}) then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
} else {
_index = _positions select 0;
if (!isNil "_index") then {
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { if (_vehicle isKindOf "Tank") then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2];
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
}; };
_return = true _return = CANGETINDRIVER;
};
}; };
};
case "cargo" : { case "pilot" : {
private "_positions";
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
{
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
} forEach crew _vehicle;
if (_index != -1 && {_index in _positions}) then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
} else {
_index = _positions select 0;
if (!isNil "_index") then {
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { _return = CANGETINDRIVER;
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
};
}; };
};
default {}; case "gunner" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "commander" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "copilot" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = CANGETINTURRETINDEX
};
case "turret" : {
private ["_turrets", "_turretConfig"];
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
}) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
} else {
for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
};
};
};
};
case "ffv" : {
private ["_turrets", "_turretConfig"];
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
}) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
} else {
for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
_return = true
};
};
};
};
case "codriver" : {
private "_positions";
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
{
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
} forEach crew _vehicle;
if (_index != -1 && {_index in _positions}) then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
} else {
_index = _positions select 0;
if (!isNil "_index") then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
};
};
};
case "cargo" : {
private "_positions";
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
{
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
} forEach crew _vehicle;
if (_index != -1 && {_index in _positions}) then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
} else {
_index = _positions select 0;
if (!isNil "_index") then {
_radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo"));
if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then {
_selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver"));
_selectionPosition2 set [0, -(_selectionPosition2 select 0)];
};
_return = true
};
};
};
default {};
}; };
private "_fnc_isInRange"; private "_fnc_isInRange";
_fnc_isInRange = { _fnc_isInRange = {
if (_radius == 0) exitWith {true}; if (_radius == 0) exitWith {true};
private ["_unitPosition", "_distance"]; private ["_unitPosition", "_distance"];
_unitPosition = getPos _unit; _unitPosition = getPos _unit;
_distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
if (!isNil "_selectionPosition2") then { if (!isNil "_selectionPosition2") then {
_distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2));
}; };
_distance < _radius _distance < _radius
}; };
// if you want into the cargo and you can't, then check ffv turrets aswell // if you want into the cargo and you can't, then check ffv turrets aswell
if (_position == "cargo") exitWith { if (_position == "cargo") exitWith {
if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else {
[_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition);
} };
}; };
_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange} _return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}

View File

@ -8,6 +8,7 @@
* @PublicAPI: true * @PublicAPI: true
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit","_return"];
_unit = _this select 0; PARAMS_1(_unit);
(((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested))) (((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested)))

View File

@ -14,10 +14,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target", "_exceptions"]; private ["_exceptions"];
PARAMS_2(_unit,_target);
_unit = _this select 0;
_target = _this select 1;
_exceptions = if (count _this > 2) then { _exceptions = if (count _this > 2) then {
_this select 2; _this select 2;
} else { } else {

View File

@ -3,9 +3,9 @@
// returns true if the unit is on foot or in a ffv position // returns true if the unit is on foot or in a ffv position
private ["_unit", "_config"]; private ["_config"];
_unit = _this select 0; PARAMS_1(_unit);
if (_unit == vehicle _unit) exitWith {true}; if (_unit == vehicle _unit) exitWith {true};

View File

@ -14,11 +14,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; private ["_adjustSpeed", "_vdir", "_dir", "_up", "_vup", "_vel", "_vlat"];
_projectile = _this select 0; PARAMS_3(_projectile,_adjustDir,_adjustUp);
_adjustDir = _this select 1;
_adjustUp = _this select 2;
_adjustSpeed = if (count _this > 3) then { _adjustSpeed = if (count _this > 3) then {
_this select 3 _this select 3

View File

@ -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;

View File

@ -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

View File

@ -13,36 +13,37 @@
#include "script_component.hpp" #include "script_component.hpp"
_this spawn { _this spawn {
_target = _this select 0; PARAMS_2(_target,_ignoreDead);
_ignoreDead = _this select 1; private["_inVehicle", "_position", "_vehiclePlayer", "_vehicleTarget"];
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
};
}; };

View File

@ -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};

View File

@ -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};

View File

@ -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"];
_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 {

View File

@ -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"]);

View File

@ -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;

View File

@ -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;
@ -37,6 +37,7 @@ if (_state) then {
_dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse);
_dlg displayAddEventHandler ["KeyDown", { _dlg displayAddEventHandler ["KeyDown", {
private ["_key", "_dlg", "_ctrl", "_config", "_acc", "_index"];
_key = _this select 1; _key = _this select 1;
if (_key == 1 && {alive player}) then { if (_key == 1 && {alive player}) then {

View File

@ -2,7 +2,7 @@
* Author: Glowbal * Author: Glowbal
* *
* Draw progress bar and execute given function if succesful. * Draw progress bar and execute given function if succesful.
* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode]
* *
* Argument: * Argument:
* 0: icon ID <STRING> * 0: icon ID <STRING>
@ -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;
@ -62,7 +61,7 @@ _refresh = {
_allControls = []; _allControls = [];
private ["_ctrl", "_setting"]; private ["_ctrl", "_setting", "_position"];
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then { if (_setting > 0) then {
{ {
@ -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;

View File

@ -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];

View File

@ -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};

View File

@ -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);

View File

@ -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;
{ {

View File

@ -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);

View File

@ -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;

View File

@ -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];

View File

@ -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,{});

View File

@ -12,7 +12,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_2_PVT(_this,_func,_params); PARAMS_2(_func,_params);
[ [
{ {

View File

@ -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];
}; };

View File

@ -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);
}; };
}; };

View File

@ -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", []]);

View File

@ -9,61 +9,59 @@
private "_fnc_logEntries"; private "_fnc_logEntries";
_fnc_logEntries = { _fnc_logEntries = {
private ["_c", "_d", "_p", "_t", "_e"]; private ["_p", "_t", "_e", "_a", "_i"];
_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;

View File

@ -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

View File

@ -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;

View File

@ -9,7 +9,7 @@
* Nothing * Nothing
* *
* Example: * Example:
* [_player] call ace_common_fnc_fixLoweredRifleAnimation * [ACE_player] call ace_common_fnc_fixLoweredRifleAnimation
* *
* Public: No * Public: No
*/ */
@ -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);
}; };

View File

@ -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 {

View File

@ -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 {[
"", "",

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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"};

View File

@ -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"};

View File

@ -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.

View File

@ -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),[]])

View File

@ -1,15 +1,15 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
private ["_configName", "_index"]; private ["_configName", "_index", "_config"];
_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

View File

@ -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

View File

@ -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", "_dir"];
_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]];

View File

@ -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", "_dir"];
_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]];

View File

@ -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

View File

@ -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

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_config", "_hitpoints"]; private ["_config", "_hitpoints", "_i"];
_vehicle = _this select 0; PARAMS_1(_vehicle);
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_config", "_hitpoints", "_selections"]; private ["_config", "_hitpoints", "_selections", "_i"];
_vehicle = _this select 0; PARAMS_1(_vehicle);
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;

View File

@ -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;

View File

@ -14,9 +14,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_item"; PARAMS_1(_item);
_item = _this select 0; private ["_cfgType"];
_cfgType = [_item] call FUNC(getConfigType); _cfgType = [_item] call FUNC(getConfigType);
@ -46,7 +46,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"]};

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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

View File

@ -10,9 +10,9 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit","_magazine"]; PARAMS_2(_unit,_magazine);
_unit = _this select 0;
_magazine = _this select 1; private ["_return"];
_return = 0; _return = 0;
if (_unit isKindOf "CAManBase") then { if (_unit isKindOf "CAManBase") then {
@ -20,9 +20,9 @@ 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);
}; };
_return _return

View File

@ -13,9 +13,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_config", "_hitpoints", "_selections"]; private ["_config", "_hitpoints", "_selections", "_i"];
_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"];

View File

@ -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 = [];

View File

@ -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]);

View File

@ -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);

View File

@ -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)];

View File

@ -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 {[]};

View File

@ -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];

View File

@ -12,28 +12,27 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"]; private ["_index", "_offset", "_config2", "_foundClasses", "_a"];
_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

View File

@ -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

View File

@ -12,8 +12,8 @@
*/ */
#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 ["_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov", "_gunBeg", "_gunEnd", "_pipDir"];
_turret = [_vehicle, _position] call CBA_fnc_getTurret; _turret = [_vehicle, _position] call CBA_fnc_getTurret;
_pov = getText (_turret >> "memoryPointGunnerOptics"); _pov = getText (_turret >> "memoryPointGunnerOptics");
@ -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 {

View File

@ -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

View File

@ -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 {[]};

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_type", "_config", "_turrets", "_fnc_addTurret"]; private ["_config", "_turrets", "_fnc_addTurret", "_varName"];
_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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_config", "_cargo", "_codrivers"]; private ["_config", "_cargo", "_codrivers", "_index"];
_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

View File

@ -11,9 +11,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_config", "_cargo", "_codrivers"]; private ["_config", "_cargo", "_codrivers", "_index"];
_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

View File

@ -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 = [];

View File

@ -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;

View File

@ -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};

View File

@ -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 = [];
{ {

View File

@ -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");

View File

@ -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);

View File

@ -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};
} }

Some files were not shown because too many files have changed in this diff Show More