XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
Тексттаг исчезает.
Тексттаг исчезает сразу после этих строк, в начале скила он появляется на 0.025 сек., а в цикле исчезает...
        if GetLocalPlayer() == p then
            SetTextTagVisibility(tx, true)
        endif
        SetTextTagText(tx,I2S(R2I(speed)) + " км/ч",fl)
        SetTextTagPosUnit(tx,d,fl)

Отредактировано Vadik29, 26.01.2014 в 14:07.
Старый 26.01.2014, 13:57
Hanabishi
COOL STATUS
offline
Опыт: отключен
Тут ничего нет, надо полный код
Старый 26.01.2014, 14:02
quq_CCCP
Я белый и пушистый!
offline
Опыт: 93,306
Активность:
Vadik29, юнит то существует? а то текстаг в центр карты кидает....
Не помоешала бы отладка с Debug msg где бы содержалось время и инфо что такой то шаг цикла, переменная tx = 8090102980324 и тп...
Старый 26.01.2014, 14:04
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
quq_CCCP, Да существует.
Hanabishi, Вот фул код (старый):
» Код:
function Trig_Bike_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A072' and udg_B == true
endfunction

function IsUnitBack_Bike takes unit uF, unit uWhichBack returns boolean
    real r1 = bj_RADTODEG * Atan2(GetUnitY(uWhichBack) - GetUnitY(uF), GetUnitX(uWhichBack) - GetUnitX(uF)) + 360
    real r2 = GetUnitFacing(uWhichBack) + 360
    return r1 <= (r2 + 60) and r1 >= (r2 - 60)
endfunction

function Trig_Bike_Actions3 takes nothing returns nothing
    unit e = GetEnumUnit()
    integer ide = GetHandleId(e)
    real dist = LoadReal(h, ide, 1)
    real x = GetUnitX(e)
    real y = GetUnitY(e)
    real a = LoadReal(h, ide, 0)
    if dist < 500 then
        SetUnitX(e, x + 30 * Cos(a))
        SetUnitY(e, y + 30 * Sin(a))
        SaveReal(h, ide, 1, dist + 30)
        DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMi​ssile.mdl", x, y))
    else
        GroupRemoveUnit(udg_Bike, e)
        FlushChildHashtable(h, ide)
    endif
    e = null
endfunction

