xunin

time.sqf

30 posts in this topic

if (!isServer) exitWith {};

while {true} do
{
    if (daytime >= 19 || daytime < 5) then   // after 7pm and before 5am time multiplier changes
    {
        setTimeMultiplier 24      // adjust this value for slower or faster night cycle ( 24 hours will take 1 hour )
    }
    else
    {
        setTimeMultiplier 36      // adjust this value for slower or faster day cycle  ( 12 hours will take 1 hour )
    };

    uiSleep 30;
};

can someone explain how i setup a 3h day / 1h night cycle ... tried some setups but nothing happened

Share this post


Link to post
Share on other sites
Advertisement

Okay i want to explain this, the script says if the time is after 19.00 and before 5.00 a clock the time is running with the time Multiplier "24"

if the time is between 5.00 - 18.59 the time is running with the Multiplier "36".

 

The Range of the Multiplier  is 0.1 to 120; Multiplier 24 mean u have realtime x 24

I think the multis u want are 4 for day (3h(real)x4=12(ingame) and  12 for night(1h(real)x12=12h(ingame)

The posted Sheet is the Timesheed before patch 1.26.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
if (!isServer) exitWith {};

while {true} do
{
    if (daytime >= 19 || daytime < 5) then   // after 7pm and before 5am time multiplier changes
    {
        setTimeMultiplier 24      // adjust this value for slower or faster night cycle ( 24 hours will take 1 hour )
    }
    else
    {
        setTimeMultiplier 4      // adjust this value for slower or faster day cycle  ( 12 hours will take 1 hour )
    };

    uiSleep 30;
};

 

As above will give you about 3 hrs daytime and 1hr night.

Change top multiplier (24) to lower to make nights longer. (12 should give you about half hour night).

Change bottom multiplier (4) to 6 day will last 2 hrs.

 

 

Edited by [OMG]Slim
  • Like 1

Share this post


Link to post
Share on other sites

4 min late including edit, damn ;)

Edit: And my  edit was changing 12 to 24(in night multiplier) , but i think now @Suito is right it needs to be 12!

Edited by [OMG]Slim

Share this post


Link to post
Share on other sites

u have to use the initPlayerServer.sqf or better the initServer.sqf,

PlayerLocal are scripts that get startet if player joins, but executed on PlayerClient.

PlayerServer are the same above, just server-side, but if the server run for 2 hour your time is not correct rythm, cause the script is startet to late, (means maybe your night isnt fully)

Using initServer.sqf is in this opinion the best u can do, cause if the mission start the server will execute the script

 

the only thing u do is this: 

if (!isServer) exitWith {};

thats a check if the script is running on the server, if not it´s quit the script without doing anything

Edited by Suito

Share this post


Link to post
Share on other sites
Advertisement

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.