Adding custom animations

This commit is contained in:
sethduda 2016-08-23 23:41:46 -04:00
parent bfb43dcf43
commit c2d72ce5dd
18 changed files with 685 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,549 @@
//Animations by Ruppertle
class CfgMovesBasic
{
class DefaultDie;
class ManActions
{
AR_01="AR_01_Idle";
AR_01_Jump1 = "";
AR_01_Jump2 = "";
AR_01_Jump3 = "";
};
class Actions
{
class RifleStandActions;
class AR_BaseActions: RifleStandActions
{
AdjustF="";
AdjustB="";
AdjustL="";
AdjustR="";
AdjustLF="";
AdjustLB="";
AdjustRB="";
AdjustRF="";
agonyStart="";
agonyStop="";
medicStop="";
medicStart="";
medicStartUp="";
medicStartRightSide="";
GestureAgonyCargo="";
grabCarry="";
grabCarried="";
grabDrag="";
grabDragged="";
carriedStill="";
released="";
releasedBad="";
Stop="";
StopRelaxed="";
TurnL="";
TurnR="";
TurnLRelaxed="";
TurnRRelaxed="";
ReloadMagazine="";
ReloadMGun="";
ReloadRPG="ReloadRPG";
ReloadMortar="";
WalkF="";
WalkLF="";
WalkRF="";
WalkL="";
WalkR="";
WalkLB="";
WalkRB="";
WalkB="";
PlayerWalkF="";
PlayerWalkLF="";
PlayerWalkRF="";
PlayerWalkL="";
PlayerWalkR="";
PlayerWalkLB="";
PlayerWalkRB="";
PlayerWalkB="";
SlowF="";
SlowLF="";
SlowRF="";
SlowL="";
SlowR="";
SlowLB="";
SlowRB="";
SlowB="";
PlayerSlowF="";
PlayerSlowLF="";
PlayerSlowRF="";
PlayerSlowL="";
PlayerSlowR="";
PlayerSlowLB="";
PlayerSlowRB="";
PlayerSlowB="";
FastF="";
FastLF="";
FastRF="";
FastL="";
FastR="";
FastLB="";
FastRB="";
FastB="";
TactF="";
TactLF="";
TactRF="";
TactL="";
TactR="";
TactLB="";
TactRB="";
TactB="";
PlayerTactF="";
PlayerTactLF="";
PlayerTactRF="";
PlayerTactL="";
PlayerTactR="";
PlayerTactLB="";
PlayerTactRB="";
PlayerTactB="";
EvasiveLeft="";
EvasiveRight="";
startSwim="";
surfaceSwim="";
bottomSwim="";
StopSwim="";
startDive="";
SurfaceDive="";
BottomDive="";
StopDive="";
Down="";
Up="";
PlayerStand="";
PlayerCrouch="";
PlayerProne="";
Lying="";
Stand="";
Combat="";
Crouch="";
CanNotMove="";
Civil="";
CivilLying="";
FireNotPossible="";
WeaponOn="";
WeaponOff="";
Default="";
JumpOff="";
StrokeFist="";
StrokeGun="";
SitDown="";
Salute="";
saluteOff="";
GetOver="";
Diary="";
Surrender="";
Gear="";
BinocOn="";
BinocOff="";
PutDown="";
PutDownEnd="";
Medic="";
MedicOther="";
Treated="";
LadderOnDown="";
LadderOnUp="";
LadderOff="";
LadderOffTop="";
LadderOffBottom="";
PrimaryWeapon="";
SecondaryWeapon="";
Binoculars="";
StartFreefall = "";
FDStart = "";
useFastMove = 0;
stance = "ManStanceUndefined";
};
class AR_01_Actions: AR_BaseActions
{
upDegree="ManPosCombat";
stop="AR_01_Aim";
stopRelaxed="AR_01_Aim";
default="AR_01_Aim";
Stand="AR_01_Idle";
HandGunOn="AR_01_Aim_Pistol";
PrimaryWeapon="AR_01_Aim";
SecondaryWeapon="";
Binoculars="";
die="AR_01_Die";
Unconscious="AR_01_Die";
civil="";
};
class AR_01_DeadActions: AR_BaseActions
{
stop="AR_01_Die";
default="AR_01_Die";
die="AR_01_Die";
Unconscious="AR_01_Die";
};
class AR_01_IdleActions: AR_01_Actions
{
upDegree="ManPosStand";
stop="AR_01_Idle";
stopRelaxed="AR_01_Idle";
default="AR_01_Idle";
Combat="AR_01_Aim";
fireNotPossible="AR_01_Aim";
PlayerStand="AR_01_Aim";
};
class AR_01_PistolActions: AR_01_Actions
{
upDegree="ManPosHandGunStand";
stop="AR_01_Aim_Pistol";
stopRelaxed="AR_01_Aim_Pistol";
default="AR_01_Aim_Pistol";
throwGrenade[]=
{
"GestureThrowGrenadePistol",
"Gesture"
};
Stand="AR_01_Idle_Pistol";
die="AR_01_Die_Pistol";
Unconscious="AR_01_Die_Pistol";
};
class AR_01_IdlePistolActions: AR_01_Actions
{
upDegree="ManPosHandGunStand";
stop="AR_01_Idle_Pistol";
stopRelaxed="AR_01_Idle_Pistol";
default="AR_01_Idle_Pistol";
Combat="AR_01_Aim_Pistol";
fireNotPossible="AR_01_Aim_Pistol";
PlayerStand="AR_01_Aim_Pistol";
die="AR_01_Die_Pistol";
Unconscious="AR_01_Die_Pistol";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic
{
class States
{
class Crew;
class AmovPercMstpSrasWrflDnon;
class AmovPercMstpSrasWpstDnon;
class AmovPercMstpSoptWbinDnon;
class AmovPpneMstpSrasWrflDnon_AmovPpneMstpSrasWpstDnon;
class AmovPpneMstpSrasWrflDnon_AmovPpneMstpSrasWpstDnon_end;
class AmovPpneMstpSrasWpstDnon_AmovPpneMstpSrasWrflDnon;
class AmovPpneMstpSrasWpstDnon_AmovPpneMstpSrasWrflDnon_end;
class cargo_marksman: AmovPercMstpSrasWrflDnon
{
};
class cargo_base: cargo_marksman
{
variantsPlayer[]={};
variantsAI[]={};
enableMissile = 0;
enableBinocular = 0;
};
class cargo_base_Rope: cargo_base
{
ignoreMinPlayTime[] = {"Unconscious"};
leaning = "AR_aimingDefault_Rope";
};
class cargo_base_idle: cargo_base
{
weaponLowered=1;
enableOptics=0;
disableWeapons=1;
disableWeaponsLong=1;
variantsPlayer[]={};
variantsAI[]={};
};
class cargo_basepistol: AmovPercMstpSrasWpstDnon
{
variantsPlayer[]={};
variantsAI[]={};
enableMissile = 0;
enableBinocular = 0;
};
class cargo_base_idle_pistol: cargo_basepistol
{
weaponLowered=1;
enableOptics=0;
disableWeapons=1;
disableWeaponsLong=1;
};
class AR_01_Aim: cargo_base_Rope
{
actions="AR_01_Actions";
leftHandIKCurve[]={0};
rightHandIKCurve[]={0};
minPlayTime = 0.1;
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aim.rtm"; /// what file is going to be played in this state
speed=100000;
ConnectTo[]={};
InterpolateTo[]=
{
"AR_01_Idle",
0.1,
"AR_01_Aim_ToPistol",
0.1,
"AR_01_Die",
0.1
};
variantsAI[]=
{
"AR_01_Aim_Idling",
1
};
variantsPlayer[]=
{
"AR_01_Aim_Idling",
1
};
};
class AR_01_Aim_No_Actions : AR_01_Aim
{
actions="NoActions";
variantsPlayer[]={};
variantsAI[]={};
ConnectTo[]={};
InterpolateTo[]={};
};
class AR_01_Aim_Idling: AR_01_Aim
{
variantsPlayer[]={};
headBobStrength=0;
soundEnabled=1;
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aim1.rtm";
speed=-8;
ConnectTo[]=
{
"AR_01_Aim",
0.1
};
};
class AR_01_Idle: cargo_base_idle
{
actions="AR_01_IdleActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_idle.rtm";
speed=100000;
minPlayTime = 0.1;
aiming="aimingDefault";
leftHandIKCurve[]={0};
rightHandIKCurve[]={0};
InterpolateTo[]=
{
"AR_01_Aim",
0.1,
"AR_01_Aim_ToPistol",
0.1,
"AR_01_Die",
0.1
};
variantsAI[]=
{
"AR_01_Idle_Idling",
1
};
variantsPlayer[]=
{
"AR_01_Idle_Idling",
1
};
};
class AR_01_Idle_No_Actions : AR_01_Idle
{
actions="NoActions";
variantsPlayer[]={};
variantsAI[]={};
ConnectTo[]={};
InterpolateTo[]={};
};
class AR_01_Idle_Idling: AR_01_Idle
{
variantsPlayer[]={};
headBobStrength=0;
soundEnabled=1;
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_idle.rtm";
speed=-10;
ConnectTo[]=
{
"AR_01_Idle",
0.1
};
};
class AR_01_Aim_Pistol: cargo_basepistol
{
actions="AR_01_PistolActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimpistol.rtm";
aiming="aimingRifleSlingDefault";
aimingBody="aimingUpRifleSlingDefault";
speed=100000;
variantsAI[]=
{
"AR_01_Aim_Pistol_Idling",
1
};
variantsPlayer[]=
{
"AR_01_Aim_Pistol_Idling",
1
};
ConnectTo[]={};
InterpolateTo[]=
{
"AR_01_Aim_FromPistol",
0.1,
"AR_01_Idle_Pistol",
0.2,
"AR_01_Die_Pistol",
0.5
};
};
class AR_01_Aim_Pistol_No_Actions : AR_01_Aim_Pistol
{
actions="NoActions";
variantsPlayer[]={};
variantsAI[]={};
ConnectTo[]={};
InterpolateTo[]={};
};
class AR_01_Aim_Pistol_Idling: AR_01_Aim_Pistol
{
variantsPlayer[]={};
headBobStrength=0;
soundEnabled=1;
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimpistol1.rtm";
speed=-8;
ConnectTo[]=
{
"AR_01_Aim_Pistol",
0.1
};
};
class AR_01_Idle_Pistol: cargo_base_idle_pistol
{
actions="AR_01_IdlePistolActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_idlepistol.rtm";
speed=100000;
aiming="aimingRifleSlingDefault";
aimingBody="aimingUpRifleSlingDefault";
InterpolateTo[]=
{
"AR_01_Aim_Pistol",
0.1,
"AR_01_Aim_FromPistol",
0.1,
"AR_01_Die_Pistol",
0.1
};
variantsAI[]=
{
"AR_01_Idle_Pistol_Idling",
1
};
variantsPlayer[]=
{
"AR_01_Idle_Pistol_Idling",
1
};
};
class AR_01_Idle_Pistol_No_Actions : AR_01_Idle_Pistol
{
actions="NoActions";
variantsPlayer[]={};
variantsAI[]={};
ConnectTo[]={};
InterpolateTo[]={};
};
class AR_01_Idle_Pistol_Idling: AR_01_Idle
{
variantsPlayer[]={};
headBobStrength=0;
soundEnabled=1;
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_idlepistol1.rtm";
speed=-10;
ConnectTo[]=
{
"AR_01_Idle_Pistol",
0.1
};
};
class AR_01_Aim_ToPistol: AmovPpneMstpSrasWrflDnon_AmovPpneMstpSrasWpstDnon
{
actions="AR_01_PistolActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimtopistol.rtm";
speed=2;
ConnectTo[]=
{
"AR_01_Aim_ToPistol_End",
0.1
};
InterpolateTo[]={};
};
class AR_01_Aim_ToPistol_End: AmovPpneMstpSrasWrflDnon_AmovPpneMstpSrasWpstDnon_end
{
actions="AR_01_PistolActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimtopistol_end.rtm";
speed=1.875;
ConnectTo[]=
{
"AR_01_Aim_Pistol",
0.1
};
InterpolateTo[]={};
};
class AR_01_Aim_FromPistol: AmovPpneMstpSrasWpstDnon_AmovPpneMstpSrasWrflDnon
{
actions="AR_01_PistolActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimFrompistol.rtm";
speed=2.3076921;
ConnectTo[]=
{
"AR_01_Aim_FromPistol_End",
0.1
};
InterpolateTo[]={};
};
class AR_01_Aim_FromPistol_End: AmovPpneMstpSrasWpstDnon_AmovPpneMstpSrasWrflDnon_end
{
actions="AR_01_Actions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_aimfrompistol_end.rtm";
aiming="aimingDefault";
aimingBody="aimingUpDefault";
speed=2;
leftHandIKCurve[]={0,0,0.5,1};
ConnectTo[]=
{
"AR_01_Aim",
0.1
};
InterpolateTo[]={};
};
class AR_01_Die: DefaultDie
{
actions="AR_01_DeadActions";
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_die.rtm";
speed=1;
looped="false";
terminal=1;
ragdoll=1;
ConnectTo[]=
{
"Unconscious",
0.1
};
InterpolateTo[]={};
};
class AR_01_Die_Pistol: AR_01_Die
{
file="\AR_AdvancedRappelling\anims\Rup_RopeFX_01_die.rtm";
actions="AR_01_DeadActions";
showHandGun=1;
};
};
class BlendAnims;
class BlendAnims: BlendAnims
{
AR_aimingDefault_Rope[] = {"head",0.6,"neck1",0.6,"neck",0.6,"weapon",1,"launcher",1,"RightShoulder",0.8,"RightArm",0.8,"RightArmRoll",1,"RightForeArm",1,"RightForeArmRoll",1,"RightHand",1,"RightHandRing",1,"RightHandPinky1",1,"RightHandPinky2",1,"RightHandPinky3",1,"RightHandRing1",1,"RightHandRing2",1,"RightHandRing3",1,"RightHandMiddle1",1,"RightHandMiddle2",1,"RightHandMiddle3",1,"RightHandIndex1",1,"RightHandIndex2",1,"RightHandIndex3",1,"RightHandThumb1",1,"RightHandThumb2",1,"RightHandThumb3",1,"Spine",0.3,"Spine1",0.4,"Spine2",0.5,"Spine3",0.6};
};
};

View File

@ -57,4 +57,6 @@ class CfgSounds
sound[] = {"\AR_AdvancedRappelling\sounds\AR_Rappel_End.ogg", db+20, 1};
titles[] = {0,""};
};
};
};
#include "cfgAnimations.hpp"

