- Joined
- Mar 16, 2008
- Messages
- 955
There is no GUI option to have a specific unit event for a unit who's variable isn't set yet. So I was wondering it it would be possible to convert the trigger to JASS and replace that with udg variable? So the unit I want to track take damage for is udg_Red_King but its variable isn't set until the player chooses a hero, during the game. So GUI won't let me select that variable for this event type. I used WE to convert to custom text on that GUI trigger below but I replaced the variable. Will this work or is there some reason why GUI doesn't have that option?
JASS:
function Trig_AI_Red_King_Pages_Stop_Actions takes nothing returns nothing
call SetUnitOwner( udg_Red_King, Player(0), false )
call EnableTrigger( gg_trg_AI_Red_Receive_Gold )
call StartTimerBJ( udg_king_vendor_timer[1], false, 255.00 )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_AI_Red_King_Pages_Stop takes nothing returns nothing
set gg_trg_AI_Red_King_Pages_Stop = CreateTrigger( )
call DisableTrigger( gg_trg_AI_Red_King_Pages_Stop )
call TriggerRegisterUnitEvent( gg_trg_AI_Red_King_Pages_Stop, udg_Red_King, EVENT_UNIT_DAMAGED )
call TriggerAddAction( gg_trg_AI_Red_King_Pages_Stop, function Trig_AI_Red_King_Pages_Stop_Actions )
endfunction