Hello, it's me getting stuck again. :/
"Action" won't show up after training a hero, unless i type "not" before the condition, but that just means my heroes aren't seen as heroes for some odd reason. Any ideas why could that be?
"Action" won't show up after training a hero, unless i type "not" before the condition, but that just means my heroes aren't seen as heroes for some odd reason. Any ideas why could that be?
JASS:
globals
integer array heroLevel
endglobals
function Trig_Level_1_Conditions takes nothing returns boolean
local integer heroIndex = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call BJDebugMsg("Condition")
call BJDebugMsg(I2S(heroIndex))
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) then
call BJDebugMsg("Action")
set heroLevel[heroIndex] = 1
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, ( heroIndex + 4 ), I2S(heroLevel[heroIndex]) )
endif
return true
endfunction
//===========================================================================
function InitTrig_Level_1 takes nothing returns nothing
set gg_trg_Level_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Level_1, EVENT_PLAYER_UNIT_TRAIN_FINISH)
call TriggerAddCondition(gg_trg_Level_1, Condition( function Trig_Level_1_Conditions ) )
endfunction