• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Another question, waits

Status
Not open for further replies.
Level 8
Joined
Aug 1, 2008
Messages
420
Im helping my friend with his map, but he used game-time waits in some of his stuff. Ive heard they caused de-syncs so im helping him turn them back into normal waits. but does anybody know: How many seconds is 1 game-time second or vise versa? does anybody actually know the conversion? because this would save me alot of time.
 
Level 5
Joined
Aug 22, 2008
Messages
123
Well simply watch the function for wait (game time). It still uses Triggersleepaction but an additional timer to syncronize other players.
Code:
function PolledWait takes real duration returns nothing
    local timer t
    local real  timeRemaining

    if (duration > 0) then
        set t = CreateTimer()
        call TimerStart(t, duration, false, null)
        loop
            set timeRemaining = TimerGetRemaining(t)
            exitwhen timeRemaining <= 0

            // If we have a bit of time left, skip past 10% of the remaining
            // duration instead of checking every interval, to minimize the
            // polling on long waits.
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
        call DestroyTimer(t)
    endif
endfunction
 
Level 8
Joined
Aug 1, 2008
Messages
420
Sorry i dont understand jass. Tried to work out what it meant but couldnt find out :S

ok, if you say game-time waits are good, ill leave those how it is, thanks.
 
Status
Not open for further replies.
Top