Cant create unit. Need help
I managed to find what was the cause and now im trying to find how to do it so can u tell me why the function i created bugs(it doesnt create the dummy unit)
JASS:
function Trig_FloatAttack_Condition takes nothing returns boolean
if ( not ( IsUnitType(GetEventDamageSource(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_FloatAttack_Actions takes nothing returns nothing
local location l
set l = GetUnitLoc(GetTriggerUnit())
if udg_CritChance[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] > GetRandomInt(0, 100) then
call CreateUnitAtLoc(GetOwningPlayer(GetEventDamageSource()), 'h002', l, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), GetTriggerUnit(), GetEventDamage(), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call CreateTextTagUnitBJ((I2S(R2I((GetEventDamage()*2)))), GetTriggerUnit(), 0, 10.00, 100, 100, 100.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90.00, 90 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
else
call CreateTextTagUnitBJ( I2S(R2I(GetEventDamage())), GetTriggerUnit(), 0, 8.00, 100, 100, 100.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90.00, 90 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
endif
set l = null
endfunction
I managed to find what was the cause and now im trying to find how to do it so can u tell me why the function i created bugs(it doesnt create the dummy unit)
Last edited: