- Joined
- Aug 9, 2006
- Messages
- 2,384
Well, i made a own function which includes all the things for the texttags, so i could call it out of the header, but the texttag does not show.
Thats the function:
thats how i call it:
I really don't know why it won't work.
Thats the function:
JASS:
function CreateTextTagUnit takes string s, unit whichUnit, real zOffset, real size, integer red, integer green, integer blue, integer transparency, integer velocityA, integer velocityB, real lifespan, boolean perma, boolean visible returns texttag
local texttag LastTextTag = CreateTextTag()
call SetTextTagText(LastTextTag, s, size * 0.023 / 10)
call SetTextTagPosUnit(LastTextTag, whichUnit, zOffset)
call SetTextTagColor(LastTextTag, red, green, blue, transparency)
call SetTextTagVelocity( LastTextTag, velocityA, velocityB )
call SetTextTagLifespan( LastTextTag, lifespan )
call SetTextTagPermanent( LastTextTag, perma )
call SetTextTagVisibility( LastTextTag, visible )
return LastTextTag
endfunction
thats how i call it:
JASS:
function Trig_Viper_Agility_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00P') == true ) ) then
return false
endif
return true
endfunction
function Trig_Viper_Agility_Actions takes nothing returns nothing
local unit ViperUnit = GetAttacker()
local texttag ViperTxt
if GetRandomInt(1, 100) <= 50 then
set ViperTxt = CreateTextTagUnit("Viper Agility!", ViperUnit, 0.00, 10.00, 100, 100, 100, 100, 64, 90, 3.00, false, true)
call UnitAddAbility( ViperUnit, 'A00N' )
call PolledWait(3.00)
call UnitRemoveAbility( ViperUnit, 'A00N' )
set ViperTxt = null
endif
set ViperUnit = null
endfunction
//===========================================================================
function InitTrig_Viper_Agility takes nothing returns nothing
set gg_trg_Viper_Agility = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Viper_Agility, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Viper_Agility, Condition( function Trig_Viper_Agility_Conditions ) )
call TriggerAddAction( gg_trg_Viper_Agility, function Trig_Viper_Agility_Actions )
endfunction
I really don't know why it won't work.
Last edited: