port movement

This commit is contained in:
commy2 2015-01-18 06:45:28 +01:00
parent 8683667d24
commit e67602d76e
30 changed files with 276 additions and 431 deletions

View File

@ -1,4 +0,0 @@
// by commy2
//0 spawn compile preprocessFileLineNumbers "\AGM_Movement\fatigue.sqf";
0 spawn compile preprocessFileLineNumbers "\AGM_Movement\showWeight.sqf";

View File

@ -1,223 +0,0 @@
// PATCH CONFIG
class CfgPatches {
class AGM_Movement {
units[] = {};
weapons[] = {};
requiredVersion = 0.10;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi", "Tachii"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_Movement {
class AGM_Movement {
file = "AGM_Movement\functions";
class blinking;
class canClimb;
class climb;
class fatigueModule;
class heartbeat;
class getWeight;
class handleClimb;
class recoil;
class stumble;
class vision;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Movement {
clientInit = "call compile preprocessFileLineNumbers '\AGM_Movement\clientInit.sqf'";
};
};
class AGM_Core_Default_Keys {
class climb {
displayName = "$STR_AGM_Movement_Climb";
condition = "_player == _vehicle";
statement = "[_player] call AGM_Movement_fnc_climb";
key = 47;
shift = 0;
control = 1;
alt = 0;
};
};
/*class CfgInventoryGlobalVariable {
maxSoldierLoad = 1200;
};*/
class CfgFatigue {
MinValue1 = 0.2;
MinValue2 = 0.8;
NormalRunSpeed = 7.2;
TiredRunSpeedLimit = 0.8;
FrequencyMin = 0.2;
FrequencyMax = 1.0;
TotalLoadCoef = 1.1;
MaxDuty = 10;
};
class CfgSounds {
class AGM_Heartbeat {
name = "AGM_Heartbeat";
sound[] = {"AGM_Movement\sounds\heartbeat.ogg",1,1};
titles[] = {};
};
};
class AGM_Core_Options {
class useImperial {
displayName = "$STR_AGM_Movement_UseImperial";
default = 0;
};
};
// leaving this for compatibility
class CfgVehicles {
class Module_F;
class AGM_ModuleFatigue: Module_F {
author = "AGM Team";
category = "AGM";
displayName = "Fatigue System";
function = "AGM_Movement_fnc_fatigueModule";
scope = 2;
isGlobal = 1;
icon = "\AGM_Movement\UI\IconFatigue_ca.paa";
class Arguments {
class CoefFatigue {
displayName = "Getting Tired Coef.";
description = "Multiplier for the rate of getting tired. Default: 1";
defaultValue = 1;
};
class CoefRecover {
displayName = "Recover Coef.";
description = "Multiplier for the time to rest after getting tired. Default: 1";
defaultValue = 1;
};
};
};
};
class CfgMovesBasic {
class ManActions {
AGM_Climb = "AGM_Climb";
};
class Actions {
class RifleStandActionsNoAdjust;
class RifleLowStandActionsNoAdjust;
// WEAPON RAISED - RUNNING
class RifleStandActionsRunF: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandActionsRunFL: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandActionsRunFR: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
// WEAPON RAISED - SPRINTING
class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
// WEAPON LOWERED - RUNNING
class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class StandBase;
class States {
// better slow walk with lowered rifle animation
class AmovPercMstpSrasWrflDnon;
class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon {
InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02};
};
class AmovPercMstpSlowWrflDnon;
class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon {
speed = 0.3; //0.206897;
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2";
leftHandIKCurve[] = {1};
};
class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
// enable optics in prone left and right stance
class AidlPpneMstpSrasWrflDnon_G0S;
class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S {
enableOptics = 1;
};
class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S {
enableOptics = 1;
};
class AadjPpneMstpSrasWrflDup;
class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup {
enableOptics = 1;
};
class AidlPpneMstpSrasWpstDnon_G0S;
class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S {
enableOptics = 2;
};
class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S {
enableOptics = 2;
};
class AadjPpneMstpSrasWpstDup;
class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup {
enableOptics = 2;
};
// climb animation
class AmovPercMstpSnonWnonDnon: StandBase {
ConnectTo[] += {"AGM_Climb",0.02};
};
class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium;
class AGM_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium {
canReload = 0;
forceAim = 1;
};
};
};

View File

@ -1,55 +0,0 @@
// by commy2
#define THRESHOLD_1 0.8
#define THRESHOLD_2 0.9
#define THRESHOLD_3 0.99
// init onEachFrame EH
AGM_UpdatePlayerFatigue_EHID = ["AGM_UpdatePlayerFatigue", "onEachFrame", {
_player = AGM_player;
// calc new fatigue
_fatigue = getFatigue _player;
_fatigueOld = _player getVariable ["AGM_Fatigue", getFatigue _player];
if (_fatigue > _fatigueOld) then {
_fatigue = _fatigueOld + (missionNamespace getVariable ["AGM_Fatigue_CoefFatigue", 1]) * (_fatigue - _fatigueOld) max 0 min 1;
} else {
_fatigue = _fatigueOld - (missionNamespace getVariable ["AGM_Fatigue_CoefRecover", 1]) * (_fatigueOld - _fatigue) max 0 min 1;
};
_player setFatigue _fatigue;
_player setVariable ["AGM_Fatigue", _fatigue];
["Fatigue", _player, {getFatigue _this}] call AGM_Debug_fnc_log;
}] call BIS_fnc_addStackedEventHandler;
// init script ehids
_handleRecoil = scriptNull;
_handleBlinking = scriptNull;
_handleHeartbeat = scriptNull;
_handleStumble = scriptNull;
// apply fatigue effects
while {true} do {
_fatigue = getFatigue AGM_player;
if (_fatigue > THRESHOLD_1) then {
if (scriptDone _handleHeartbeat) then {
_handleHeartbeat = call AGM_Movement_fnc_heartbeat;
};
if (_fatigue > THRESHOLD_2) then {
if (scriptDone _handleBlinking) then {
_handleBlinking = call AGM_Movement_fnc_blinking;
};
if (_fatigue > THRESHOLD_3) then {
if (scriptDone _handleStumble) then {
_handleStumble = call AGM_Movement_fnc_stumble;
};
};
};
};
sleep 0.5;
};

View File

@ -1,23 +0,0 @@
// by commy2
private "_script_handle";
_script_handle = _this spawn {
if (!isTouchingGround player) exitWith {};
_ppEffect = ppEffectCreate ["ColorCorrections", 1240];
_ppEffect ppEffectEnable true;
_ppEffect ppEffectForceInNVG true;
_ppEffect ppEffectAdjust [0, -1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
_ppEffect ppEffectCommit 0.2;
sleep 0.2;
_ppEffect ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0.5]];
_ppEffect ppEffectCommit 0.2;
sleep 0.2;
_ppEffect ppEffectEnable false;
ppEffectDestroy _ppEffect;
sleep 2 + random 2;
};
_script_handle

View File

@ -1,21 +0,0 @@
// by commy2
private "_unit";
_unit = _this select 0;
if !([_unit] call AGM_Movement_fnc_canClimb) exitWith {
[localize "STR_AGM_Movement_CanNotClimb"] call AGM_Core_fnc_displayTextStructured;
};
if !(_unit getVariable ["AGM_isClimbInit", false]) then {
_unit addEventHandler ["AnimDone", {
if (local (_this select 0) && {_this select 1 == "AGM_Climb"}) then {_this call AGM_Movement_fnc_handleClimb};
}];
_unit setVariable ["AGM_isClimbInit", true];
};
[_unit] call AGM_Core_fnc_fixLoweredRifleAnimation;
[_unit, "AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation;
[_unit, "AGM_Climb", 0] call AGM_Core_fnc_doAnimation;

View File

@ -1,14 +0,0 @@
// by commy2
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {};
AGM_Fatigue_Module = true;
AGM_Fatigue_CoefFatigue = parseNumber (_logic getVariable "CoefFatigue");
AGM_Fatigue_CoefRecover = parseNumber (_logic getVariable "CoefRecover");
diag_log text "[AGM]: Fatigue Module Initialized.";

View File

@ -1,17 +0,0 @@
// by commy2
#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046
private ["_unit", "_weight"];
_unit = _this select 0;
_weight = loadAbs _unit * 0.1;
if (profileNamespace getVariable ["AGM_useImperial", false]) then {
_weight = format ["%1lb", (round (_weight * 100)) / 100];
} else {
_weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100];
};
_weight

View File

@ -1,9 +0,0 @@
// by commy2
private "_script_handle";
_script_handle = _this spawn {
playSound "AGM_Heartbeat";
sleep 8;
};
_script_handle

View File

@ -1,15 +0,0 @@
// by commy2
private "_script_handle";
_script_handle = _this spawn {
_recoilFactor = _this select 0;
_recoverThreshold = _this select 1;
player setUnitRecoilCoefficient (_recoilFactor * unitRecoilCoefficient player);
waitUntil {getFatigue player < _recoverThreshold};
player setUnitRecoilCoefficient (_recoilFactor / unitRecoilCoefficient player);
};
_script_handle

View File

@ -1,16 +0,0 @@
// by commy2
_this spawn {
if (isTouchingGround player) then {
_animation = switch (currentWeapon player) do {
case "" : {"AmovPpneMstpSnonWnonDnon"};
case (primaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"};
case (secondaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"};
case (handgunWeapon player) : {"AmovPpneMstpSrasWpstDnon"};
case (binocular player) : {"AmovPpneMstpSrasWbinDnon"};
default {"AmovPpneMstpSnonWnonDnon"};
};
[player, _animation] call AGM_Core_fnc_doAnimation;
};
sleep 6;
}

View File

@ -1,18 +0,0 @@
// by commy2
private "_script_handle";
_script_handle = _this spawn {
_ppEffect = ppEffectCreate ["radialBlur", 1241];
_ppEffect ppEffectEnable true;
_ppEffect ppEffectForceInNVG true;
_ppEffect ppEffectAdjust [0.01, 0.01, 0.1, 0.1];
_ppEffect ppEffectCommit 0;
sleep 0.5;
_ppEffect ppEffectEnable false;
ppEffectDestroy _ppEffect;
};
_script_handle

View File

@ -1,10 +0,0 @@
//by commy2
while {true} do {
waitUntil {!isNull (findDisplay 602)};
waitUntil {
_player = AGM_player;
findDisplay 602 displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [_player] call AGM_Core_fnc_getName, localize "STR_AGM_Movement_Weight", [_player] call AGM_Movement_fnc_getWeight];
isNull (findDisplay 602)
};
};

View File

@ -99,6 +99,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
};
// "inventoryDisplayChanged" event
_newInventoryDisplayIsOpen = !(isNull findDisplay 602);
if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen;
["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent);
};
// "zeusDisplayChanged" event
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {

View File

@ -0,0 +1 @@
z\ace\addons\movement

View File

@ -0,0 +1,12 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,11 @@
class CfgFatigue {
MinValue1 = 0.2;
MinValue2 = 0.8;
NormalRunSpeed = 7.2;
TiredRunSpeedLimit = 0.8;
FrequencyMin = 0.2;
FrequencyMax = 1.0;
TotalLoadCoef = 1.1;
MaxDuty = 10;
};

View File

@ -0,0 +1,4 @@
class CfgInventoryGlobalVariable {
maxSoldierLoad = 1200;
};

View File

@ -0,0 +1,117 @@
class CfgMovesBasic {
class ManActions {
ACE_Climb = "ACE_Climb";
};
class Actions {
class RifleStandActionsNoAdjust;
class RifleLowStandActionsNoAdjust;
// WEAPON RAISED - RUNNING
class RifleStandActionsRunF: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandActionsRunFL: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandActionsRunFR: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
// WEAPON RAISED - SPRINTING
class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
// WEAPON LOWERED - RUNNING
class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust {
getOver = "AovrPercMrunSrasWrflDf";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class StandBase;
class States {
// better slow walk with lowered rifle animation
class AmovPercMstpSrasWrflDnon;
class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon {
InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02};
};
class AmovPercMstpSlowWrflDnon;
class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon {
speed = 0.3; //0.206897;
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2";
leftHandIKCurve[] = {1};
};
class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf {
leftHandIKCurve[] = {};
};
// enable optics in prone left and right stance
class AidlPpneMstpSrasWrflDnon_G0S;
class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S {
enableOptics = 1;
};
class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S {
enableOptics = 1;
};
class AadjPpneMstpSrasWrflDup;
class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup {
enableOptics = 1;
};
class AidlPpneMstpSrasWpstDnon_G0S;
class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S {
enableOptics = 2;
};
class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S {
enableOptics = 2;
};
class AadjPpneMstpSrasWpstDup;
class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup {
enableOptics = 2;
};
// climb animation
class AmovPercMstpSnonWnonDnon: StandBase {
ConnectTo[] += {"ACE_Climb",0.02};
};
class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium;
class ACE_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium {
canReload = 0;
forceAim = 1;
};
};
};

View File

@ -0,0 +1,19 @@
//by commy2
#include "script_component.hpp"
["inventoryDisplayLoaded", {
[{
private "_dialog";
_dialog = _this select 0;
if (isNull _dialog) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize "STR_ACE_Movement_Weight", [ACE_player] call FUNC(getWeight)];
}, 0, _this select 0] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,6 @@
#include "script_component.hpp"
PREP(getWeight);
PREP(canClimb);
PREP(climb);
PREP(handleClimb);

View File

@ -0,0 +1,37 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2","KoffeinFlummi","Tachii"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgFatigue.hpp"
//#include "CfgInventoryGlobalVariable.hpp"
#include "CfgMoves.hpp"
class ACE_Default_Keys {
class climb {
displayName = "$STR_ACE_Movement_Climb";
condition = QUOTE(_player == _vehicle);
statement = QUOTE([_player] call FUNC(climb););
key = 47;
shift = 0;
control = 1;
alt = 0;
};
};
class ACE_Options {
class useImperial {
displayName = "$STR_ACE_Movement_UseImperial";
default = 0;
};
};

View File

@ -1,4 +1,5 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_pos", "_dir"];

View File

@ -0,0 +1,22 @@
// by commy2
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
if !([_unit] call FUNC(canClimb)) exitWith {
[localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured);
};
if !(_unit getVariable ["ACE_isClimbInit", false]) then {
_unit addEventHandler ["AnimDone", {
if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)};
}];
_unit setVariable ["ACE_isClimbInit", true];
};
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation);

View File

@ -0,0 +1,16 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_weight"];
_unit = _this select 0;
_weight = loadAbs _unit * 0.1;
if (profileNamespace getVariable ["ACE_useImperial", false]) then {
_weight = format ["%1lb", (round (_weight * 100)) / 100];
} else {
_weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100];
};
_weight

View File

@ -1,4 +1,5 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_anim", "_pos"];
@ -6,7 +7,7 @@ _unit = _this select 0;
_anim = _this select 1;
_pos = _unit modelToWorld (_unit selectionPosition "camera");
[_unit, "AmovPknlMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation;
[_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
_pos = _pos vectorDiff (_unit selectionPosition "camera");

View File

@ -0,0 +1 @@
#include "\z\ace\addons\movement\script_component.hpp"

View File

@ -0,0 +1,14 @@
#define COMPONENT movement
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_MOVEMENT
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_MOVEMENT
#define DEBUG_SETTINGS DEBUG_ENABLED_MOVEMENT
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-22 -->
<Project name="AGM">
<Project name="ACE">
<Package name="Movement">
<Key ID="STR_AGM_Movement_UseImperial">
<Key ID="STR_ACE_Movement_UseImperial">
<English>Show weight in lb</English>
<German>Zeige Gewicht in Pfund</German>
<Spanish>Mostrar peso en libras</Spanish>
@ -14,7 +14,7 @@
<Hungarian>Súly megjelenítése fontban.</Hungarian>
<Russian>Показать вес в фунтах</Russian>
</Key>
<Key ID="STR_AGM_Movement_Weight">
<Key ID="STR_ACE_Movement_Weight">
<English>Weight:</English>
<German>Gewicht:</German>
<Spanish>Peso:</Spanish>
@ -26,7 +26,7 @@
<Hungarian>Súly:</Hungarian>
<Russian>Вес:</Russian>
</Key>
<Key ID="STR_AGM_Movement_Climb">
<Key ID="STR_ACE_Movement_Climb">
<English>Climb</English>
<German>Klettern</German>
<Polish>Wspinaczka</Polish>
@ -34,7 +34,7 @@
<Czech>Vylézt</Czech>
<Russian>Подняться</Russian>
</Key>
<Key ID="STR_AGM_Movement_CanNotClimb">
<Key ID="STR_ACE_Movement_CanNotClimb">
<English>Can't climb here</English>
<German>Kann hier nicht klettern</German>
<Polish>Nie możesz wspiąć się tutaj</Polish>