Jump to content

Recommended Posts

Hi, been making a jets mission and iv run into a problem. I was using enableSimulation and hideObject to un freeze waves of jets. This was done with an addaction on a laptop that runs a script. 

 

The problem is that the jets weren't moving on connected players computers. Someone suggested I use enableSimulationGlobal and hideObjectGlobal. That solved it a little bit, when I push the button it works but when they push the button it still dosent.

 

I remembered having this problem with skipTime on an older mission and someone helped me out with that using remoteExec. That command looks like this.... 

 

[1] remoteExec ["skipTime", 0];  

 

That works fine across all computers, so I tried to apply that to my enableSimulation stuff but yeah, cant make it work. I throws no errors but dosent actually un freeze the planes. 

So far iv tried it like this...

 

[true] remoteexec ["p1 enablesimulation", 0]; 
[] remoteexec ["p1 enablesimulation true", 0]; 

 

What am I doing wrong here?

Any help much appreciated

 

 

Share this post


Link to post
Share on other sites

You should make a bookmark to https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

That way you can read the vital information on commands you want to use.

 

enableSimulationGlobal and hideObjectGlobal need to be executed on the server (2), not every machine (0), to work properly.

Also remoteExec(Call) has [arguments] remoteExecCall ["Function", Targets, JIP]

So "p1" is one of your arguments, not part of the function. I assume you've created the jets in Editor and assigned them these variables and that "p1" is the variable name of one jet.

[p1, true] remoteExecCall ["enableSimulationGlobal", 2]
[p1, false] remoteExecCall ["hideObjectGlobal", 2]

Basically what you want, but just how to use remoteExec(Call) and the both requested function properly. It might need some more work by yourself to work in your special environment depending how you handle the player actions etc.

In general you should invest some time in reading the wiki and other documentation for further issues you may come along in the future.

 

Share this post


Link to post
Share on other sites

Thanks so much, Im terrible at scripting myself, so I end up needing a lot of help with stuff I cant just set up in the editor. Im trying to learn though. If I could ask you something else.....

 

Im also removing an action from the laptop as you start each wave. That didn't work either (only removed for whoever pushed it) with just

 

lt1 removeaction 1;

 

So would that become

 

[lt1, 1] remoteExecCall ["removeAction", 2]

 

Or does that one need all connected computers with a 0 at the end?

Share this post


Link to post
Share on other sites

You just need to execute this on the client as a server doesn't have a UI.

 

And the actions stack the number. So if you remove action 1 and add another action it becomes the 2.

 

Also you need to call it with player instead of lt1 I guess, because lt1 is only one specific unit (If lt1 is an object it's fine)

Share this post


Link to post
Share on other sites

Thanks, yeah lt1 is a laptop so I think that bits ok. An yeah I figured out that it cant use the same number for extra tasks later.  If im reading this bit right from the wiki -2 should do all computers but not the server...

 

"When number is negative, the effect is inverted. -2 means execute on every client but not the server."

 

So would that make it...

 

[lt1, 1] remoteExecCall ["removeAction", -2] 

Share this post


Link to post
Share on other sites

Should work as expected.

Otherwise try:

{lt1 removeAction 1;} remoteExecCall ["bis_fnc_call", -2];

Share this post


Link to post
Share on other sites

Just dropping a big thanks to both of you, this all worked great and I feel like I understand remoteexeccall now 🙂

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

×