• 🏆 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!

[vJASS] vJASS Floating Text Problem

Status
Not open for further replies.
Level 4
Joined
Sep 12, 2008
Messages
111
The floating text doesn't show in Warcraft and the attachment point for spell 'A003' doesn't show also when I was testing... 'A003' spell is based on "Item Armor Bonus+1" and the attachment point is "head"..

JASS:
scope effect initializer Init

globals
    private constant integer UNIT_ID = 'h004'
endglobals

private function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetAttacker()) == UNIT_ID
endfunction

private function Actions takes nothing returns nothing
local integer size = GetRandomInt(3,5)
local integer ran = GetRandomInt(10,100)
local unit u = GetTriggerUnit()
local unit uu = GetAttacker()
local location l = GetUnitLoc(u)
local integer i = GetConvertedPlayerId(GetOwningPlayer(u))- 1
local texttag tt
    call RemoveUnit(uu)
    call UnitAddAbility(u, 'A004')
    call UnitAddAbility(u, 'A003')
 //   call AddSpecialEffectTarget("Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl", u, "head")
    set udg_Integer1[i] = GetHeroLevel(u) * 10
        if udg_Integer1[i] >= 50 then
        set udg_Integer1[i] = 50
        endif
    call CreateTextTagLocBJ("Success!", l, 0, size, ran, ran, ran, 0)
    set tt = GetLastCreatedTextTag()
    call SetTextTagPermanent( tt, false )
    call SetTextTagVelocity( tt, ran, ran )
    call SetTextTagFadepoint( tt, size )
    call SetTextTagLifespan( tt, size )
    call DisplayTimedTextToPlayer(Player(i),0.,0.,3.,"Testing..,local ran("+I2S(ran)+") and local size("+I2S(size)+").")
    call DisplayTimedTextToPlayer(Player(i),0.,0.,3.,"You are now invulnerable for "+I2S(udg_Integer1[i] / 10)+" seconds.")
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger Effect = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( Effect, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( Effect, Condition( function Conditions ) )
    call TriggerAddAction( Effect, function Actions )
endfunction

endscope

I know my Jassing isn't good but I can't see the floating text and the attachment thing. Please help me out thanks!:ogre_haosis:
 
Status
Not open for further replies.
Top