Jump to content
Sign in to follow this  
JacobJ

The right way to sync in MP?

Recommended Posts

Hello all

What is the best way to get all players syncronized? I have read around on the forum and some uses: waitUntil {!isnil player}, but would that do the trick?

I have some infotext at the beginning of the mission and it loads before the "Recieving..." disapears, so its already half past done when people enters the mission. How can I fix this?

/Jacob

Share this post


Link to post
Share on other sites

There has been a topic on this before and from what I can tell you is this:

Take your code that your using and take it out of your init.sqf (I presume your calling the Text that comes in at the bottom right of your screen) and place it in a new file I.e. text.sqf

Then put a trigger down where the players spawn and set it to the correct side (BLUFOR or OPFOR) and enter your desired countdown time.

In On Act. Put this:

null = execVM "text.sqf";

Hope that helps you out. Post back if you are still having problems!

-Bigshot

Share this post


Link to post
Share on other sites

Yeah okay, that would do the job for the text, thanks for that!

What about all the players joining the mission at the same time?

Is it possible to force the admin only to be able to press continue in the briefing screen when all players are ready? I know you get a message saying "all players are not ready" or something like that, but you are still able to press continue and start the game, alltho all players arent ready. Anyway around this?

Share this post


Link to post
Share on other sites

No, just wait for the Squares next to the players name to be blue squares...

Not to mention you can set that text trigger you made to repeat and then when someone joins in they get that text as well.

Share this post


Link to post
Share on other sites

waitUntil {!isNull player}; is meant for making sure that the player variable actually points to a unit, so that you can use it for whatever other scripts that need it.

Syncing stuff for JIP really depends on what you are trying to sync. Generally you just have to script everything with JIP in mind. As in, for every line of code you write you need to think "what would this line do for a JIP player? Is it really what I want? How can I fix it so that it does the same for JIP players?" Most often syncing problems are because mission maker assumes things happen in a certain order (for example task creation and task status update) but for JIP players it's not necessarily the case unless you make it be so. Same goes with initializing variables and updating them with the publicVariable command (you don't want to initialize variables in a way that overwrites values received from publicVariable).

As for the "receiving", unfortunately I don't think there is a way to predict how long it lasts, so you'll just have to make your info screen long enough so that most players get to see it. Also, lower view distance setting (set in server config, init.sqf or anywhere else, but not in user settings since those are ignored in multiplayer) seems to really cut down the "receiving" time.

Edited by galzohar

Share this post


Link to post
Share on other sites

Okay, I will try to lower the view distance. I have a graphic option in my mission to change the view distance onthefly, so that wont be a problem.

This mission of mine is not really depending on JIP, so the sync isnt a problem I think. But the players that are on the server at the start needs to be the players that are on the server all the time. Can I somehow make sure no one else can join the server as soon as it is started?

Share this post


Link to post
Share on other sites

In description.ext:

disabledAI=1;
respawn=BIRD;

Of course this also means that if you have less players your team will have less soldiers (as in, no AI support in place of missing players). If you do want to allow AI enabled then you will need some more complex scripting solution.

If you use the above description.ext settings, any JIP players will become a bird and if you run ACE will also get the spectator script initialized (regardless of whether you start it in the onPlayerRespawnAsSeagull.sqs script or not).

Of course even with the above you still might get weird errors/bugs/issues with JIP players if you don't script your mission to properly deal with JIP.

Share this post


Link to post
Share on other sites

Okay, so if I understand you correct about the disabledAI = 1, then when the lobby first starts and all players have choosen the unit they want to play and go into the game, the other slots are closed to people comming in afterwards?

I have disabledAI = 1 and I have ACE spectator running, so if what your saying is true, then I already have a solution running, stopping people to join the game after gamestart.

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
Sign in to follow this  

×