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

  • 1

I've seen the player token call several times, first one on top of my head is the debug stats.

I believe the token is only to verify you as the player pulling info from the server.

I don't think that you need that for the players near to see the animation, hence the sendpvclient which will send the animation to the near players within 1000m as designated by the foreach near target.

I'm still going to say that I believe a separate sqf for each of your animations.

what I see is the epoch server side file is for 2 animations with if then else statement. So it's either one or the jump. My guess is its the slow vault and the running vault, both controlled by the target jumping, it just needs to check if target is running or not in order to send the proper animation to the near target within 1000m...

I'm pretty sure a custom mod with a new almost exact copy of the first code block.

which might not even need the if then else since you know you only need one animation.

then setup a Hotkey which calls this...

How about the trading animation in HS BlackMarket, I know that's sent across all players near....

Pick this up in the morning when I can focus better!

Link to comment
Share on other sites

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

This is server code, the server send to every logged in client that 

 

_target

 

SwitchMove to

 

_move 

 

(owner _x) where _x is the loop of every playableUnit ( in nieghbourhood without the _target himself) in the server. Owner cus u need to send it to the actual PC and not the character ingame

Link to comment
Share on other sites

  • 0

So i see where the client is sending the info to the server....

then {
player switchMove "epoch_unarmed_jump";
EPOCH_switchMove_PVS = [player, 2, Epoch_personalToken];
publicVariableServer "EPOCH_switchMove_PVS";
_handled = true;
};

so if I changed my client file to do something like this:

then {{
player switchMove _unitActionName;
EPOCH_switchMove_PVS = [player, 2, Epoch_personalToken];
publicVariableServer "EPOCH_switchMove_PVS";
_handled = true;
}
_target switchMove _preyActionName;
EPOCH_switchMove_PVS = [_target, 3, Epoch_personalToken];
publicVariableServer "EPOCH_switchMove_PVS";
_handled = true;
};

[_target, 3, Epoch_personalToken]; _target = select 0, Switch = select 1, Owner = select 2

 

 

is the Switch = select 1, passing this number to determine the case?

 

and if i either a) changed the server file to include the animations case that I have

 

or B) created my own serverside function that does the same thing that should work?

Link to comment
Share on other sites

  • 0

I'm just taking a stab.

I think you could create your own file same as your first code box

make the animation change you need.

Most likely a server side mod compiling the new file with the animation you want, then in your mission file load it to a new Hotkey or somehow intercept the key down or action.

Sounds good but maybe I'm way off....

Link to comment
Share on other sites

  • 0

hey sanchez

 

Im thinking something like this may work (changing the client code as well)

 

serverside ----


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{};
//if !([_targetplayer,_this select 4]call EPOCH_server_getPToken)exitWith{}; //if I need it

_range=0;
_move="";
switch(_this select 1)do{case 1:{_range=1000;
_move="AovrPercMrunSrasWrflDf";
};
case 2:{_range=1000;
_move="epoch_unarmed_jump";
};



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


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

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

}} else {

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

and then changing the client to 

player switchMove _unitActionName;
_target switchMove _preyActionName;
_targetplayer = _target
EPOCH_switchMove_PVS = [player, _servercase, Epoch_personalToken, _targetplayer];
publicVariableServer "EPOCH_switchMove_PVS";
_handled = true;
Link to comment
Share on other sites

  • 0

unsure if im also going to require the _targetplayer Epoch_personalToken.... not sure if its even used? Is the Epoch_personalToken just telling the server that its such and such a player that has sent the info?

 

example on the server will I need:

if !([_targetplayer,_this select 4]call EPOCH_server_getPToken)exitWith{};

and client

player switchMove _unitActionName;
_target switchMove _preyActionName;
_targetplayer = _target
EPOCH_switchMove_PVS = [player, _servercase, Epoch_personalToken, _targetplayer, target_Epoch_personalToken];
publicVariableServer "EPOCH_switchMove_PVS";
_handled = true;
Link to comment
Share on other sites

  • 0

ooo ill have to look at the HS blackmarket trading animation... hadnt thought of that one!

 

Yeah i am/was just changing the server switch file atm to check that its all working first then seperate it out into its own script. 

 

yes its the running leap with/without guns that it is operating atm. 

 

I havent tried this yet but I think getting what i have written out to work with just a single animation I could do, but I need it to send two animations, both the player and the target (as you can see im making this work with the @Mocap animations) Each case number is a different scenario of animations for the player and target. IE the else at the bottom to check if there are 2 animations or if there is just the single animation.

 

Like i said I could be WAY off base here. but it would be good to come up with something that makes it "easier" for others scripts to also send animations across the server to all players.

Link to comment
Share on other sites

  • 0

I felt so dirty I needed a shower and now I'm up for a few longer.

nice I did see the mocap but had not looked it up.

ok now I understand why you were writing it with all the different cases :)

Yes I'm on par with ya about the easier to send animations.

if I'm an insomniac I will make a few quick attempts to do a custom pbo sending a simple animation to near players.

it could be useful for all those funky animations out there!

Touch base later, im going to go for something quick and easy to start.

probably try to send a power stance or exercise....

Link to comment
Share on other sites

  • 0

Yeah I always seem to skip the quick and easy and dive right in lol.... Just a reminder that I think u will need to make a publicEH???? like the epoch one that this calls first. Haven't checked to see if that works though. Not home ATM and been sharing PC with my wife all day so been doing lots of disjointed scripting. Latest version I have seems to be running the server script (checking with diags to server rpt) but it seems to be skipping the section that tells the nearest clients what to do. Probably all this is redundant when the bis exec goes live which essentially I believe replaces lots of bis_fnc_mp uses.

