+Healing shown above the unit

WarLuvr3393

Hmmm...too many things to play (WoW, COD4, WC3)
Reaction score
54
JASS:
scope levelseven initializer Init

private function spell_effect takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local texttag tt = CreateTextTag()
local real x = GetUnitX(u)
local real y = GetUnitY(u)

if GetSpellAbilityId() == 'A008' then
  call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE)+12)
  call SetTextTagText(tt, "+12", 10.0)
  call SetTextTagPosUnit(tt, u, 0)
  call SetTextTagColor(tt, 0, 255, 0, 255)
endif
endfunction

//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
  loop
    exitwhen i>12
      call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
      set i = i + 1
  endloop
    call TriggerAddAction(t, function spell_effect)
endfunction

endscope


This is the spell that I've been trying to code. Everything else works but the text tags. I didn't want to use a BJ so I just took everything from the BJ function and I wrote it out.

The problem is, it isn't even showing for some reason. I copied everything from the BJ function:

JASS:
function CreateTextTagUnitBJ takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
    set bj_lastCreatedTextTag = CreateTextTag()
    call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
    call SetTextTagPosUnitBJ(bj_lastCreatedTextTag, whichUnit, zOffset)
    call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)

    return bj_lastCreatedTextTag
endfunction


Well? Any ideas? Btw, this is my first time working with text tags, so I'm a bit confused.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top