More details here:
http://hewiki.heroengine.com/wiki/RemoteCall2If a node is replicated to a client then it is defined both on the server and client, and has the same node ID on both sides.
"call client" will be for calling to either a single specific client ID, or a list of client IDs. If node is only defined on the remote side and not on the calling side, you cannot simply assign the node ID to a nodeRef variable to make the call. That is because when you assign to a nodeRef and it cannot find that node locally, the nodeRef becomes None and calling a method with that results in a script error. What you can do in that case (I
think) is assign the ID to a variable of type ID instead of nodeRef and then call the method on that variable.
"call clientreplicas" is handy when you know the node is replicated to 0 or more clients and you just want the call going to all clients which currently have it without having to specify exactly which clients those are.
Besides calling a method on a node, you may call a function in a script by specifying
scriptName:FunctionName().
You can remote call to a method of a system node by using the % symbol in place of the $ symbol when referencing the system node name, e.g.
call client someClientID %SystemNodeName.methodName()The "%" means that you are referencing a system node on the other side as opposed to a system node on the calling side. That is because both sides could have a system node with a given name, but
not necessarily be the same node ID.
Whether it be a function or method:
- Client ones to be called from the server must be labeled "remote".
- Server ones called from a client must be labeled "untrusted" (which is also a visual reminder that you should confirm the validity of the request to cut down on cheating).
- Server ones called from other server areas must be labeled "remote".