• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Need Help

Status
Not open for further replies.
Level 8
Joined
Nov 20, 2008
Messages
445
Cant create unit. Need help

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:
Status
Not open for further replies.
Top