Jump to content
thirith

Question concerning locality, server and waypoints

Recommended Posts

I expect this question has been answered elsewhere, but I've yet to find the relevant information. My question is about scripts that are executed only on the server and whether/how they cascade down to clients.

 

If I have a waypoint that is only completed once a certain variable (say CheckThis) is set to True and the server executes a script CheckThis = True, what happens? Does the server tell the clients that the waypoint has been completed, even though CheckThis isn't True yet on those clients? Or does the server do its own thing? Would I need to make CheckThis public after it's been set to True so that all the clients are on the same page as the server?

Share this post


Link to post
Share on other sites

Not so much...ish. Say I placed the waypoint in the editor, with CheckThis as a condition for completion. Now a server-only script sets CheckThis = True. What happens?

Share this post


Link to post
Share on other sites

Don't have access to my armatop right now but I would assume that the condition is only checked where the group is local. For AI groups that most likely is the server. If my assumption is correct then AI groups, which most often are local to the server, will start moving just fine. 

 

That's assuming my initial assumption is true. To test it put some debug print in  the condition and check. 

 

 

Share this post


Link to post
Share on other sites

Cheers. In other words, if I can't be sure that an AI group is local to the server, it's best to make sure that whatever causes the waypoint to complete happens on all machines, server and clients, right?

Share this post


Link to post
Share on other sites

Short answer is yes. 

Long answer is: [[], {CheckThis = true;}] remoteExec ["spawn", _group];

(minimize network traffic, only execute where group is local)

 

  • Like 1

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

×