Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3 into repair

This commit is contained in:
commy2 2015-03-26 23:33:28 +01:00
commit 4077ad3667
443 changed files with 6479 additions and 3674 deletions

View File

@ -6,7 +6,7 @@
displayName = "$STR_ACE_Attach_AttachDetach"; \ displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \ exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \ icon = PATHTOF(UI\attach_ca.paa); \
@ -16,7 +16,7 @@
displayName = "$STR_ACE_Attach_Detach"; \ displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \ exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \ icon = PATHTOF(UI\detach_ca.paa); \
@ -57,7 +57,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_AttachDetach"; displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach))); condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
exceptions[] = {"ACE_Drag_isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\attach_ca.paa); icon = PATHTOF(UI\attach_ca.paa);
@ -67,7 +67,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_Detach"; displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach))); condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) ); statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
exceptions[] = {"ACE_Drag_isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\detach_ca.paa); icon = PATHTOF(UI\detach_ca.paa);

View File

@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {"ACE_IR_Strobe_Item"}; weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"}; requiredAddons[] = {"ace_interaction"};
author[] = {"KoffeinFlummi","eRazeri","CAA-Picard"}; author[] = {"KoffeinFlummi","eRazeri","esteldunedain"};
authorUrl = "https://github.com/KoffeinFlummi/"; authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG; VERSION_CONFIG;
}; };

View File

