ok so basically im making a simple dialog with jass,but it malfunctons for some reason...i don't get it,if i do it with gui exactly the same way,it works fine,but when I write it in jass it doesn't trigger and the entire map script crashes,all other triggers stop working too,debug messages won't come out either.Here is the function if you're interested:
dialog_race is a global dialog variable and dialog_race_buttons is a global dialog button variable.They're properly initiated and the dialog showed before i made the above function
JASS:
function Trig_Race_Selection_Buttons_Actions takes nothing returns nothing
local player clicker = GetTriggerPlayer()
local real X = GetLocationX(GetStartLocationLoc(GetPlayerStartLocation(clicker)))
local real Y = GetLocationY(GetStartLocationLoc(GetPlayerStartLocation(clicker)))
local integer ID = GetPlayerId(clicker)
local real range = 0
local integer index = 0
if( GetClickedButton() == dialog_race_buttons[0] ) then
set player_race[ID] = 0
call CreateUnit(clicker,039;h000039;,X,Y,270)
set range = GetRandomReal(-600,600)
loop
exitwhen(index == 3)
call CreateUnit(clicker,039;h006039;,X+range,Y+range,270)
set index = index + 1
endloop
set range = GetRandomReal(-800,800)
set index = 0
loop
exitwhen(index == 24)
call CreateUnit(clicker,039;o000039;,X+range,Y+range,270)
set index = index + 1
endloop
set range = GetRandomReal(-1200,1200)
set index = 0
loop
exitwhen(index == 5)
call CreateUnit(clicker,039;n00E039;,X+range,Y+range,270)
set index = index + 1
endloop
set range = GetRandomReal(-2400,2400)
set index = 0
call CreateUnit(clicker,039;h008039;,X+range,Y+range,270)
set range = range + GetRandomReal(-300,300)
loop
exitwhen(index == 4)
call CreateUnit(clicker,039;h009039;,X+range,Y+range,270)
set index = index + 1
endloop
elseif ( GetClickedButton() == dialog_race_buttons[1] ) then
elseif ( GetClickedButton() == dialog_race_buttons[2] ) then
else
endif
endfunction
function InitTrig_Race_Selection_Buttons takes nothing returns nothing
set gg_trg_Race_Selection_Buttons = CreateTrigger( )
call TriggerRegisterDialogEvent(gg_trg_Race_Selection_Buttons,dialog_race)
call TriggerAddAction( gg_trg_Race_Selection_Buttons, function Trig_Race_Selection_Buttons_Actions )
endfunction
dialog_race is a global dialog variable and dialog_race_buttons is a global dialog button variable.They're properly initiated and the dialog showed before i made the above function