Jump to content

Recommended Posts

Hi,

Same guy another question..

In the same mission I want to be able to let JIP players sync with the server

With Objectives, time, weather etc

I know there is a way..

but I have no clue how to do it..

Tried the search options no luck there

Share this post


Link to post
Share on other sites

This is a way :

==========//Init.sqf//====================
X_inIT = false;
X_Server = false;
X_Client = false;
X_JIP = false;
X_SPE = false;
X_MP = (if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then {true} else {false});


if (isServer) then
{  
////Some Variable Here
blblabla = blablabla
};


if (isServer) then
{
X_Server = true;
if (!isDedicated) then 
{
X_Client = true;
X_SPE = true;
};
X_inIT = true;
} else {
X_Client = true;
if (isNull player) then
{
X_JIP = true;
[] spawn {waitUntil {!(isNull player)};X_inIT = true};
} else {
X_inIT = true;
};
};

waitUntil {X_inIT}; 

if (X_JIP ) then 
{
[] execVM "blablabla.sqf"
};
==================================

Just Use PublicVariable to validate Objective & it should work

Share this post


Link to post
Share on other sites

Tried it still not working. anymore ideas?

---------- Post added at 11:14 ---------- Previous post was at 11:00 ----------

To see the mission I am talking about

Click here to download it.

MODS needed

I44

HuertgenMap

Thanks in Advance

Share this post


Link to post
Share on other sites

Weather and time of day is automatically synced for JIP. JIP players will have the same weather as the server does. Of course there are general issues with how small variations of weather are not synced - For example if you set fog to 0.5 for everyone, fog will vary slightly over time, and in a different way for different clients. Or if you set heavy rain, it still won't rain ALL the time, and the times when it doesn't rain are not synced. But the setting of "heavy rain" (which is set in mission.sqm and can be changed with scripts) is synced.

The reason some might not think this is the case is that it only syncs when you join the server, and doesn't get synced if it was changed during the mission. So if you set time/weather in init.sqf only on the server (which runs after players have already connected) then players in-game might not get correct settings. If you run it in init.sqf on all machines, then players who JIP will get correct settings for a fraction of a second, but then init.sqf will change it back to the wrong settings.

The solution is to have a game logic in the editor and either place the code in its init line or in a script that you call compile preprocessFile from that game logic, and run it only on the server. That way the time/weather will be set before any players even load the briefing and be synced for everyone, including JIP players.

If you want to change time/weather during mission, though, you'll have to make sure the command runs on all connected clients as well, but does not run for those who JIP later on (those will get synced automatically to whatever the server is on once they join).

For tasks and briefings, you'll simply have to use some JIP-proof method (don't use variables before they are defined, and only define and publicVariable such variables on the server), or use SHK Taskmaster which already does those things and more.

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  

×