• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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