Jump to content
Forxtop

Issue with switchMove

Recommended Posts

Hello!

 

I would like to put anim on some IA. Like i always did, i put

this allowdamage false; this disableAI "ANIM"; this switchMove "Acts_CivilInjuredArms_1"; this setCaptive true;  

 

in the init field. It's ok in solo, not on our dedicated.

 

So i chanched, i tried :

this allowdamage false; [this,"Acts_CivilInjuredArms_1"] remoteExec ["SwitchMove",AllPlayers,True]; this setCaptive true;

Because maybe it was a locality problem (but initBox are still a global space ?).

 

But always nothing. Mens are just up and don't move.

And i ask you some help to avoid to lost too many times. Have you any ideas ?

 

Thanks!

Share this post


Link to post
Share on other sites

The issue happened when i test the mission on our dedicated server. And i tried with a friend (same problem for him).  :(

Share this post


Link to post
Share on other sites

I am also a newbie with scripts actually but handled animations with following script (name it animation.sqf for instance), which I get from someone I guess :)
 

if (isServer) exitWith {};

_unit= _this select 0;
_anim= _this select 1;
[_unit, _anim] remoteExec ["switchMove", 0,true];

And inside the unit INITs you can call this script

Share this post


Link to post
Share on other sites
Guest

Still wondering why anims does not automaticaly broadcast (or add animMp command). As always bohemia, keep adding badly optimised dlcs while we struggle having basic function to work properly. (Rip str hack on AL servers)

Share this post


Link to post
Share on other sites

I also don't get why switchmove has local effect. Local argument global effect would make more sense but maybe there is a point which I am missing :)

Share this post


Link to post
Share on other sites

Thanks devastor but i've already tried to force the global effect via the remoteExec, exactly like you did. I will make some others tests and i will tell you if i found something.

Share this post


Link to post
Share on other sites

but you run the command inside the object init and object belongs to server so local effect will be seen only by server. If you use execvm to run the script which I wrote I think it is running on each client except server (due to if clause).

That is what I think how it works so I still advise you to give a try to above script and running it via execvm from object init

Share this post


Link to post
Share on other sites

I fixed the issue, but i don't like that, i didn't understand the root of the problem, because, is it sure that the initBox is a global space ? Read by all clients? So how i fixed it :

 

I've made a function (fnc_AnimPlage, compiled with a gameLogic to be sure the function is compiled at the very begining) :

_Unit = _this select 0;
_anim = selectRandom ["Acts_CivilInjuredArms_1","Acts_CivilInjuredChest_1","Acts_CivilInjuredHead_1","Acts_CivilInjuredGeneral_1","Acts_CivilInjuredLegs_1","Acts_CivilShocked_2"];
_Unit allowdamage false;
_Unit disableAI "ANIM";  
[_Unit,_anim] remoteExec ["SwitchMove",0,True]; 
_Unit setCaptive true;
_Unit setDir random 360;

And in the init of my 30 boys, i called the function basicaly 

[this] spawn fnc_AnimPlage;

Thanks to everyone  ;)

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

×