I've distracted u now from your numerous other scripts! ;)

Link to comment
Share on other sites

  • 0

I have 2 clients, decided to buy one for my kids account and use it regularly to test.

Yes I slept for exactly 55 minutes and woke up.....

Yes to create a new variable to replace switchmove.

apply that new variable into the Hotkey code or as my attempt later might be a button click on a gui.

just for example Hotkey setup for my donkey menu is

if (donkeymenuKeyPressEnabled) then {	[] spawn {dmKeyPress = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == dpMenu_hotkeyDIKCodeNumber) then {[] call dp_Menu_Handler;};"];};	[] spawn {dmKeyPress = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 64) then {createDialog'SC_sarDiag';};"];};};
I would replace the code after if then with the call to the compiled variable.

sort of like the call dp_menu_handler. But to a call server side so that it can handle the server side send to owner _x and get it right.

Or like the test will be a button click on my gui menu which will call the compile and run through its script, sorta like the craftable vehicles I have. Server side compile, Client side click, server side execute.

Man in reference to distractions, if it's a learning experience it is never a distraction and I replied here cause I wanted to learn/self teach/help out.

Honestly 10 months ago when I put up dp epoch, I didn't know shit really but what I had to learn to put up the server :)

It's turned out so much fun I've actually changed direction a little bit in life and am prepping for some programming language tests to further myself. At 7/8 years old I hated programming in basic but in 1984 all we had was a drive prompt on a black screen so it was that or break it and fix it stuff, I chose the later and have been doing repairs and builds most of my life.

if you don't learn something new each day, well you've wasted a day of your life is how I've treated it for a long time.

Link to comment
Share on other sites

  • 0

After reading about mocap dam it I didn't know it was released already, shit let's get this done!

I think I'll skip the quick and easy and hit that shit head on with ya here.

I was following that melee mod all last year into the beginning of this year and finally gave up waiting....

thanks Z

Link to comment
Share on other sites

  • 0

the downside atm is that Mocap uses cba... and until cba is compatible properly with epoch you have to make workarounds like this!

 

you also get the cba mod missing error when starting up arma.

 

I have it all working from a client/assasins point of view even with a check to see that the player has mocap enabled and if its not enabled it just plays a generic kinda hit to the back of the other player before killing them.

 

is mocap stuff relies heavily on cba for most everything it does so im just using his animations and his timings and have taken it all from there. works really nicely with a scroll option as you can see and the animation changes dependant on whether you or the player is prone, etc....

 

also have checks in place to see if you are within 100m of a list of safezone markers etc to disable the option (as you can kill ai etc as well!) 

working on making it all self sufficient so that it just works nice and cleanly. Once i get all the animations working I was planning on using halv's messages (that we have on our server) to send out the message that such and such was assassinated by such and such.

 

from there on lots of things could be added like assassination leaderboards etc

Link to comment
Share on other sites

  • 0

Yeah now I understand why you were using a double animation setup since both parties are in animations.

I'm guessing now that we need to have a variable for each one, one for the attacker and one for the victim.

We know the attacker will see all, but both the attacker and the victim must send their respective animations out to the near _x's....

Glad you posted about this Happy.

Link to comment
Share on other sites

  • 0

In respects to cba, I used to run cba with cup back in Jan and Feb on my cherno, when cup required cba.

I wouldn't think it's gotten any worse and I had it working when everyone was having problems. ..

I'll have to find my backups from 3 servers ago.... and see what I did then to correct it/work around it.

What errors are popping on cba now? Didn't we have something from the devs a long time ago that they were going to work cba in/ make compatible? Might be wrong tho

Link to comment
Share on other sites

  • 0

no errors pop. it just doesnt work....

 

I think it may actually be not cba's fault and more that i think it uses bis_fnc_mp.

 

 

edit: just looked through the code again and cant seem to see it using bis_fnc_mp all that much and not at all for the animation side of things (although it definitely uses it for a few other things) so its more epoch thats stopping it working out of the box.

In the meantime im happy just getting the option to assassinate working properly, and then when we figure out this animation global issue then can think about adding in keybinds etc for the other commands such as kicking etc...

 

:D

Link to comment
Share on other sites

  • 0

Aight sounds good, I'm a wrap up in a blanket and push for 2 more hours of sleep.

I'll check back when I wake!

Interesting and good shit, I hope others see how people can work together here and make shit happen.

Maybe give a few of these ass hats a swift kick.

I'm so glad I added this line to my sig months ago

Your Helpful Replies and Quality INFO posts and Releases sums up a Persons Character
Link to comment
Share on other sites

  • 0

Sanchez - here is the latest working test version of my serverside switch :) executes great :)

 


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{};
//if !([_targetplayer,_this select 4]call EPOCH_server_getPToken)exitWith{}; //if I need it



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

Link to comment
Share on other sites

  • 0

working through the whole script now adding in checks for if the target has mocap enabled, and if they dont then to have them go to a black screen saying they have been assassinated or something so that they dont see themselves standing there doing nothing while the player carrying out the assassination does their animation.

 

still havent found how to detect another players group ID to compare it to the assassins (as a check to prevent the addaction occuring when you look at each other)

 

 

Once i have it all working Ill have a go at making it all a seperate file in its own pbo.

Link to comment
Share on other sites

  • 0

I read an old pm between us, involved the temp groups system, you mentioned leaving your epoch group kinda sucked.

take a read at the release thread, it doesn't remove you from the epoch group, it merely needs to allow you to start/join a temp group. It does no action on the epoch group in the database...

Back to the regularly scheduled show

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