• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Timer Dialog Question

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
978
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,285
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
978
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