Jump to content

Recommended Posts

I d like to learn more about that command cause i ve to use it in near future i think.

 

In another thread we stuck at the point where we d like to send one variable together with the command to the clients and tried to let the other variable get the Client itsself.

 

this command should be executed on all clients:

player reveal _desired_object;

_desired_object should be sent from Server to all clients but player should be executed at the clients itsself to get the local player entity.

 

 

EDIT:

Could this be the solution?:

_desired_object remoteExec ["player reveal", -2];
Edited by sarogahtyp

Share this post


Link to post
Share on other sites

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

 

Go down to the examples and have a look.

 

There is everything you need. I dont know if you thing works, you need to test that, because you have got player reveal, not just a hint or setFuel or whatever.

 

Normaly it is :

"hello" remoteExec ["hint"]; 

-> Arma does that

<function> <paramaters>

-> which results in

hint "hello"

so what you try could function, however I would suggest to write a function for your reveal stuff and execute that - if your code does not work.

 

Regards Arkensor

Share this post


Link to post
Share on other sites

Go down to the examples and have a look...

 

There is everything you Need...

I crawled that examples before I opened that topic. It maybe that there is everything that u Need. but u cant say that for everyone. For me the examples r not detailed enough and I know that other guys struggled there, too.

I also thought about to do that with a function but I didnt solved it upto now. It s a short Problem which Needs a short command. An example would be appreciated.

  • Like 1

Share this post


Link to post
Share on other sites

There is everything you need to know on that wiki:

 

 

Example for script command:

// <params1> someScriptCommand <params2>;
[<params1>, <params2>] remoteExec ["someScriptCommand", targets, JIP];

[player, _desired_object] remoteExec ["reveal", 0];
  • Like 1

Share this post


Link to post
Share on other sites

There is everything you need to know on that wiki:

 

[player, _desired_object] remoteExec ["reveal", 0];

i dont thjnk that it works cause player is executed on server and returns null. null is sent to the client then and that is false.

  • Like 1

Share this post


Link to post
Share on other sites

The above should work : it will run on every machine, except the server if it is a dedicated one (since it has no player).

 

For Dedis, just change the targets to -2.

Share this post


Link to post
Share on other sites

i dont thjnk that it works cause player is executed on server and returns null. null is sent to the client then and that is false.

 

see below

  • Like 1

Share this post


Link to post
Share on other sites

 

That is correct, remoteexec will execute given command with identical params on every client. Even if you execute it on client where player is not null, it will execute it for the same player on every client not for the player that own each client. you will need "call"

 

[_desired_object, {player reveal _this}] remoteExec ["call", 0];

 

EDIT: server could be hosted, so 0 is fine for the target

  • Like 3

Share this post


Link to post
Share on other sites

EDIT: written before KKs posts
 

The above should work : it will run on every machine, except the server if it is a dedicated one (since it has no player).

For Dedis, just change the targets to -2.


sorry but i still think it cant.

two possibilities:

1. the content of both params is sent to clients. then player is null and _desired_object is its content and both is sent so.
2. both names r sent as they r. which means player is the correct entity for player at clients. but then _desired_object is not known at client because its a local variable at the server.


okay, 3rd possibility: i ,missunderstand that completly

Edited by sarogahtyp

Share this post


Link to post
Share on other sites

 

That is correct, remoteexec will execute given command with identical params on every client.

 

Doh! Silly me...

Thanks for the clarification KK!

Share this post


Link to post
Share on other sites

That is correct, remoteexec will execute given command with identical params on every client. Even if you execute it on client where player is not null, it will execute it for the same player on every client not for the player that own each client. you will need "call"

Thank u very much for that and for the solution. As I said, I m not the only guy who struggles with this.

I appreciate all answers even if they were not correct. I love that you guys always try to help. :) 

 

Share this post


Link to post
Share on other sites

I added a note to the remoteExec page with a quote from KK, I hope you don't mind.

  • Like 2

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

×