Page 5 of 5 FirstFirst 12345
Results 41 to 45 of 45

Thread: 1 Hour realtime = 24 Hour's ingame?

  1. #41
    Sergeant Major SNKMAN's Avatar
    Join Date
    Aug 29 2006
    Location
    Germany ( Lake Constance )
    Posts
    1,616
    Author of the Thread
    Yeah it always happends at 12 P.M. so exactly at midnight like bevore.

    Well some guy's told me, that they can't use the NVgoogles after the error becouse there are light flashes all over the screen and at i played the mission last time i get this too.

    Hope you can fix it.




  2. #42
    You're right And my fix was premature.

    I fixed this again and this time I even tested it It properly runs through time now and at midnight it skips one hour (to avoid DIV 0 annoyances). When using NV goggles it flashes exactly one time when the new day starts (don't ask me why) but then it continues to run normally. And if not let me know
    Again, delete the last two lines of the server script if you don't want an even more accelerated night time.

    Regards,
    Victor

    MPtimeserver.sqs
    Quote Originally Posted by [b
    Quote[/b] ]# Accelerated Time Server build 005, © 2007 Victor Farbau
    # Map objects needed: game logic called "Server"
    # servertime = continuous count of time in seconds (00:00 is skipped, too much workaround otherwise)
    # accel = acceleration factor (24h in 1h = accel 24)
    # _hourlist holds an array of scenic starting hours, could also be set to a fix value if desired
    # VFserverhours, VFservermin are public variables that contain the server time

    ?!(local Server): exit

    _accel = 24
    _taccel = _accel
    _onehour = 3600
    _oneday = (24 * _onehour) - _accel
    _hourlist = [4,5,6,7,12,17,18,19]
    _hourcount = (count _hourlist) - 1
    _servertime = (_hourlist select (random _hourcount)) * 3600

    #tempusfugit
    ~1
    _servertime = _servertime + _taccel
    ?(_servertime < _onehour): _servertime = _onehour + 1
    ?(_servertime > _oneday): _servertime = _onehour + 1
    VFserverhours = floor(_servertime / 3600)
    VFservermin = floor((_servertime MOD 3600) / 60)
    publicVariable "VFserverhours"
    publicVariable "VFservermin"
    ?((VFserverhours > 20) OR (VFserverhours < 3)) : _taccel = _accel * 2
    ?((VFserverhours > 3) AND (VFserverhours < 20)) : _taccel = _accel
    goto "tempusfugit"
    MPtimeclient.sqs
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"># If this runs on a dedicated server - quit now
    ?&#40;player &#33;= player&#41;&#58; exit

    # Init global variables locally to avoid undefined values being used; then wait 5 sec for server
    ~5

    #tempusfugit
    ~1
    _localhours = floor daytime
    _localmin = 60 * &#40;daytime MOD &#40;floor daytime&#41;&#41;
    skipTime &#40;VFserverhours - _localhours&#41;
    skipTime &#40;&#40;VFservermin - _localmin&#41; / 60&#41;
    goto &#34;tempusfugit&#34;[/QUOTE]

  3. #43
    Hi there all

    @ Victor

    Sorry to trouble but would the above mentioned scripts work in single player mode and if so could you tell me how to run it

    As i undestand you need a Game logic called server and from there i am totally lost

    Sorry i am still very wet behind the ears wheni tcomes to editing

    @ all old hand and scripting vetrans

    I really take my hat off to guys and i just wanted to say thanks for the hard work you guys do

  4. #44
    Sergeant Major SNKMAN's Avatar
    Join Date
    Aug 29 2006
    Location
    Germany ( Lake Constance )
    Posts
    1,616
    Author of the Thread
    Well for single player you need only this:

    MPtimeclient.sqs"
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"># If this runs on a dedicated server - quit now
    ?&#40;player &#33;= player&#41;&#58; exit

    # Init global variables locally to avoid undefined values being used; then wait 5 sec for server
    ~5

    #tempusfugit
    ~1
    _localhours = floor daytime
    _localmin = 60 * &#40;daytime MOD &#40;floor daytime&#41;&#41;
    skipTime &#40;VFserverhours - _localhours&#41;
    skipTime &#40;&#40;VFservermin - _localmin&#41; / 60&#41;
    goto &#34;tempusfugit&#34;[/QUOTE]

    The other script is just for Server Sync.

    Okay create a new text document with "Notepad" for example call it "init.sqs" put it into your Mission folder and write this in it:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;&#93; exec &#34;MPtimeclient.sqs&#34;
    [/QUOTE]

    Put the "MPtimeclient.sqs" Script in your mission folder, create a Game Logic called Server and that&#39;s it.




  5. #45
    Sergeant Major SNKMAN's Avatar
    Join Date
    Aug 29 2006
    Location
    Germany ( Lake Constance )
    Posts
    1,616
    Author of the Thread
    Hey sickboy,

    just tested your Script and it look&#39;s like Time is not Sync on a Server after JIP.

    Maybe it&#39;s becouse of 1.05 (beta) i don&#39;t know...

    May can you fix it?

    EDIT: Never mind

    It works the time just need some time to Sync.

    Pretty good job Sickboy




Page 5 of 5 FirstFirst 12345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •