I got a trigger that isn't firing )= and i just can't find out why. There are 3 triggers about a dialog with 2 choices. The last one won't fire when it's timed to (10 sec after map start) but it will fire if the second trigger executes it. Ill show the neccesary information below.
Thoose are the globals used.
That's the first trigger which creates and shows the dialog.
Thats the second trigger which will execute the 3rd trigger if all players have voted.
And thats the 3rd trigger which will not fire on it's own event but only when executed by the second trigger. I have no idea what to do :/.
JASS:
globals
integer Number_Of_Players = 8
dialog Hero_Mode = DialogCreate()
button AR = DialogAddButton(Hero_Mode, "|cffffcc00A|rll Random", 65)
button SD = DialogAddButton(Hero_Mode, "|cffffcc00S|r|cffffffffingle Draft|r", 83)
integer Hero_Mode_Clicks = 0
integer Hero_Mode_Choice = 0
endglobals
Thoose are the globals used.
JASS:
function Trig_Hero_Mode_Dialog_Actions takes nothing returns nothing
local integer i = 0
call DialogSetMessage(Hero_Mode, "|cffff2222Select Hero Mode|r")
loop
call DialogDisplay(Player(i), Hero_Mode, true)
exitwhen i == 7
set i = i + 1
endloop
call BJDebugMsg("debug")
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Hero_Mode_Dialog takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterTimerEvent(t, 0.0, false)
call TriggerAddAction(t, function Trig_Hero_Mode_Dialog_Actions )
set t = null
endfunction
That's the first trigger which creates and shows the dialog.
JASS:
function Trig_Hero_Mode_Dialog_Response_Actions takes nothing returns nothing
set Hero_Mode_Clicks = Hero_Mode_Clicks + 1
call DialogDisplay(GetTriggerPlayer(), Hero_Mode, false)
if GetClickedButton() == AR then
set Hero_Mode_Choice = Hero_Mode_Choice + 1
else
set Hero_Mode_Choice = Hero_Mode_Choice - 1
endif
if Hero_Mode_Clicks == Number_Of_Players then
call DestroyTrigger(GetTriggeringTrigger())
call TriggerExecute(gg_trg_Hero_Mode_Dialog_Destroy)
endif
endfunction
//===========================================================================
function InitTrig_Hero_Mode_Dialog_Response takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterDialogEvent(t, Hero_Mode)
call TriggerAddAction( t, function Trig_Hero_Mode_Dialog_Response_Actions )
endfunction
Thats the second trigger which will execute the 3rd trigger if all players have voted.
JASS:
function Trig_Hero_Mode_Dialog_Destroy_Actions takes nothing returns nothing
local integer i = 0
call BJDebugMsg("WTF")
if Hero_Mode_Choice == 0 then
set Hero_Mode_Choice = GetRandomInt(-1, 0)
endif
if Hero_Mode_Choice >= 0 then
loop
call DialogDisplay(Player(i), Hero_Mode, false)
call DisplayTimedTextToPlayer(Player(i), 0, 0, 15, "|cff055bccAll Random chosen|r")
exitwhen i == 7
set i = i + 1
endloop
else
loop
call DialogDisplay(Player(i), Hero_Mode, false)
call DisplayTimedTextToPlayer(Player(i), 0, 0, 15, "|cff22cc22Single Draft Chosen|r")
exitwhen i == 7
set i = i + 1
endloop
endif
call DialogDestroy(Hero_Mode)
call DestroyTrigger(GetTriggeringTrigger())
call BJDebugMsg("WTFggggggggg")
endfunction
//===========================================================================
function InitTrig_Hero_Mode_Dialog_Destroy takes nothing returns nothing
set gg_trg_Hero_Mode_Dialog_Destroy = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Hero_Mode_Dialog_Destroy, 10.0, false)
call TriggerAddAction( gg_trg_Hero_Mode_Dialog_Destroy, function Trig_Hero_Mode_Dialog_Destroy_Actions )
endfunction
And thats the 3rd trigger which will not fire on it's own event but only when executed by the second trigger. I have no idea what to do :/.