View File

@ -26,6 +26,17 @@ AR_RAPPEL_POINT_CLASS_HEIGHT_OFFSET = [
["All", [-0.05, -0.05, -0.05, -0.05, -0.05, -0.05]]
];
AR_Has_Addon_Animations_Installed = {
(count getText ( configFile / "CfgMovesBasic" / "ManActions" / "AR_01" )) > 0;
};
AR_Has_Addon_Sounds_Installed = {
private ["_config","_configMission"];
_config = getArray ( configFile / "CfgSounds" / "AR_Rappel_Start" / "sound" );
_configMission = getArray ( missionConfigFile / "CfgSounds" / "AR_Rappel_Start" / "sound" );
(count _config > 0 || count _configMission > 0);
};
AR_Rappel_All_Cargo = {
params ["_vehicle",["_rappelHeight",25],["_positionASL",[]]];
if(isPlayer (driver _vehicle)) exitWith {};
@ -136,10 +147,7 @@ AR_Play_Rappelling_Sounds_Global = {
AR_Play_Rappelling_Sounds = {
params ["_player","_rappelDevice","_rappelAncor"];
private ["_config","_configMission"];
_config = getArray ( configFile / "CfgSounds" / "AR_Rappel_Start" / "sound" );
_configMission = getArray ( missionConfigFile / "CfgSounds" / "AR_Rappel_Start" / "sound" );
if(!hasInterface || ( count _config == 0 && count _configMission == 0) ) exitWith {};
if(!hasInterface || !(call AUR_Has_Addon_Sounds_Installed) ) exitWith {};
if(player distance _player < 15) then {
[_player, "AR_Rappel_Start"] call AR_Play_3D_Sound;
[_rappelDevice, "AR_Rappel_Loop"] call AR_Play_3D_Sound;
@ -375,9 +383,7 @@ AR_Client_Rappel_From_Heli = {
_player setVariable ["AR_Rappel_Rope_Top",_rope1];
_player setVariable ["AR_Rappel_Rope_Bottom",_rope2];
_player switchMove "HubSittingChairC_idle1";
[[_player,true],"AR_Enable_Rappelling_Animation"] call AR_RemoteExecServer;
[_player] spawn AR_Enable_Rappelling_Animation_Client;
_gravityAccelerationVec = [0,0,-9.8];
_velocityVec = [0,0,0];
@ -505,9 +511,6 @@ AR_Client_Rappel_From_Heli = {
};
_player switchMove "";
[[_player,false],"AR_Enable_Rappelling_Animation"] call AR_RemoteExecServer;
ropeDestroy _rope1;
ropeDestroy _rope2;
deleteVehicle _anchor;
@ -532,23 +535,133 @@ AR_Client_Rappel_From_Heli = {
};
};
AR_Enable_Rappelling_Animation = {
_this remoteExec ["AR_Client_Enable_Rappelling_Animation", 0];
params ["_player"];
[_player,true] remoteExec ["AR_Enable_Rappelling_Animation_Client", 0];
};
AR_Client_Enable_Rappelling_Animation = {
params ["_player",["_enable",true]];
if(_enable) then {
if(_player != player) then {
_player switchMove "HubSittingChairC_idle1";
_player enableSimulation false;
AR_Current_Weapon_Type_Selected = {
params ["_player"];
if(currentWeapon _player == handgunWeapon _player) exitWith {"HANDGUN"};
if(currentWeapon _player == primaryWeapon _player) exitWith {"PRIMARY"};
if(currentWeapon _player == secondaryWeapon _player) exitWith {"SECONDARY"};
"OTHER";
};
AR_Enable_Rappelling_Animation_Client = {
params ["_player",["_globalExec",false]];
if(local _player && _globalExec) exitWith {};
if(local _player && !_globalExec) then {
[[_player],"AR_Enable_Rappelling_Animation"] call AR_RemoteExecServer;
};
if(_player != player) then {
_player enableSimulation false;
};
if(call AR_Has_Addon_Animations_Installed) then {
if([_player] call AR_Current_Weapon_Type_Selected == "HANDGUN") then {
if(local _player) then {
_player switchMove "AR_01_Idle_Pistol";
_player setVariable ["AR_Animation_Move","AR_01_Idle_Pistol_No_Actions",true];
} else {
_player setVariable ["AR_Animation_Move","AR_01_Idle_Pistol_No_Actions"];
};
} else {
if(local _player) then {
_player switchMove "AR_01_Idle";
_player setVariable ["AR_Animation_Move","AR_01_Idle_No_Actions",true];
} else {
_player setVariable ["AR_Animation_Move","AR_01_Idle_No_Actions"];
};
};
if!(local _player) then {
// Temp work around to avoid seeing other player as standing
_player switchMove "AR_01_Idle_No_Actions";
sleep 1;
_player switchMove "AR_01_Idle_No_Actions";
sleep 1;
_player switchMove "AR_01_Idle_No_Actions";
sleep 1;
_player switchMove "AR_01_Idle_No_Actions";
};
} else {
if(_player != player) then {
_player switchMove "";
_player enableSimulation true;
if(local _player) then {
_player switchMove "HubSittingChairC_idle1";
_player setVariable ["AR_Animation_Move","HubSittingChairC_idle1",true];
} else {
_player setVariable ["AR_Animation_Move","HubSittingChairC_idle1"];
};
};
_animationEventHandler = -1;
if(local _player) then {
_animationEventHandler = _player addEventHandler ["AnimChanged",{
params ["_player","_animation"];
if(call AR_Has_Addon_Animations_Installed) then {
if((toLower _animation) find "aur_" < 0) then {
if([_player] call AR_Current_Weapon_Type_Selected == "HANDGUN") then {
_player switchMove "AR_01_Aim_Pistol";
_player setVariable ["AR_Animation_Move","AR_01_Aim_Pistol_No_Actions",true];
} else {
_player switchMove "AR_01_Aim";
_player setVariable ["AR_Animation_Move","AR_01_Aim_No_Actions",true];
};
} else {
if(toLower _animation == "aur_01_aim") then {
_player setVariable ["AR_Animation_Move","AR_01_Aim_No_Actions",true];
};
if(toLower _animation == "aur_01_idle") then {
_player setVariable ["AR_Animation_Move","AR_01_Idle_No_Actions",true];
};
if(toLower _animation == "aur_01_aim_pistol") then {
_player setVariable ["AR_Animation_Move","AR_01_Aim_Pistol_No_Actions",true];
};
if(toLower _animation == "aur_01_idle_pistol") then {
_player setVariable ["AR_Animation_Move","AR_01_Idle_Pistol_No_Actions",true];
};
};
} else {
_player switchMove "HubSittingChairC_idle1";
_player setVariable ["AR_Animation_Move","HubSittingChairC_idle1",true];
};
}];
};
if(!local _player) then {
[_player] spawn {
params ["_player"];
private ["_currentState"];
while {_player getVariable ["AR_Is_Rappelling",false]} do {
_currentState = toLower animationState _player;
_newState = toLower (_player getVariable ["AR_Animation_Move",""]);
if!(call AR_Has_Addon_Animations_Installed) then {
_newState = "HubSittingChairC_idle1";
};
if(_currentState != _newState) then {
_player switchMove _newState;
_player switchGesture "";
sleep 1;
_player switchMove _newState;
_player switchGesture "";
};
sleep 0.1;
};
};
};
waitUntil {!(_player getVariable ["AR_Is_Rappelling",false])};
if(_animationEventHandler != -1) then {
_player removeEventHandler ["AnimChanged", _animationEventHandler];
};
_player switchMove "";
_player enableSimulation true;
};
AR_Rappel_Detach_Action = {