As those of you, who came from wc3sear.ch may remember, I always tried to avoid the use of game cache whereever and whenever possible...
Well, thus, my ultimate enemy is the function "TriggerSleepAction", whose inconsistent functionality is well known...
Now the ill minded idea:
On map initialisation, I start a trigger, that does this:
Now, I have a value, that should be "equal" to ten seconds...
So, every wait time divided through this value should make the "TriggerSleepAction" wait as long as it is supposed to...
But, hey, that sounds too easily, does it not?
Potential problems:
Is the delay between supposed wait time and real wait time constant (per game) or relative to the amount of supposed wait time?
If it is constant, this code will not work.
If it is relative, what kind of (mathematical) function does it follow?
Is it linear, exponential, or something else?
If it is anything than linear, this code will not work.
Well, thus, my ultimate enemy is the function "TriggerSleepAction", whose inconsistent functionality is well known...
Now the ill minded idea:
On map initialisation, I start a trigger, that does this:
JASS:
function Trig_TimeAdjustment_Actions takes nothing returns nothing
local timer clock = CreateTimer()
call TimerStart(clock, 600, false, null)
call TriggerSleepAction(10)
set udg_WaitTimeDelay = TimerGetElapsed(clock)
call DestroyTimer(clock)
set clock = null
endfunction
Now, I have a value, that should be "equal" to ten seconds...
So, every wait time divided through this value should make the "TriggerSleepAction" wait as long as it is supposed to...
But, hey, that sounds too easily, does it not?
Potential problems:
Is the delay between supposed wait time and real wait time constant (per game) or relative to the amount of supposed wait time?
If it is constant, this code will not work.
If it is relative, what kind of (mathematical) function does it follow?
Is it linear, exponential, or something else?
If it is anything than linear, this code will not work.