@ -1,5 +1,5 @@
/* /*
* Author: eRazeri and CAA-Picard * Author: eRazeri and esteldunedain
* Attach an item to the unit * Attach an item to the unit
* *
* Arguments: * Arguments:

View File

@ -1,5 +1,5 @@
/* /*
* Author: eRazeri and CAA-Picard * Author: eRazeri and esteldunedain
* Detach an item from a unit * Detach an item from a unit
* *
* Arguments: * Arguments:

View File

@ -39,7 +39,7 @@ class CfgVehicles {
distance = 4; distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting)); condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3; priority = 2.3;
@ -50,7 +50,7 @@ class CfgVehicles {
distance = 4; distance = 4;
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
exceptions[] = {QGVAR(isNotEscorting)}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2; priority = 2.2;
@ -74,7 +74,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Captives_StopEscorting"; displayName = "$STR_ACE_Captives_StopEscorting";
condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting)); condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive)); statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
priority = 2.3; priority = 2.3;
hotkey = "C"; hotkey = "C";
@ -91,7 +91,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Captives_StopSurrendering"; displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender)); condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered)); statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
exceptions[] = {QGVAR(isNotSurrendering)}; exceptions[] = {"isNotSurrendering"};
showDisabled = 0; showDisabled = 0;
priority = 0; priority = 0;
}; };
@ -107,7 +107,7 @@ class CfgVehicles {
distance = 4; \ distance = 4; \
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
exceptions[] = {QGVAR(isNotEscorting)}; \ exceptions[] = {"isNotEscorting"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 1.2; \ priority = 1.2; \
hotkey = "L"; \ hotkey = "L"; \
@ -178,7 +178,7 @@ class CfgVehicles {
curatorCost = 0; //??? curatorCost = 0; //???
isGlobal = 1; //run global isGlobal = 1; //run global
isTriggerActivated = 1; //Wait for triggers isTriggerActivated = 1; //Wait for triggers
// icon = QUOTE(PATHTOF(ui\todo.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
functionPriority = 0; functionPriority = 0;
class Arguments {}; class Arguments {};
class ModuleDescription: ModuleDescription { class ModuleDescription: ModuleDescription {

View File

@ -1,5 +1,6 @@
class CfgActions { class CfgActions {
// fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
class None; class None;
class TakeWeapon: None { class TakeWeapon: None {
show = 0; show = 0;

View File

@ -42,19 +42,3 @@ class Extended_Respawn_EventHandlers {
}; };
}; };
}; };
class Extended_Killed_EventHandlers {
class CAManBase {
class GVAR(dropObject) {
Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
};
};
};
class Extended_GetIn_EventHandlers {
class CAManBase {
class GVAR(dropObject) {
GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
};
};
};

View File

@ -0,0 +1,76 @@
class CfgMovesBasic {
class Default;
class Actions {
// fixes grab animation with equipped pistol
class NoActions;
class PistolStandActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
class LauncherKneelActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
class CivilStandActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class AgonyBase;
class AgonyBaseRfl;
class StandBase;
class HealBase;
class States {
// fixes being able to reload in some animations, can't remember now what exactly
class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
canReload = 0;
};
class AmovPpneMstpSnonWnonDnon_injured;
class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
canReload = 0;
};
class AmovPpneMstpSrasWrflDnon_injured;
class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
canReload = 0;
};
// mark as on ladder animation
class LadderCivilStatic: StandBase {
ACE_isLadder = 1;
};
// dunno, important
class AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1;
class AcinPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
enableDirectControl = 1;
};
class AcinPknlMwlkSnonWnonDb: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
enableDirectControl = 1;
};
// fix falling back to unconsciousness animation and disable rotating in that state
class Unconscious: Default {
ConnectTo[] = {};
head = "headNo";
forceAim = 1;
static = 1;
};
// idk. Flummi?
class AinvPknlMstpSnonWnonDnon_medic0: HealBase {
variantsPlayer[] = {};
};
};
};

View File

@ -33,7 +33,7 @@ class CfgVehicles {
function = QFUNC(moduleCheckPBOs); function = QFUNC(moduleCheckPBOs);
scope = 2; scope = 2;
isGlobal = 1; isGlobal = 1;
icon = QUOTE(PATHTOF(UI\IconCheckPBO_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
class Arguments { class Arguments {
class Action { class Action {
displayName = "Action"; displayName = "Action";
@ -87,6 +87,7 @@ class CfgVehicles {
displayName = "LSD Vehicles"; displayName = "LSD Vehicles";
function = "ACE_Common_fnc_moduleLSDVehicles"; function = "ACE_Common_fnc_moduleLSDVehicles";
scope = 2; scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa));
isGlobal = 1; isGlobal = 1;
class Arguments { class Arguments {
}; };

View File

@ -218,6 +218,7 @@ class CfgVoice {
displayName = "$STR_ACE_Common_NoVoice"; displayName = "$STR_ACE_Common_NoVoice";
}; };
}; };
class CfgVoiceTypes { class CfgVoiceTypes {
class ACE_NoVoice { class ACE_NoVoice {
name = "$STR_ACE_Common_NoVoice"; name = "$STR_ACE_Common_NoVoice";

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
class CfgMovesBasic;
class CfgMovesMaleSdr: CfgMovesBasic {
class AgonyBase;
class AgonyBaseRfl;
class StandBase;
class States {
class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
canReload = 0;
};
class AmovPpneMstpSnonWnonDnon_injured;
class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
canReload = 0;
};
class AmovPpneMstpSrasWrflDnon_injured;
class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
canReload = 0;
};
class LadderCivilStatic: StandBase {
ACE_isLadder = 1;
};
};
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -33,6 +33,8 @@ if (hasInterface) then {
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]); _this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
}] call FUNC(addEventhandler); }] call FUNC(addEventhandler);
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
// hack to get PFH to work in briefing // hack to get PFH to work in briefing
[QGVAR(onBriefingPFH), "onEachFrame", { [QGVAR(onBriefingPFH), "onEachFrame", {
if (time > 0) exitWith { if (time > 0) exitWith {
@ -171,8 +173,6 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
}, 0, []] call cba_fnc_addPerFrameHandler; }, 0, []] call cba_fnc_addPerFrameHandler;
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
[QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable);
[QGVAR(carriedObj),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable);
["VehicleSetFuel", { ["VehicleSetFuel", {
PARAMS_2(_vehicle,_fuelLevel); PARAMS_2(_vehicle,_fuelLevel);
@ -183,3 +183,4 @@ _vehicle setFuel _fuelLevel;
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition);

View File

@ -15,7 +15,6 @@ PREP(adminKick);
PREP(ambientBrightness); PREP(ambientBrightness);
PREP(applyForceWalkStatus); PREP(applyForceWalkStatus);
PREP(ASLToPosition); PREP(ASLToPosition);
PREP(beingCarried);
PREP(binarizeNumber); PREP(binarizeNumber);
PREP(blurScreen); PREP(blurScreen);
PREP(cachedCall); PREP(cachedCall);
@ -23,8 +22,6 @@ PREP(canGetInPosition);
PREP(canInteract); PREP(canInteract);
PREP(canInteractWith); PREP(canInteractWith);
PREP(canUseWeapon); PREP(canUseWeapon);
PREP(carriedByObj);
PREP(carryObj);
PREP(changeProjectileDirection); PREP(changeProjectileDirection);
PREP(checkPBOs); PREP(checkPBOs);
PREP(claim); PREP(claim);
@ -58,8 +55,6 @@ PREP(fixPosition);
PREP(getAllDefinedSetVariables); PREP(getAllDefinedSetVariables);
PREP(getAllGear); PREP(getAllGear);
PREP(getCaptivityStatus); PREP(getCaptivityStatus);
PREP(getCarriedBy);
PREP(getCarriedObj);
PREP(getConfigCommander); PREP(getConfigCommander);
PREP(getConfigGunner); PREP(getConfigGunner);
PREP(getDeathAnim); PREP(getDeathAnim);
@ -122,7 +117,6 @@ PREP(isModLoaded);
PREP(isPlayer); PREP(isPlayer);
PREP(isTurnedOut); PREP(isTurnedOut);
PREP(letterToCode); PREP(letterToCode);
PREP(limitMovementSpeed);
PREP(loadPerson); PREP(loadPerson);
PREP(loadPersonLocal); PREP(loadPersonLocal);
PREP(loadSettingsFromProfile); PREP(loadSettingsFromProfile);
@ -160,7 +154,6 @@ PREP(serverLog);
PREP(setArrestState); PREP(setArrestState);
PREP(setCanInteract); PREP(setCanInteract);
PREP(setCaptivityStatus); PREP(setCaptivityStatus);
PREP(setCarriedBy);
PREP(setDefinedVariable); PREP(setDefinedVariable);
PREP(setDisableUserInputStatus); PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus); PREP(setForceWalkStatus);
@ -258,6 +251,9 @@ if (hasInterface) then {
}, 0, []] call cba_fnc_addPerFrameHandler; }, 0, []] call cba_fnc_addPerFrameHandler;
}; };
// Init toHex
[0] call FUNC(toHex);
ADDON = true; ADDON = true;
isHC = !(hasInterface || isDedicated); isHC = !(hasInterface || isDedicated);

View File

@ -13,11 +13,16 @@ class CfgPatches {
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgSounds.hpp" #include "CfgSounds.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "CfgMagazines.hpp" #include "CfgMagazines.hpp"
#include "CfgActions.hpp"
#include "CfgMoves.hpp"
#include "CfgVoice.hpp"
class ACE_Rsc_Display_Base { class ACE_Rsc_Display_Base {
idd = -1; idd = -1;
type = 0; type = 0;
@ -82,12 +87,12 @@ class ACE_Settings {
value = 0; value = 0;
typeName = "BOOL"; typeName = "BOOL";
}; };
class GVAR(enableNumberHotkeys) { /*class GVAR(enableNumberHotkeys) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
isClientSetable = 1; isClientSetable = 1;
displayName = "$STR_ACE_Common_EnableNumberHotkeys"; displayName = "$STR_ACE_Common_EnableNumberHotkeys";
}; };*/
class GVAR(settingFeedbackIcons) { class GVAR(settingFeedbackIcons) {
value = 1; value = 1;
typeName = "SCALAR"; typeName = "SCALAR";
@ -126,9 +131,6 @@ class ACE_Settings {
#include <ProgressScreen.hpp> #include <ProgressScreen.hpp>
#include <HintConfig.hpp> #include <HintConfig.hpp>
#include <RscInfoType.hpp> #include <RscInfoType.hpp>
#include <FixPickup.hpp>
#include <FixAnimations.hpp>
#include <NoVoice.hpp>
class CfgUIGrids { class CfgUIGrids {
class IGUI { class IGUI {

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Converts ASL to Arma "Position" * Converts ASL to Arma "Position"
* *
* Arguments: * Arguments:

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Add line to draw on debug * Add line to draw on debug
* *

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Adds a new setting at runtime, with all it's metadata. * Adds a new setting at runtime, with all it's metadata.
* If has only local effects. * If has only local effects.
* *

View File

@ -1,12 +0,0 @@
/**
* fn_beingCarried.sqf
* @Descr: Check if object is being carried
* @Author: Glowbal
*
* @Arguments: [object OBJECT]
* @Return: BOOL True if object is being carried
* @PublicAPI: true
*/
#include "script_component.hpp"
!(isNull ([_this select 0] call FUNC(getCarriedObj)));

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard and Jaynus * Author: esteldunedain and Jaynus
* Returns the result of the function and caches it up to a given time or event * Returns the result of the function and caches it up to a given time or event
* *
* Arguments: * Arguments:

View File

@ -69,7 +69,7 @@ switch (_position) do {
case "gunner" : { case "gunner" : {
private "_turretConfig"; private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretGunner); _turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -82,7 +82,7 @@ switch (_position) do {
case "commander" : { case "commander" : {
private "_turretConfig"; private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretCommander); _turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -95,7 +95,7 @@ switch (_position) do {
case "copilot" : { case "copilot" : {
private "_turretConfig"; private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot); _turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -108,7 +108,7 @@ switch (_position) do {
case "turret" : { case "turret" : {
private ["_turrets", "_turretConfig"]; private ["_turrets", "_turretConfig"];
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther); _turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX CANGETINTURRETINDEX
@ -136,7 +136,7 @@ switch (_position) do {
case "ffv" : { case "ffv" : {
private ["_turrets", "_turretConfig"]; private ["_turrets", "_turretConfig"];
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); _turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX CANGETINTURRETINDEX

View File

@ -1,13 +0,0 @@
/**
* fn_carriedByObj.sqf
* @Descr: Check if object A is being carried by object B.
* @Author: Glowbal
*
* @Arguments: [object OBJECT, unit OBJECT]
* @Return: BOOL True if B is carrying A.
* @PublicAPI: true
*/
#include "script_component.hpp"
([(_this select 0)] call FUNC(getCarriedBy) == [(_this select 1)] call FUNC(getCarriedBy));

View File

@ -1,72 +0,0 @@
/**
* fn_carryObj.sqf
* @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)]
* @Return: BOOL Returns true if succesful
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"];
_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param;
_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param;
_fallDown = false;
if (count _this > 3) then {
_fallDown = _this select 3;
};
_return = false;
[format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug);
if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then {
if (vehicle _unit != _unit) exitwith {};
if (!isNull _to) then {
if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then {
_return = true;
_unit setvariable [QGVAR(carriedObj),_to,true];
if (_fallDown) then {
// [_unit,_fallDown] call FUNC(limitMovementSpeed);
};
[_to, _unit] call FUNC(setCarriedBy);
if (count _this > 2) then {
if (count (_this select 2) == 3) then {
_to attachTo [_unit,(_this select 2)];
[format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug);
};
};
["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
// ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
};
} else {
if (!isNull ([_unit] call FUNC(getCarriedObj))) then {
[format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug);
_carriedObj = ([_unit] call FUNC(getCarriedObj));
detach _carriedObj;
//_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0];
if (!surfaceIsWater getPos _unit) then {
_positionUnit = getPosATL _carriedObj;
_positionUnit set [2, ((getPosATL _unit) select 2) + 0.1];
_carriedObj setPosATL _positionUnit;
} else {
_positionUnit = getPosASL _carriedObj;
_positionUnit set [2, ((getPosASL _unit) select 2) + 0.1];
_carriedObj setPosASL _positionUnit;
};
[[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy);
_unit setvariable [QGVAR(carriedObj),_to,true];
_return = true;
["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
// ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
};
};
} else {
[format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug);
};
_return

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Returns a orthonormal system of reference aligned with the supplied vector * Returns a orthonormal system of reference aligned with the supplied vector
* *

View File

@ -50,13 +50,13 @@ if (_state) then {
}; };
_ctrl = _dlg displayctrl 103; _ctrl = _dlg displayctrl 103;
_ctrl ctrlSetEventHandler ["buttonClick", "while {!isNull (uiNamespace getVariable ['GVAR(dlgDisableMouse)', displayNull])} do {closeDialog 0}; failMission 'LOSER'; [false] call FUNC(disableUserInput);"]; _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable true; _ctrl ctrlEnable true;
_ctrl ctrlSetText "ABORT"; _ctrl ctrlSetText "ABORT";
_ctrl ctrlSetTooltip "Abort."; _ctrl ctrlSetTooltip "Abort.";
_ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer);
_ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; player setDamage 1; [false] call FUNC(disableUserInput);"]; _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}});
_ctrl ctrlSetText "RESPAWN"; _ctrl ctrlSetText "RESPAWN";
_ctrl ctrlSetTooltip "Respawn."; _ctrl ctrlSetTooltip "Respawn.";

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Deletes a cached result * Deletes a cached result
* *
* Arguments: * Arguments:

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Executes a code on the next frame * Executes a code on the next frame
* *

View File

@ -1,13 +0,0 @@
/**
* fn_getCarriedBy.sqf
* @Descr: Get the object that is carrying given unit or object
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: OBJECT Returns the object that is carrying the unit. Otherwise returns ObjNull
* @PublicAPI: true
*/
#include "script_component.hpp"
((_this select 0) getvariable [QGVAR(carriedBy),objNull]);

View File

@ -1,13 +0,0 @@
/**
* fn_getCarriedObj.sqf
* @Descr: Grab the registered carried object
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: OBJECT Returns the object that the unit is currently carrying. If not carrying, returns ObjNull
* @PublicAPI: true
*/
#include "script_component.hpp"
((_this select 0) getvariable [QGVAR(carriedObj),objNull]);

View File

@ -4,7 +4,7 @@
* Get the commander config of a vehicles turret. * Get the commander config of a vehicles turret.
* *
* Argument: * Argument:
* 0: vehicle type (String) * 0: vehicle (Object)
* *
* Return value: * Return value:
* Commander config (Config) * Commander config (Config)
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0; _vehicle = _this select 0;
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretCommander); _turret = [_vehicle] call FUNC(getTurretCommander);
[_config, _turret] call FUNC(getTurretConfigPath) [_config, _turret] call FUNC(getTurretConfigPath)

View File

@ -4,7 +4,7 @@
* Get the gunner config of a vehicles turret. * Get the gunner config of a vehicles turret.
* *
* Argument: * Argument:
* 0: vehicle type (String) * 0: vehicle (Object)
* *
* Return value: * Return value:
* Gunner config (Config) * Gunner config (Config)
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0; _vehicle = _this select 0;
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretGunner); _turret = [_vehicle] call FUNC(getTurretGunner);
[_config, _turret] call FUNC(getTurretConfigPath) [_config, _turret] call FUNC(getTurretConfigPath)

View File

@ -4,23 +4,23 @@
* Gets the turret index of door gunners * Gets the turret index of door gunners
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret indexes of the door gunner. Empty array means no gunner position. (Array) * Turret indexes of the door gunner. Empty array means no gunner position. (Array)
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicleType", "_turrets", "_doorTurrets", "_config"]; private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
_vehicleType = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicleType] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_doorTurrets = []; _doorTurrets = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicleType; _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 {

View File

@ -64,7 +64,7 @@ switch (_position) do {
}; };
case "gunner" : { case "gunner" : {
_turret = [typeOf _vehicle] call FUNC(getTurretGunner); _turret = [_vehicle] call FUNC(getTurretGunner);
if (CANGETINTURRETINDEX) then { if (CANGETINTURRETINDEX) then {
_script = [ _script = [
@ -75,7 +75,7 @@ switch (_position) do {
}; };
case "commander" : { case "commander" : {
_turret = [typeOf _vehicle] call FUNC(getTurretCommander); _turret = [_vehicle] call FUNC(getTurretCommander);
if (CANGETINTURRETINDEX) then { if (CANGETINTURRETINDEX) then {
_script = [ _script = [
@ -86,7 +86,7 @@ switch (_position) do {
}; };
case "copilot" : { case "copilot" : {
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot); _turret = [_vehicle] call FUNC(getTurretCopilot);
if (CANGETINTURRETINDEX) then { if (CANGETINTURRETINDEX) then {
_script = [ _script = [
@ -100,7 +100,7 @@ switch (_position) do {
case "turret" : { case "turret" : {
private "_turrets"; private "_turrets";
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther); _turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [ _script = [
@ -127,7 +127,7 @@ switch (_position) do {
case "ffv" : { case "ffv" : {
private "_turrets"; private "_turrets";
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); _turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [ _script = [

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Returns the metadata of a setting if it exists * Returns the metadata of a setting if it exists
* *
* Arguments: * Arguments:

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles commander. * Get the turret index of a vehicles commander.
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret index of the vehicles commander. Empty array means no observer position. (Array) * Turret index of the vehicles commander. Empty array means no observer position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_turret = []; _turret = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles copilot. * Get the turret index of a vehicles copilot.
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret index of the vehicles gunner. Empty array means no copilot position. (Array) * Turret index of the vehicles gunner. Empty array means no copilot position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_turret = []; _turret = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles gunner. * Get the turret index of a vehicles gunner.
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret index of the vehicles gunner. Empty array means no gunner position. (Array) * Turret index of the vehicles gunner. Empty array means no gunner position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_turret = []; _turret = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -18,7 +18,6 @@ _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]}; if (_unit == _vehicle) exitWith {[]};
//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true]; _turrets = allTurrets [_vehicle, true];
_units = []; _units = [];

View File

@ -4,7 +4,7 @@
* Get the turret indices of ffv turrets. * Get the turret indices of ffv turrets.
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array) * Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_turret = []; _turret = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret indices of other turrets (not gunner, commander, copilot or ffv). * Get the turret indices of other turrets (not gunner, commander, copilot or ffv).
* *
* Argument: * Argument:
* 0: Vehicle type (String) * 0: Vehicle (Object)
* *
* Return value: * Return value:
* Turret index of the vehicles gunner. Empty array means no other turrets. (Array) * Turret index of the vehicles gunner. Empty array means no other turrets. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets); _turrets = allTurrets [_vehicle, true];
_turret = []; _turret = [];
{ {
_config = configFile >> "CfgVehicles" >> _vehicle; _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -19,7 +19,7 @@ _vector2 = _this select 1;
_newVector = []; _newVector = [];
for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do { for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do {
_newVector = _newVector + [(_vector1 select _i) * (_vector2 select _i)]; _newVector pushBack ((_vector1 select _i) * (_vector2 select _i));
}; };
_newVector _newVector

View File

@ -1,53 +0,0 @@
/**
* fn_limitMovementSpeed.sqf
* @Descr: Limits the movement speed of a unit
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, fallDown BOOL (Optional)]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_carriedObj"];
_unit = _this select 0;
_fallDown = false;
if (count _this > 1) then {
_fallDown = _this select 1;
};
if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith {
_unit setvariable [QGVAR(limitMovementSpeed),nil,true];
};
[{
private["_unit","_fallDown","_carriedObj"];
_unit = (_this select 0) select 0;
_fallDown = (_this select 0) select 1;
_carriedObj = [_unit] call FUNC(getCarriedObj);
if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if !((!isNull _carriedObj) && (alive _unit)) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then {
_unit setVelocity [0,0,0];
if (_fallDown) then {
_unit playMove "amovppnemstpsraswrfldnon";
};
if (_carriedObj isKindOf "Man") then {
hint "You can not move this fast while transporting this person.";
} else {
hint "You can not move this fast while carrying this object";
};
[_unit,ObjNull] call FUNC(carryObj);
};
}, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler;

View File

@ -35,8 +35,6 @@ if (_unit distance _loadcar <= 10) then {
}; };
if (!isNull _vehicle) then { if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
[_caller,objNull] call FUNC(carryObj);
[_unit,objNull] call FUNC(carryObj);
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
}; };
_vehicle _vehicle

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Load the user setable settings from the user profile. * Load the user setable settings from the user profile.
* Config < Server UserConfig < Mission Config < Client settings * Config < Server UserConfig < Mission Config < Client settings
* *

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Load the parameters on the server. * Load the parameters on the server.
* Config < Server UserConfig < Mission Config * Config < Server UserConfig < Mission Config
* *

View File

@ -1,15 +1,4 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
private ["_array", "_index"]; [allControls findDisplay _this, {ctrlIDC _this}] call FUNC(map)
_array = [];
for "_index" from 0 to 10000 do {
if (str (findDisplay _this displayCtrl _index) != "No control") then {
diag_log text str (findDisplay _this displayCtrl _index);
_array pushBack _index;
};
};
_array;

View File

@ -1,15 +1,4 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
private ["_array", "_index"]; [allDisplays, {ctrlIDD _this}] call FUNC(map)
_array = [];
for "_index" from 0 to 10000 do {
if (str (findDisplay _index) != "No Display") then {
diag_log text str findDisplay _index;
_array pushBack _index;
};
};
_array;

View File

@ -12,33 +12,29 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_number", "_minLength", "_length", "_digits", "_index", "_count"]; private ["_number", "_minLength", "_length", "_digits"];
_number = _this select 0; _number = _this select 0;
_minLength = _this select 1; _minLength = _this select 1;
_number = _number min 999999; _number = _number min 999999;
_length = floor (log _number + 1);
if !(isNil "_minLength") then {_length = (_length max _minLength) min 6}; _number = str _number;
_length = count _number;
if (isNil "_minLength") then {_minLength = _length};
_minLength = _minLength min 6;
while {_length < _minLength} do {
_number = "0" + _number;
_length = _length + 1;
};
_digits = []; _digits = [];
for "_x" from 0 to (_length - 1) do {
if (_number < 1) exitWith { _digits pushBack parseNumber (_number select [_x, 1]);
for "_index" from 0 to (_length - 1) do {
_digits set [_index, 0];
};
_digits
}; };
while {
_count = count _digits;
_count < _length
} do {
_digit = floor (_number / (10 ^ (_length - _count - 1)));
{
_digit = _digit - _x * (10 ^ (_count - _forEachIndex));
} forEach _digits;
_digits set [_count, _digit];
};
_digits _digits

View File

@ -12,14 +12,24 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_digits", "_count", "_string", "_index"]; private ["_number", "_minLength", "_length"];
_digits = _this call FUNC(numberToDigits); _number = _this select 0;
_minLength = _this select 1;
_count = count _digits; _number = _number min 999999;
_string = ""; _number = str _number;
for "_index" from 0 to (_count - 1) do {
_string = _string + str (_digits select _index); _length = count _number;
if (isNil "_minLength") then {_minLength = _length};
_minLength = _minLength min 6;
while {_length < _minLength} do {
_number = "0" + _number;
_length = _length + 1;
}; };
_string
_number

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Converts Arma "Position" to ASL * Converts Arma "Position" to ASL
* *
* Arguments: * Arguments:

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module. * Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
* Must be called on the server, effect is global. * Must be called on the server, effect is global.

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Removes a magazine from the unit that has an specific ammo count * Removes a magazine from the unit that has an specific ammo count
* *
* Argument: * Argument:

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard, based on Killzone-Kid code * Author: esteldunedain, based on Killzone-Kid code
* *
* Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text. * Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text.
* *

View File

@ -1,4 +1,4 @@
// by CAA-Picard // by esteldunedain
#include "script_component.hpp" #include "script_component.hpp"
if (isServer) then { if (isServer) then {

View File

@ -1,21 +0,0 @@
/**
* fn_setCarriedBy.sqf
* @Descr: Registers an object being carried by another object
* @Author: Glowbal
*
* @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT]
* @Return: BOOL True if succesfully registered
* @PublicAPI: false
*/
#include "script_component.hpp"
private ["_unit","_to","_return"];
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
_to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param;
_return = false;
if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then {
_return = true;
_unit setvariable [QGVAR(carriedBy),_to,true];
};
_return

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Sets the value of an ACE_Parameter and makes it public. * Sets the value of an ACE_Parameter and makes it public.
* *

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Change the value of an existing setting if it was not previously forced. Force if neccesary. * Change the value of an existing setting if it was not previously forced. Force if neccesary.
* If executed on clients it has local effect. * If executed on clients it has local effect.
* If executed on server it can have global effect if the last parameter is set to true. * If executed on server it can have global effect if the last parameter is set to true.

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Load a setting from config if it was not previosuly forced. Force if neccesary. * Load a setting from config if it was not previosuly forced. Force if neccesary.
* *
* Arguments: * Arguments:

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* Schedules the publishment of an object variable to reduce network overhead * Schedules the publishment of an object variable to reduce network overhead
* *
* Arguments: * Arguments:

View File

@ -1,31 +1,31 @@
/* /*
Author: commy2 Author: commy2, esteldunedain
Description: Description:
Converts number to hexadecimal number Converts number to hexadecimal number
Arguments: Arguments:
A number A number between 0 and 255 <NUMBER>
Return Value: Return Value:
A hexadecimal number, String A hexadecimal number, String
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_number", "_minLength", "_sign", "_hex", "_rest"]; private ["_number"];
_number = ((round abs (_this select 0)) max 0) min 255;
_number = _this select 0; if (isNil QGVAR(hexArray)) then {
_minLength = _this select 1; private ["_minLength", "_i", "_num", "_hex", "_rest"];
if (isNil "_minLength") then {_minLength = 1}; GVAR(hexArray) = [];
_minLength = 2;
for [{_i = 0;}, {_i < 256}, {_i = _i + 1}] do {
_num = _i;
_hex = ["", "0"] select (_i == 0);
_sign = ["", "-"] select (_number < 0); while {_num > 0} do {
_rest = _num mod 16;
_number = round abs _number;
_hex = ["", "0"] select (_number == 0);
while {_number > 0} do {
_rest = _number mod 16;
_rest = switch _rest do { _rest = switch _rest do {
case 10 : {"A"}; case 10 : {"A"};
case 11 : {"B"}; case 11 : {"B"};
@ -35,13 +35,14 @@ while {_number > 0} do {
case 15 : {"F"}; case 15 : {"F"};
default {str _rest}; default {str _rest};
}; };
_number = floor (_number / 16); _num = floor (_num / 16);
_hex = _rest + _hex; _hex = _rest + _hex;
}; };
while {count toArray _hex < _minLength} do { while {count toArray _hex < _minLength} do {
_hex = "0" + _hex; _hex = "0" + _hex;
}; };
GVAR(hexArray) pushBack _hex;
};
};
_sign + _hex (GVAR(hexArray) select _number)

View File

@ -1,5 +1,5 @@
/* /*
* Author: CAA-Picard * Author: esteldunedain
* *
* Executes a code once with a given game time delay, using a PFH * Executes a code once with a given game time delay, using a PFH
* *

View File

@ -13,6 +13,11 @@ class Extended_PostInit_EventHandlers {
}; };
class Extended_Init_EventHandlers { class Extended_Init_EventHandlers {
class CAManBase {
class ADDON {
init = QUOTE(_this call DFUNC(initPerson));
};
};
class StaticWeapon { class StaticWeapon {
class ADDON { class ADDON {
init = QUOTE(_this call DFUNC(initObject)); init = QUOTE(_this call DFUNC(initObject));

View File

@ -16,4 +16,10 @@ if (isNil "ACE_maxWeightCarry") then {
// release object on player change. This does work when returning to lobby, but not when hard disconnecting. // release object on player change. This does work when returning to lobby, but not when hard disconnecting.
["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); ["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler);
// handle waking up dragged unit and falling unconscious while dragging
["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
//@todo Captivity?

View File

@ -18,10 +18,14 @@ PREP(handleKilled);
PREP(handlePlayerChanged); PREP(handlePlayerChanged);
PREP(handlePlayerWeaponChanged); PREP(handlePlayerWeaponChanged);
PREP(handleScrollWheel); PREP(handleScrollWheel);
PREP(handleUnconscious);
PREP(initObject); PREP(initObject);
PREP(initPerson);
PREP(isObjectOnObject); PREP(isObjectOnObject);
PREP(setCarryable); PREP(setCarryable);
PREP(setDraggable); PREP(setDraggable);
PREP(startCarry);
PREP(startCarryPFH);
PREP(startDrag); PREP(startDrag);
PREP(startDragPFH); PREP(startDragPFH);

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging // a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canCarry), false]} alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]}

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging // a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canDrag), false]} alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]}

View File

@ -17,28 +17,23 @@ private ["_unit", "_target"];
_unit = _this select 0; _unit = _this select 0;
_target = _this select 1; _target = _this select 1;
// check weight
private "_weight";
_weight = [_target] call FUNC(getWeight);
if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith {
[localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured);
};
// select no weapon and stop sprinting
_unit action ["SwitchWeapon", _unit, _unit, 99];
[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus);
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// get attachTo offset and direction. // get attachTo offset and direction.
private ["_position", "_direction"]; private ["_position", "_direction"];
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(carryDirection), 0]; _direction = _target getVariable [QGVAR(carryDirection), 0];
// handle objects vs persons
if (_target isKindOf "CAManBase") then {
[_unit, "AcinPercMstpSnonWnonDnon", 2, true] call EFUNC(common,doAnimation);
[_target, "AinjPfalMstpSnonWnonDf_carried_dead", 2, true] call EFUNC(common,doAnimation);
// attach person
_target attachTo [_unit, _position, "LeftShoulder"];
} else {
// add height offset of model // add height offset of model
private "_offset"; private "_offset";
_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); _offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2);
@ -47,7 +42,9 @@ _position = _position vectorAdd [0, 0, _offset];
// attach object // attach object
_target attachTo [_unit, _position]; _target attachTo [_unit, _position];
_target setDir _direction;
};
["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent);
_unit setVariable [QGVAR(isCarrying), true, true]; _unit setVariable [QGVAR(isCarrying), true, true];
_unit setVariable [QGVAR(carriedObject), _target, true]; _unit setVariable [QGVAR(carriedObject), _target, true];
@ -74,7 +71,7 @@ _actionID = _unit addAction [
_unit setVariable [QGVAR(ReleaseActionID), _actionID]; _unit setVariable [QGVAR(ReleaseActionID), _actionID];
// check everything // check everything
[FUNC(carryObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; [FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height. // reset current dragging height.
GVAR(currentHeightChange) = 0; GVAR(currentHeightChange) = 0;

View File

@ -1,11 +1,19 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 carryObjectPFH running", time];
#endif
private ["_unit", "_target"]; private ["_unit", "_target"];
_unit = _this select 0 select 0; _unit = _this select 0 select 0;
_target = _this select 0 select 1; _target = _this select 0 select 1;
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed // drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then { if !([_target] call EFUNC(common,isAlive)) then {
[_unit, _target] call FUNC(dropObject_carry); [_unit, _target] call FUNC(dropObject_carry);

View File

@ -31,7 +31,11 @@ _position = _position vectorAdd [0, 0, _offset];
// attach object // attach object
_target attachTo [_unit, _position]; _target attachTo [_unit, _position];
_target setDir _direction; ["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent);
if (_target isKindOf "CAManBase") then {
[_target, "AinjPpneMrunSnonWnonDb_still", 0, true] call EFUNC(common,doAnimation);
};
_unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(isDragging), true, true];
_unit setVariable [QGVAR(draggedObject), _target, true]; _unit setVariable [QGVAR(draggedObject), _target, true];
@ -58,7 +62,7 @@ _actionID = _unit addAction [
_unit setVariable [QGVAR(ReleaseActionID), _actionID]; _unit setVariable [QGVAR(ReleaseActionID), _actionID];
// check everything // check everything
[FUNC(dragObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; [FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height. // reset current dragging height.
GVAR(currentHeightChange) = 0; GVAR(currentHeightChange) = 0;

View File

@ -1,11 +1,19 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 dragObjectPFH running", time];
#endif
private ["_unit", "_target"]; private ["_unit", "_target"];
_unit = _this select 0 select 0; _unit = _this select 0 select 0;
_target = _this select 0 select 1; _target = _this select 0 select 1;
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed // drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then { if !([_target] call EFUNC(common,isAlive)) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);

View File

@ -27,12 +27,20 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject);
_unit playAction "released"; _unit playAction "released";
// prevent collision damage // prevent collision damage
["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); ["fixCollision", _unit] call EFUNC(common,localEvent);
["fixCollision", _target, _target] call EFUNC(common,targetEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent);
// release object // release object
detach _target; detach _target;
if (_target isKindOf "CAManBase") then {
if (_target getVariable ["ACE_isUnconscious", false]) then {
[_target, "unconscious", 2, true] call EFUNC(common,doAnimation);
} else {
[_target, "", 2, true] call EFUNC(common,doAnimation); //@todo "AinjPpneMrunSnonWnonDb_release" seems to fall back to unconsciousness anim.
};
};
_unit removeWeapon "ACE_FakePrimaryWeapon"; _unit removeWeapon "ACE_FakePrimaryWeapon";
// prevent object from flipping inside buildings // prevent object from flipping inside buildings
@ -46,5 +54,7 @@ _unit setVariable [QGVAR(draggedObject), objNull, true];
// make object accesable for other units // make object accesable for other units
[objNull, _target, true] call EFUNC(common,claim); [objNull, _target, true] call EFUNC(common,claim);
if !(_target isKindOf "CAManBase") then {
["fixPosition", _target, _target] call EFUNC(common,targetEvent); ["fixPosition", _target, _target] call EFUNC(common,targetEvent);
["fixFloating", _target, _target] call EFUNC(common,targetEvent); ["fixFloating", _target, _target] call EFUNC(common,targetEvent);
};

View File

@ -24,12 +24,28 @@ private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject); _inBuilding = [_unit] call FUNC(isObjectOnObject);
// prevent collision damage // prevent collision damage
["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); ["fixCollision", _unit] call EFUNC(common,localEvent);
["fixCollision", _target, _target] call EFUNC(common,targetEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent);
// release object // release object
detach _target; detach _target;
// fix anim when aborting carrying persons
if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then {
if (vehicle _unit == _unit) then {
[_unit, "", 2, true] call EFUNC(common,doAnimation);
};
if (_target getVariable ["ACE_isUnconscious", false]) then {
[_target, "unconscious", 2, true] call EFUNC(common,doAnimation);
} else {
[_target, "", 2, true] call EFUNC(common,doAnimation); //@todo
};
};
// properly remove fake weapon
_unit removeWeapon "ACE_FakePrimaryWeapon";
// reselect weapon and re-enable sprint // reselect weapon and re-enable sprint
_unit selectWeapon primaryWeapon _unit; _unit selectWeapon primaryWeapon _unit;
@ -46,5 +62,7 @@ _unit setVariable [QGVAR(carriedObject), objNull, true];
// make object accesable for other units // make object accesable for other units
[objNull, _target, true] call EFUNC(common,claim); [objNull, _target, true] call EFUNC(common,claim);
if !(_target isKindOf "CAManBase") then {
["fixPosition", _target, _target] call EFUNC(common,targetEvent); ["fixPosition", _target, _target] call EFUNC(common,targetEvent);
["fixFloating", _target, _target] call EFUNC(common,targetEvent); ["fixFloating", _target, _target] call EFUNC(common,targetEvent);
};

View File

@ -13,8 +13,10 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
private "_draggedObject"; private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
if (!isNull _draggedObject) then {
[_unit, _draggedObject] call FUNC(dropObject); [_unit, _draggedObject] call FUNC(dropObject);
}; };
};
}; };
@ -25,7 +27,9 @@ if (_unit getVariable [QGVAR(isCarrying), false]) then {
private "_carriedObject"; private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
if (!isNull _carriedObject) then {
[_unit, _carriedObject] call FUNC(dropObject_carry); [_unit, _carriedObject] call FUNC(dropObject_carry);
}; };
};
}; };

View File

@ -20,12 +20,21 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
if (_unit getVariable [QGVAR(isCarrying), false]) then { if (_unit getVariable [QGVAR(isCarrying), false]) then {
// drop carried object when selecting any weapon
if (_weapon != "") then {
private "_carriedObject"; private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
if (_carriedObject isKindOf "CAManBase") then {
if (_weapon != primaryWeapon _unit) then {
[_unit, _carriedObject] call FUNC(dropObject_carry);
};
} else {
// drop carried object when selecting any weapon
if (_weapon != "") then {
[_unit, _carriedObject] call FUNC(dropObject_carry); [_unit, _carriedObject] call FUNC(dropObject_carry);
}; };
}; };
};

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