Подскажите, как создать отображающийся фарм дерева?
т.е. когда юнит убивает юнита и получает голду, награда за убийство отображается в виде плавающего текста, типа (+1) желтым, как сделать аналог, но с деревом?

Принятый ответ

- На все случаи жизни:
	globals
        constant    integer    FLOATING_TEXTTAG_GOLD                 =    0
        constant    integer    FLOATING_TEXTTAG_LUMBER               =    1
        constant    integer    FLOATING_TEXTTAG_BOUNTY               =    2
        constant    integer    FLOATING_TEXTTAG_MISS                 =    3
        constant    integer    FLOATING_TEXTTAG_CRITICAL_STRIKE      =    4
        constant    integer    FLOATING_TEXTTAG_SHADOW_STRIKE        =    5
        constant    integer    FLOATING_TEXTTAG_MANA_BURN            =    6
    endglobals


    function CreateFloatingTextTag takes player pl, integer texttagtype, integer value, real x, real y returns nothing
        if (texttagtype == FLOATING_TEXTTAG_GOLD) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag()
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 255, 220, 0, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 2.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_LUMBER) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag()
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 0, 200, 80, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 2.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_BOUNTY) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag( )
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 255, 220, 0, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 3.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_MISS) then
            set bj_lastCreatedTextTag =    CreateTextTag( )
            call SetTextTagText            (bj_lastCreatedTextTag, "промах", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 255, 0, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 3.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)

        elseif (texttagtype == FLOATING_TEXTTAG_CRITICAL_STRIKE) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, I2S(value) + "!", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 255, 0, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)

        elseif (texttagtype == FLOATING_TEXTTAG_SHADOW_STRIKE) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, I2S(value) + "!", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 158, 255, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)

        elseif (texttagtype == FLOATING_TEXTTAG_MANA_BURN) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, "-" + I2S(value), 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 81, 81, 255, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)
        endif
    endfunction
0
19
6 лет назад
0
Похожие вопросы:

ответ
Vonzon, так ты их выдели всех и ставь.
ответ
Не поленился, нашел:
Пора пилить статью на эту тему.

0
17
6 лет назад
0
плавующий текст
0
23
6 лет назад
Отредактирован МиниЗавод
0
Читать статьи, изучать редактор.
Тригерно давать юниту предмет со способностью вязанка дров, но сделать ей +1, а не +250
4
21
6 лет назад
Отредактирован scopterectus
4
- На все случаи жизни:
	globals
        constant    integer    FLOATING_TEXTTAG_GOLD                 =    0
        constant    integer    FLOATING_TEXTTAG_LUMBER               =    1
        constant    integer    FLOATING_TEXTTAG_BOUNTY               =    2
        constant    integer    FLOATING_TEXTTAG_MISS                 =    3
        constant    integer    FLOATING_TEXTTAG_CRITICAL_STRIKE      =    4
        constant    integer    FLOATING_TEXTTAG_SHADOW_STRIKE        =    5
        constant    integer    FLOATING_TEXTTAG_MANA_BURN            =    6
    endglobals


    function CreateFloatingTextTag takes player pl, integer texttagtype, integer value, real x, real y returns nothing
        if (texttagtype == FLOATING_TEXTTAG_GOLD) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag()
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 255, 220, 0, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 2.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_LUMBER) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag()
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 0, 200, 80, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 2.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_BOUNTY) then
            if (GetLocalPlayer() == pl) then
                set bj_lastCreatedTextTag =    CreateTextTag( )
                call SetTextTagText            (bj_lastCreatedTextTag, "+" + I2S(value), 0.023)
                call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
                call SetTextTagColor           (bj_lastCreatedTextTag, 255, 220, 0, 255)
                call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
                call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
                call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.029)
                call SetTextTagLifespan        (bj_lastCreatedTextTag, 3.0)
                call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)
            endif

        elseif (texttagtype == FLOATING_TEXTTAG_MISS) then
            set bj_lastCreatedTextTag =    CreateTextTag( )
            call SetTextTagText            (bj_lastCreatedTextTag, "промах", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 255, 0, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 3.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 1.0)

        elseif (texttagtype == FLOATING_TEXTTAG_CRITICAL_STRIKE) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, I2S(value) + "!", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 255, 0, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)

        elseif (texttagtype == FLOATING_TEXTTAG_SHADOW_STRIKE) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, I2S(value) + "!", 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 158, 255, 0, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)

        elseif (texttagtype == FLOATING_TEXTTAG_MANA_BURN) then
            set bj_lastCreatedTextTag =    CreateTextTag()
            call SetTextTagText            (bj_lastCreatedTextTag, "-" + I2S(value), 0.023)
            call SetTextTagPos             (bj_lastCreatedTextTag, x, y, 0.0)
            call SetTextTagColor           (bj_lastCreatedTextTag, 81, 81, 255, 255)
            call SetTextTagVisibility      (bj_lastCreatedTextTag, true)
            call SetTextTagPermanent       (bj_lastCreatedTextTag, false)
            call SetTextTagVelocity        (bj_lastCreatedTextTag, 0.0, 0.03993)
            call SetTextTagLifespan        (bj_lastCreatedTextTag, 5.0)
            call SetTextTagFadepoint       (bj_lastCreatedTextTag, 2.0)
        endif
    endfunction
Принятый ответ
0
24
6 лет назад
0
В паке наработок такое было
Чтобы оставить комментарий, пожалуйста, войдите на сайт.