function Trig_Bike_Actions2 takes nothing returns nothing
    timer t = GetExpiredTimer()
    integer id = GetHandleId(t)
    unit d = LoadUnitHandle(h, id, 1)
    unit u = LoadUnitHandle(h, id, 0)
    real speed = LoadReal(h, id, 2)
    texttag tx = LoadTextTagHandle(h,id,5)
    real x = GetUnitX(d)
    real y = GetUnitY(d)
    real x1
    real y1
    real x2
    real y2
    real a
    real fl = GetUnitFlyHeight(d) + 75 + (5.5 * 0.08) / 10
    real f = GetUnitFacing(d) * bj_DEGTORAD
    player p = GetOwningPlayer(u)
    real dmg = GetHeroAgi(u,true)*0.5
    integer ide
    if speed < 30+GetHeroAgi(u,true)*0.15 and udg_B == true and IsUnitType(u, UNIT_TYPE_DEAD) == false then
        DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMi​ssile.mdl", x, y))
        SetUnitAnimation(d, "Spell One")
        if GetLocalPlayer() == p then
            SetTextTagVisibility(tx, true)
        endif
        SetTextTagText(tx,I2S(R2I(speed)) + " км/ч",fl)
        SetTextTagPosUnit(tx,d,fl)

        SaveReal(h, id, 2, speed + 0.10)
        PauseUnit(d, false)
        GroupEnumUnitsInRange(G, x, y, 100, Base)
        loop
            E = FirstOfGroup(G)
                exitwhen E == null
            ide = GetHandleId(E)
            if IsUnitEnemy(E, p) and IsUnitType(E, UNIT_TYPE_STRUCTURE) == false and IsUnitInGroup(E, udg_Bike) == false and GetWidgetLife(E) > 0 then
                if IsUnitBack_Bike(u, E) == false and GetUnitAbilityLevel(d, 'A073') == 0 then
                    UnitDamageTarget(u, E, speed * 20 + dmg, false, false, null, null, null)
                elseif IsUnitBack_Bike(u, E) == true and GetUnitAbilityLevel(d, 'A073') == 0 then
                    UnitDamageTarget(u, E, speed * 20 * 1.3 + dmg, false, false, null, null, null)
                    n = CreateUnit(GetOwningPlayer(u), 'hmpr', x, y, 0)
                    IssueTargetOrder(n, "cripple", E)
                    UnitApplyTimedLife(n, 'B001', 1)
                elseif IsUnitBack_Bike(u, E) == true and GetUnitAbilityLevel(d, 'A073') > 0 then
                    UnitDamageTarget(u, E, speed * 20 * 1.6 + dmg, false, false, null, null, null)
                    n = CreateUnit(GetOwningPlayer(u), 'hmpr', x, y, 0)
                    IssueTargetOrder(n, "cripple", E)
                    UnitApplyTimedLife(n, 'B001', 1)
                elseif IsUnitBack_Bike(u, E) == false and GetUnitAbilityLevel(d, 'A073') > 0 then
                    UnitDamageTarget(u, E, speed * 20 * 1.3 + dmg, false, false, null, null, null)
                endif
                x1 = GetUnitX(E)
                y1 = GetUnitY(E)
                SaveReal(h, ide, 0, Atan2(y1 - y, x1 - x))
                GroupAddUnit(udg_Bike, E)
                DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl&qu​ot;, x1, y1))
                DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX.mdx", x1, y1))
            endif
            GroupRemoveUnit(G, E)
        endloop
        ForGroup(udg_Bike, function Trig_Bike_Actions3)
        if GetUnitAbilityLevel(d, 'A073') > 0 then
            SetUnitX(d, x + speed * 1.25 * Cos(f))
            SetUnitY(d, y + speed * 1.25 * Sin(f))
        else
            SetUnitX(d, x + speed * Cos(f))
            SetUnitY(d, y + speed * Sin(f))
        endif
    else
        SetUnitX(u, x)
        SetUnitY(u, y)
        RemoveUnit(d)
        ShowUnit(u, true)
        if (GetLocalPlayer() == p) then
            ClearSelection()
            SelectUnit(u, true)
        endif
        DestroyTextTag(tx)
        SetUnitInvulnerable(u, false)
        GroupClear(udg_Bike)
        DestroyTimer(t)
        FlushChildHashtable(h, id)
    endif
    tx = null
    t = null
    u = null
    d = null
endfunction

function Trig_Bike_Actions takes nothing returns nothing
    unit u = GetTriggerUnit()
    timer t = CreateTimer()
    player p = GetOwningPlayer(u)
    unit d = CreateUnit(p, 'e02K', GetUnitX(u), GetUnitY(u), GetUnitFacing(u))
    integer id = GetHandleId(t)
    texttag txt = CreateTextTag()
    ShowUnit(u, false)
    SetUnitInvulnerable(u, true)
    if (GetLocalPlayer() == p) then
        SetTextTagVisibility(txt, true) 
        ClearSelection()
        SelectUnit(d, true)
    endif
    SetTextTagText(txt, "0 км/ч", 0.03) 
    SetTextTagPosUnit(txt, d, 20) 
    SetUnitAnimation(d, "Spell One")
    if GetUnitAbilityLevel(u, 'B014') > 0 then
        UnitAddAbility(d, 'A073')
    endif
    SaveUnitHandle(h, id, 0, u)
    SaveUnitHandle(h, id, 1, d)
    SaveReal(h, id, 2, 1)
    SaveTextTagHandle(h,id,5,txt)
    TimerStart(t, 0.025, true, function Trig_Bike_Actions2)
    t = null
    u = null
    d = null
    p = null
    txt = null
endfunction

//===========================================================================
function InitTrig_Bike takes nothing returns nothing
    set gg_trg_Bike = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Bike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Bike, Condition( function Trig_Bike_Conditions ) )
    call TriggerAddAction( gg_trg_Bike, function Trig_Bike_Actions )
endfunction
Старый 26.01.2014, 14:07
DioD

offline
Опыт: 45,134
Активность:
нет отладочных сообщений, досвиданья.
Старый 26.01.2014, 16:17
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
DioD, эм, вы идиот? Я же написал конкретное место где происходит ошибка.
Старый 26.01.2014, 16:26
DioD

offline
Опыт: 45,134
Активность:
Я же написал конкретное место где происходит ошибка.
и чо?
на заборе тоже написано, отладку делай.
Старый 26.01.2014, 20:10
Hanabishi
COOL STATUS
offline
Опыт: отключен
Vadik29, возможно локал плеер фокусничает, попробуй поковырять его
Старый 26.01.2014, 21:50
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 18:52.