找回密码
 点一下
查看: 1555|回复: 1

创建漂浮文字失败的问题

[复制链接]
发表于 2009-4-20 21:16:39 | 显示全部楼层 |阅读模式
初学Jass处于白痴状态,用Jass写触发如下:
function Trig_burst_damage_Conditions takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'Bcri') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_burst_damage_Actions takes nothing returns nothing
    local location unit_point
    local real damage
    local texttag damage_text
    set unit_point = GetUnitLoc(GetAttacker())
    set damage = 4.00 * I2R(GetUnitAbilityLevel(udg_sirius, 'Acri'))
    call CreateTextTagLocBJ( R2S(damage), unit_point, 0, 10, 100, 100, 100, 0 )
    set damage_text = bj_lastCreatedTextTag
    call SetTextTagVelocity( damage_text, 64, 90 )
    call UnitDamageTarget( GetAttacker(), GetAttackedUnitBJ(), damage, true, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
endfunction

//===========================================================================
function InitTrig_burst_damage takes nothing returns nothing
    set gg_trg_burst_damage = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_burst_damage, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_burst_damage, Condition( function Trig_burst_damage_Conditions ) )
    call TriggerAddAction( gg_trg_burst_damage, function Trig_burst_damage_Actions )
endfunction

结果发现漂浮文字没有显示,其余部分正常,求高人解答……
 楼主| 发表于 2009-4-21 13:03:51 | 显示全部楼层
自己把问题搞定了,貌似是因为透明度设为0的时候不显示(那为什么透明度100也是不显示,严重不解)。
另外这个代码还有小bug,
set damage_text = bj_lastCreatedTextTag
这句后面少个括号,还有就是无排泄了……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-6 03:28 , Processed in 0.417792 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表