Jump to content
  • 0

animations in epoch...


happydayz

Question

Have spent the past week looking for a way to make an animation that is executed on a player and/or target to be seen by others on the server. I know that bis_fnc_mp is the 'regular' way to do this... however its disabled by epoch.

 

Came across the Epoch_server_handle_switchMove.sqf in the epoch serverfiles and noticed that it sends an animation to players around it.


private["_range","_move","_nearBy","_target"];
_target=_this select 0;
if !([_target,_this select 2]call EPOCH_server_getPToken)exitWith{};
_range=0;
_move="";
switch(_this select 1)do{case 1:{_range=1000;
_move="AovrPercMrunSrasWrflDf";
};
case 2:{_range=1000;
_move="epoch_unarmed_jump";
};
};
if(_range > 0 && _move !="")then{_nearBy=(getPosATL _target)nearEntities[["Epoch_Male_F","Epoch_Female_F"],_range];
{[["switchMove",[_target,_move]],(owner _x)]call EPOCH_sendPublicVariableClient;
}forEach(_nearBy-[_target]);
};

having a brain fade and cannot seem to figure out a way to use this principle....

 

example I have both a _target and player that have animations executed on them. the animations are dependant on specific conditions that are passed to a variable and the animations are then executed by:

 

  player switchMove _unitActionName;
  
 _target switchMove _preyActionName;

This of course will only be seen locally for the player. Its making this visible by other players thats the hard part...

 

I know the key must be in here.... its just getting everything in the right order....

if(_range > 0 && _move !="")then{_nearBy=(getPosATL _target)nearEntities[["Epoch_Male_F","Epoch_Female_F"],_range];
{[["switchMove",[_target,_move]],(owner _x)]call EPOCH_sendPublicVariableClient;

happyd

Link to comment
Share on other sites

Recommended Posts

  • 0

feel free to have at it to make this all into a seperate pbo.

 

 

 

im off to bed for the night and then work tomorrow :( but ill check in throughout the day and see how ur going!

 

latest version of the EPOCH_server_handle_Switchmove.sqf

 

//diag_log format['EPOCH SWITCHMOVE SERVERSIDE FUNCTION HAS STARTED',time];

private["_range","_move","_nearBy","_target","_targetplayer","_targetmove"];
_target=_this select 0;

_targetplayer=_this select 3;

if !([_target,_this select 2]call EPOCH_server_getPToken)exitWith{};


_range=0;
_move="";
switch(_this select 1)do{case 1:{_range=1000;
_move="AovrPercMrunSrasWrflDf";
};
case 2:{_range=1000;
_move="epoch_unarmed_jump";
};
//from here are added animations
case 10:{_range=1000;
_move= "MOCAP_Idle_Stay_CombatPace_Un_Atacker_Grab_Naked_Choke_No_Contr";
_targetmove= "MOCAP_Idle_Stay_CombatPace_Un_Prey_Grabbed_Naked_Choke_No_Contr";
};
case 11:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Grabbed_Legs_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Stay_CombatPace_Un_Prey_Grabbed_Legs_Neck_Twist_No_Contr";
};
case 12:{_range=1000;
_move="MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Grabbed_Legs_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Stay_CombatPace_Un_Prey_Grabbed_Legs_Neck_Twist_No_Contr";};
case 13:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Grabbed_OnBack_Naked_Choke_No_Contr";
_targetmove= "MOCAP_Idle_Kneel_CombatPace_Un_Prey_Grabbed_OnBack_Naked_Choke_No_Contr";
};
case 14:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Grabbed_OnBack_Naked_Choke_No_Contr";
_targetmove= "MOCAP_Idle_Kneel_CombatPace_Un_Prey_Grabbed_OnBack_Naked_Choke_No_Contr";
};
case 15:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Lying_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Prone_CivPace_Un_Prey_Lying_Neck_Twist_No_Contr";
};
case 16:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Lying_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Prone_CivPace_Un_Prey_Lying_Neck_Twist_No_Contr";
};
case 17:{_range=1000;
_move= "MOCAP_Idle_Stay_CombatPace_Un_Atacker_Grab_ByLeftLeg_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Kneel_CombatPace_Un_Prey_Grab_ByLeftLeg_Neck_Twist_No_Contr";
};
case 18:{_range=1000;
_move= "MOCAP_Idle_Kneel_CombatPace_Un_Atacker_Lying_Neck_Twist_No_Contr";
_targetmove= "MOCAP_Idle_Prone_CivPace_Un_Prey_Lying_Neck_Twist_No_Contr";
};
case 20:{_range=1000;
_move= "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
_targetmove= "AcinPercMstpSnonWnonDnon_agony";
};
};
//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- prey --- targetplayer = %1',_targetplayer];
//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- player --- target = %1',_target];
//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- _targetmove = %1',_targetmove];
//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- _move = %1',_move];

