Server Sync Question

3 posts in this topic

Hello All,


A group of buddies and I are setting up our own server.  We all have development backgrounds but very new to Arma and modding.  I started writing my first script referencing several other addons.  I have a drone that gets deployed to a Military Base when a players runs in it.  I have checks in the script that do not send a drone if a drone is already deployed kind of thing.  In one of the addon examples, I saw a method that appears to execute code on the server rather than the client.  This has me wondering if I have coded my scripts wrong. 


For my script, I have been using the Eden editor.  I added a series of scripts that get initialized in the editor when the player loads.  The plan was to have the server mission.sqm file initialize these scripts on the server.  However, I am starting to think I dont understand where these scripts are executed.  Are they downloaded to the client?  If my boolean is set on one client that the drone has already been deployed, are all other clients updated to see that or are the variables client specific?  For example, if I am in a party, we both run into the military base, will two drones get deployed because my code is client specific instead of server specific?  Thanks!

Share this post

Link to post
Share on other sites

You can look at it like this: Anything in your Mission File (Exile.MapName.pbo) is client code. Anthing in @ExileServer/Addons is server code.

if you want your var to be updated on all clients, you can use the 3rd parameter in the setVariable command which determines if the variable should be broadcasted/public or not.

for example:

object setVariable ["DroneStatus", "Deployed", true];

This doesn't work when setting a variable on a player object. It will only make the value for that specific player public.

publicVariable is another command you can look at.

Edited by Mezo
  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.