• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Timer Dialog Question

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
973
I'm using timer dialogs for many timers on my map, but I have a question:
When I use local timerdialog td = CreateTimerDialogBJ( t , "title")
Does it appear for all the players?

And.. does it cause desyncs if I create it in a local block?

EDIT: And any idea why doesn't this work?
JASS:
call TimerDialogSetTitle(LoadTimerDialogHandle(udg_Table, GetHandleId(SEF_T[i]), 1), "Use SEF within:")
call TimerDialogDisplayForPlayerBJ( true, LoadTimerDialogHandle(udg_Table, GetHandleId(SEF_T[i]), 1) , Player(i))
call TimerStart(SEF_T[i], 30.00, false, function OutOfTime)
JASS:
set SEF_T[i] = CreateTimer()
call SaveInteger(udg_Table, GetHandleId(SEF_T[i]), 0, i)
call SaveTimerDialogHandle(udg_Table, GetHandleId(SEF_T[i]), 1, CreateTimerDialog(SEF_T[i]))

EDIT 2: This works tho:
JASS:
call TimerStart(SEF_T[i], 30.00, false, function OutOfTime)
call TimerDialogSetTitle(SEF_TD[i], "Use SEF within:")
call TimerDialogDisplayForPlayerBJ( true, SEF_TD[i] , Player(i))
JASS:
set SEF_T[i] = CreateTimer()
call SaveInteger(udg_Table, GetHandleId(SEF_T[i]), 0, i)
set SEF_TD[i] = CreateTimerDialog(SEF_T[i])
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
And.. does it cause desyncs if I create it in a local block?
It probably will cause a desync if created in the local block because it will desync the handle table.

However, it is perfectly fine to hide/show timer dialogs locally without causing a desync. It should also be perfectly fine to create the same timer dialog synchronously from a asynchronous timer object as long as all the timers involved exist synchronously.

EDIT: And any idea why doesn't this work?
I am guessing udg_Table is never initialized to a hashtable object? Usually is the cause of such failures.

Run this only once before using udg_Table, eg at map initialization.
JASS:
set udg_Table = InitHashtable()
 
Level 13
Joined
Jan 2, 2016
Messages
973
Ah, that's quite possible!
I am setting udg_Table to a hashtable during the game initialization, but most likely that happens after the initialization of this trigger :p
Thanks for explaining :)
EDIT: You prevented AT LEAST 1 future bug on my map :D (possibly more)
Would've taken me a lot of tests to find out what's not working :p
 
Last edited:
Status
Not open for further replies.
Top