switch (true) do {

    case (_range > 0 && _move !="" && _targetmove !="") :
    {
	
_nearBy=(getPosATL _target)nearEntities[["Epoch_Male_F","Epoch_Female_F"],_range];

//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- _nearby = %1',_nearby];


{[["switchMove",[_target,_move]],(owner _x)]call EPOCH_sendPublicVariableClient;
}forEach(_nearBy-[_target]);

{[["switchMove",[_targetplayer,_targetmove]],(owner _x)]call EPOCH_sendPublicVariableClient;
}forEach(_nearBy-[_target]);

//diag_log format['EPOCH SWITCHMOVE SERVERSIDE FUNCTION HAS BEEN EXECUTED ON MY CUSTOM SWITCH',time];
	
	
    case (_range > 0 && _move !="") :
   {
  
_nearBy=(getPosATL _target)nearEntities[["Epoch_Male_F","Epoch_Female_F"],_range];

//diag_log format['---------------------- EPOCH SWITCHMOVE SERVERSIDE FUNCTION ---------------------- _nearby = %1',_nearby];

{[["switchMove",[_target,_move]],(owner _x)]call EPOCH_sendPublicVariableClient;
}forEach(_nearBy-[_target]);

	
//diag_log format['EPOCH SWITCHMOVE SERVERSIDE FUNCTION HAS BEEN EXECUTED ON THE DEFAULT VALUE (JUMPING)',time];
 
   };

};


// diag_log format['EPOCH SWITCHMOVE SERVERSIDE FUNCTION HAS FINISHED',time];

 

 

and the latest way that I am sending the animations to the switchmove for your viewing pleasure.......

 

 

 

if (mocapenabled)  then {    


  
  						player switchMove _unitActionName;
						_target switchMove _preyActionName;
						_targetplayer = _target;
						
						//sends to the server the animation for a Mocap Enabled player
						EPOCH_switchMove_PVS = [player, _animationcase, Epoch_personalToken, _targetplayer];
						publicVariableServer "EPOCH_switchMove_PVS";
						_handled = true;
					
						//sends to the server the animation for a NON Mocap player
						EPOCH_switchMove_PVS = [player, 19, Epoch_personalToken, _targetplayer];
						publicVariableServer "EPOCH_switchMove_PVS";
						_handled = true;
					
						
//	hint format	["Player Name = %1 - Animationcase = %2 - Epoch_personalToken = %3 - _targetplayer = %4",player,_animationcase,Epoch_personalToken,_targetplayer ];
									
sleep _unitAdditionalDelay;
detach _target;
	                    if ((alive player) && (alive _target)) then {

                        _target setDamage ((damage _target) + 1);

						
                    };

  } else { 
  
  cutText ["You do not have the mod MOCAP enabled! No cool assassination animations will be played! See ZENITHOVMEN.COM to download!","PLAIN",2];

						
						_targetplayer = _target;

						//sends to the server the animation for a NON Mocap player
						EPOCH_switchMove_PVS = [player, 19, Epoch_personalToken, _targetplayer];
						publicVariableServer "EPOCH_switchMove_PVS";
						_handled = true;

						//sends to the server the animation for a Mocap Enabled player
						EPOCH_switchMove_PVS = [player, _animationcase, Epoch_personalToken, _targetplayer];
						publicVariableServer "EPOCH_switchMove_PVS";
						_handled = true;
						

  						player switchMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
  						_target switchMove "AcinPercMstpSnonWnonDnon_agony";
						
						player enablesimulation false;
						
//hint "Waiting for any spectators and the targets Mocap animation to complete"; 	 //these hints will become messages in centre of screen!	maybe an execVm that runs a msg like the server intro that fades in etc!	
			
						
						sleep _unitAdditionalDelay;
						sleep 0.5;
						detach _target;
	                    if ((alive player) && (alive _target)) then {

                        _target setDamage ((damage _target) + 1);

						player enablesimulation true;
                    };
 };

	

 

Notice that I send both a Mocap and non Mocap animation for each to the server = this is so that even if a non Mocap player executes the assassination you will still get the animation on yourself if you have it enabled, or if a player watching has it enabled. 

 

I now need to work out how to publicvariable a message to the target making their screen go black and telling them that they have been assassinated but dont have Mocap enabled.

and if they do have the message to still have a message come up that they have been assassinated.

 

anyway off for the night

 

ciao.

Link to comment
Share on other sites

  • 0

well a little bit ago, my kids arrived on a surprise :)

I will be doing as much as possible from here till they get picked up later tonight.

So far

Client side group check:(works fine in debug menu for determining UID for group leader)

_groupid=Epoch_my_GroupUID;  hint format["%1",_groupid];
Server side check assumption:(haven't tested yet, based on info sent from client to PVEH)

_plyr=this select 0;
_plyrGroup=_plyr getVariable['GROUP',''];
diag_log format["%1",_plyrGroup];
I looked at isBuildAllowed, server_createGroup, server_respawnPlayer, lockVehicle, and A3AH for ideas on getting the victims groupUID

I haven't even downloaded mocap yet.... :(

Gonna be a busy day with my kids, might pick back up if they get consumed in ps3 or movies.

Link to comment
Share on other sites

  • 0

Hey Zupa.

 

I've pushed it to github. --- https://github.com/happydayz-enigma/Enigma_EPOCH_Animations

 

See the Readme for instructions and client code.

 

This all worked fine when I modified the server files to show this information (minus of course the Enigma tags....)

 

_target switchMove "AcinPercMstpSnonWnonDnon_agony";

 

I don't think a client can trigger that on a different client ( just my guessing).

 

 

 

 

 

{[["switchMove",[_TargetClient,_TargetClientAnimation]],(owner _x)]call EPOCH_sendPublicVariableClient,   }forEach(_NearByClients-[_OriginalClient]);

 

To counter this, include the original client to trigger the move to on that line.

Link to comment
Share on other sites

  • 0

it all works fine for other clients to see (including the target client) when i have it in the epoch server files. Im just working on tidying it up here. the problem im having is trying to move all of this out of the epoch server files into its own pbo. just doesnt seem to load up the Enigma_switchMove_PVS

Link to comment
Share on other sites

  • 0

ah i think i know what your saying. if you mean change it to:

 

{[["switchMove",[_TargetClient,_TargetClientAnimation]],(owner _x)]call EPOCH_sendPublicVariableClient;   }forEach(_NearByClients]);

 

then it doesnt show the animation ocurring on the target for the original player. 

thats why im doing the switchmove on the _target in the client file as it does show you doing the animation locally on the _target.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...