HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Wait Bug Easy Solution?

01-09-2003, 09:33 PM#1
CBWhiz
[EDITed 1/11/03]
It should now work prooperly. make sure you get 2.04.
[/edit]

Please use this program on a map you have finished to test it. Run it and choose Fix Wait Bug.

It basicly replaces the TriggerSleepAction s with calls to the timer routine on the Repository. If you guys can confirm it works, ill post it in the Editing Tools board.

Link: CBWhiz's W3M Utilities 2.04. You dont need to register there to download it.

If it works, then you have a nice utility. I cant test it due to lack of free time.

Thanks!
[EDIT 2]
This map shows the diffrence, please check on multiplayer if both waits work ;)
Wait Test Map.w3m
01-09-2003, 11:42 PM#2
CBWhiz
[EDIT 1/11/03]
This post had code which didnt work, and I asked for info. The new version 2.04 fixes it.
01-10-2003, 12:36 AM#3
Guest
I'm not entirely certain, but don't the exitwhen conditions have to be within the loop itself and not inside if statements?

I'm curious, why is the original exit condition commented out?
01-10-2003, 02:00 PM#4
Kerry
This sounds like a great tool that should be of use by everyone but im noot good at JASS...
01-10-2003, 03:58 PM#5
Aiursrage2k
I would have too look at the method that the orginal wait uses, but I am fairly certain you are using the timer incorrectly.
01-10-2003, 05:40 PM#6
SuperIKI
You need a call of TriggerSleepAction in your method!
Your method contains an infinite loop without any TriggerSleepAction!!!
This causes WarCraft to loop, but then, when it consumed too much time, it causes WC to cancel the execution.
Look here:
http://www.wc3campaigns.com/forums/s...&threadid=4382
01-10-2003, 09:21 PM#7
CBWhiz
Ach hah!
Thank you SuperIKI.

I did notice while debuging that it just cancelled the whole trigger, for what seemed to have no cause.

I know its an infinite loop, but I guess I forgot that each trigger runs in a seperate thread, and war3 hates when triggers take to long.

I'll add that and test it, and if it works i'll fix my program.
01-10-2003, 09:50 PM#8
CBWhiz
Thanks, worked great.
I've "timed" with triggers both this method and the real TrigegrSleepAction on singleplayer, and both take about the same time.

Attached is a map which times both methods. The loop method will replace the normal method in your map when you use my program.

For the interested, heres the corrected looping code:
Code:
function SuperWait takes real duration returns nothing
    local timer WaitTimer
    set WaitTimer = CreateTimer( )
    set WaitTimer = StartTimerBJ (WaitTimer, false, duration)
    loop
        exitwhen TimerGetElapsed( WaitTimer ) >= duration
        call TriggerSleepAction (0.001)
        //Uncomment below for debug
        //call DisplayTextToForce( GetPlayersAll(), ( R2S(TimerGetElapsed( WaitTimer ))))
    endloop
    call DestroyTimer( WaitTimer)
endfunction
01-11-2003, 01:50 AM#9
Guest
Hey this sounds great even though I dont know what those codes are doing but Im sure alot of people will need this program. Great job.
01-11-2003, 08:14 PM#10
CBWhiz
just bumping, nobody seems to have tested it...
01-11-2003, 08:19 PM#11
CBWhiz
Quote:
Originally posted by JonahDean
I'm not entirely certain, but don't the exitwhen conditions have to be within the loop itself and not inside if statements?

I'm curious, why is the original exit condition commented out?

It was commented out because I tried that, and the same effect happened - W3 killed the trigger's thread. All I needed was TriggerSleepAction.