Jump to content
nodrog1061

Animations not working in multiplayer

Recommended Posts

i have been trying to use some animations for a script I am working on namely "HubSittingChairB_idle1" & "HaloFreeFall_non" for a reason beyond me the animation  "HubSittingChairB_idle1" works fine but "HaloFreeFall_non" shows the default stance but this only happens when the script is run on a multilayer user but works entirely fine on ai

 

where "HaloFreeFall_non" is called:

 
 
0
 Advanced issue found
 
 
Spoiler

_player = param[0,objNull];
_target = param[1,objNull];

detach _target;
_target attachTo [_player, [0, -0.2, -0.3]];
	systemChat "test 2 active";
 	 //bob playMove "HaloFreeFall_non";
while {player getVariable "freefall"} do {
	systemChat "ani true";
 	_target playMoveNow "HaloFreeFall_non";
 	//if (!alive _unit) exitWith {_unit enableAI "ANIM";_unit switchMove "";};
 	waitUntil {!(animationState _target == "HaloFreeFall_non")};
};

 

where  "HubSittingChairB_idle1" is called:

 
 
0
 Advanced issue found
 
 
Spoiler

["vehicle", {
    params ["_unit", "_newVehicle", "_oldVehicle"];

	if (player getVariable "attached")then{

		_player = player getVariable "tandem_player";
		_target = player getVariable "tandem_target";

		if(((typeOf _newVehicle) == "Steerable_Parachute_F") || ((typeOf _newVehicle) == "Steerable_Parachute_F"))then{
			player setVariable ["freefall",false];
			_target attachTo [_vehicle, [0, 0.3, -0.9]];
			//_target switchAction "Para_Pilot";
			_target switchmove "HubSittingChairB_idle1";
			_target enableSimulationGlobal false;
		};
		if (!((typeOf _newVehicle) == "Steerable_Parachute_F") && !((typeOf _newVehicle) == "Steerable_Parachute_F") && !(_oldVehicle isKindOf "Paraglide") && !(_oldVehicle isKindOf "Parachute"))then{
			_target enableSimulationGlobal true;
			[_player,_target] call SM_tandem_jumping_fnc_groundDetach;
		};
		if((_oldVehicle isKindOf "Paraglide") || (_oldVehicle isKindOf "Parachute"))then{
			_target enableSimulationGlobal true;
			[_player,_target] call SM_tandem_jumping_fnc_groundDetach;
			_target setPosATL [getPosATL _target select 0, getPosATL _target select 1, (getPosATL _target select 2) + 1];
			_target switchAction "GetOutPara";
		};

	};

}, true] call CBA_fnc_addPlayerEventHandler;

 

where the script that calls the script that executes "HaloFreeFall_non":

 
 
0
 Advanced issue found
 
 
Spoiler

player setVariable ["attached",true];

player setVariable ["tandem_player",_player];
player setVariable ["tandem_target",_target];

[]spawn{waitUntil {if((!isTouchingGround player) || ((velocity player select 2) <= -3))exitWith{true};false};
player setVariable ["freefall",true];
systemChat "test 1 true";
[player getVariable "tandem_player",player getVariable "tandem_target"] call SM_tandem_jumping_fnc_freeFall;
};

 

any help will be much appreciated.

Share this post


Link to post
Share on other sites

Really no one knows a answer to my question ?

Share this post


Link to post
Share on other sites
14 hours ago, Crielaard said:

https://community.bistudio.com/wiki/switchMove

 

The effect of seitchmove is global but the Argument is local. So the command must be executed on the machine where thw character is local

so is it because the code is not being run on the client's computer then? 

 

also thank you for replying I was losing hope 

Share this post


Link to post
Share on other sites

The code must run wherever the unit you are trying animate is local.

An AI placed in the scenario's is usually a server entity. (Unless its an AI in a player's group)

 

So if the script is run by a client, it wont work on the AI

 

In your case you try to animate a player it seems? If this script runs from the server, the player is not local to the server, it is local to the the player's computer. Thus it needs to be ran there.

https://community.bistudio.com/wiki/Multiplayer_Scripting

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×