HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Every X seconds of game-time"

02-06-2007, 01:12 AM#1
Pyrogasm
I know that TriggerSleepAction() has a minmum time of 0.10 seconds or something like that. Does that minimum time apply to triggers that run "Every X seconds of game-time"?

If, for instance, I used this event:
Trigger:
Time - Every 0.06 seconds of game-time
Would it actually run only every 0.1 seconds (or whatever the minium time)?
02-06-2007, 01:17 AM#2
Mythic Fr0st
Time - Every 0.06 seconds of game-time

Runs every 0.06 Seconds

call PolledWait() and TriggerSleepAction() wait atleast 0.27 seconds

give or take a few 0.01's

so no I dont belive it does effect it

to test

Trigger:
Collapse Events
Time - Every 0.06 seconds
Conditions
Collapse Actions
Set X = X + 1
Trigger:
Collapse Events
Time - Every 0.27 seconds
Conditions
Collapse Actions
Set Y = Y + 1
Trigger:
Collapse Events
Player 1 red chat message containing the text -test as an exact match
Conditions
Collapse Actions
Game - Display to all players the text X + " Vs " + y
02-06-2007, 01:42 AM#3
Pyrogasm
Why thank you, Mythic Fr0st. They do indeed run at different intervals. Rep'd!
02-06-2007, 01:50 AM#4
Mythic Fr0st
Hmm, Thanks Mr Grammer. I guess I must talk perfectly now lol.
(Feel's his typing being watched)

I've never been +repped on here before lol

Darn, my grammer still is horrible lol
02-06-2007, 02:02 AM#5
Feroc1ty
Yes, it does not apply because the trigger actually creates a repeating timer, which calls back to the function you have made in that trigger.
02-06-2007, 02:02 AM#6
Pyrogasm
Spam.

That it is. It's rather atrocious; but at least you're better than:
Quote:
WOAH! stuffz c4n b3 MUI w1t LOCALS!!!

Oh, and I have a tendancy to rep people for being nice and all that jazz, you know.

Just look at Jokes-On-You's public profile:
Quote:
Originally Posted by Me
Gotta rep you for using good grammar and punctuation...
02-06-2007, 02:28 AM#7
Mythic Fr0st
Hehehe. :)
02-06-2007, 02:52 AM#8
wyrmlord
Mystic Fr0st seemed to cover everything. However, I believe I was told the minimum wait time was around 0.10 seconds and not .27. I'll have to double check to be sure.

EDIT: I believe this defines the minimum wait time.
Collapse JASS:
constant real      bj_POLLED_WAIT_INTERVAL          =  0.10
02-06-2007, 02:54 AM#9
Mythic Fr0st
Hmm, either way, I was told 0.27, but either way, its a sad 'extra" amount of wait time:(

Your probably right
02-06-2007, 04:43 AM#10
Jazradel
I think 0.27 is the time, BJ_POLLED_WAIT_INTERVAL is used in this:
Collapse JASS:
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