21

» WarCraft 3 / ubersplat

А какой путь нужно писать? Если те же эффекты можно взять из редактора объектов, то откуда брать путь, например, к трещинам на земле после Удара Грома?
21

» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3

uranus, еще пассивка Огненного Повелителя не работает, если создать её нестандартную копию.
21

» WarCraft 3 / ubersplat

quq_CCCP, я думал, что это часть эффекта. Их отдельно создавать можно (без эффекта) ?
21

» WarCraft 3 / Количество операций в одном потоке

ledoed, функции, которая вызывала остановку потока уже нету. Я код уже переписал. А код, что скинул сверху, это код к которому я добавлял что-то, после чего она начала останавливать поток. Как то так.
21

» WarCraft 3 / Количество операций в одном потоке

Я уже переделал код, и удалил большую часть, которая вызывала остановку потока. Это то, что осталось после. Сейчас я заново пишу код, с 3-мя таймерами.
- это всё одна функция.
		private static method iterate takes nothing returns nothing
            local  thistype  this   =  thistype( 0 ).next
            local  integer   index  =  0

            loop
                exitwhen ( this == 0 )

                set  this.duration  =  this.duration + FPS

                if ( this.duration <= this.circleDuration ) and IsUnitAlive( this.caster ) then

//                  Изменение прозрачности героя.
                    set  this.casterA  =  this.casterA - ( 155 / ( this.circleDuration / FPS ) )
                    call SetUnitVertexColor( this.caster, 255, 255, 255, R2I( this.casterA ) )
//                  ...

//                  Pасстановка двойников.
                    loop
                        if ( not this.illusionReady[ index ] ) and ( ( RAbsBJ( this.illusionX[ index ] - this.illusionTargetX[ index ] ) >= 12.0 ) or ( RAbsBJ( this.illusionY[ index ] - this.illusionTargetY[ index ] ) >= 12.0 ) ) then
                            set  this.dx                       =  this.illusionTargetX[ index ] - this.illusionX[ index ]
                            set  this.dy                       =  this.illusionTargetY[ index ] - this.illusionY[ index ]
                            set  this.dist                     =  SquareRoot( this.dx * this.dx + this.dy * this.dy )

                            set  this.illusionX[ index ]       =  GetUnitX( this.illusion[ index ] ) + 16.0 * ( this.dx / this.dist )
                            set  this.illusionY[ index ]       =  GetUnitY( this.illusion[ index ] ) + 16.0 * ( this.dy / this.dist )

                            call SetUnitX( this.illusion[ index ], this.illusionX[ index ] )
                            call SetUnitY( this.illusion[ index ], this.illusionY[ index ] )

                        elseif ( not this.illusionReady[ index ] ) then
                            set  this.illusionReady[ index ]  =  true
                            set  this.illusionReadyCount      =  this.illusionReadyCount + 1

                            call PauseUnit       ( this.illusion[ index ], false )
                            call SetUnitAnimation( this.illusion[ index ], "stand" )
                            call SetUnitMoveSpeed( this.illusion[ index ], 0.000000000000000001 )
                            call SetUnitFacing   ( this.illusion[ index ], bj_RADTODEG * Atan2( this.targetY - this.illusionY[ index ], this.targetX - this.illusionX[ index ] ) )
                        else
                            call BJDebugMsg( "WHATA" )
                        endif

                        set  index  =  index + 1
                        exitwhen ( index >= this.maxIllusionCount )
                    endloop
//                  ...

                    if ( this.illusionReadyCount == this.maxIllusionCount ) then
//                      Oбозначение круга.
                        set  this.circleAngle  =  this.circleAngle + 3.60
                        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl", this.targetX + this.circleRadius * Cos( ( this.circleAngle + 0.000 ) * bj_DEGTORAD ), this.targetY + this.circleRadius * Sin( ( this.circleAngle + 0.000 ) * bj_DEGTORAD ) ) )
                        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl", this.targetX + this.circleRadius * Cos( ( this.circleAngle + 120.0 ) * bj_DEGTORAD ), this.targetY + this.circleRadius * Sin( ( this.circleAngle + 120.0 ) * bj_DEGTORAD ) ) )
                        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl", this.targetX + this.circleRadius * Cos( ( this.circleAngle + 240.0 ) * bj_DEGTORAD ), this.targetY + this.circleRadius * Sin( ( this.circleAngle + 240.0 ) * bj_DEGTORAD ) ) )
//                      ...

//                      Cоздание эффектов внутри круга.
                        set  this.randomX  =  this.targetX + GetRandomReal( -this.circleRadius, this.circleRadius ) * Cos( GetRandomReal( 0.0, 360.0 ) * bj_DEGTORAD )
                        set  this.randomY  =  this.targetY + GetRandomReal( -this.circleRadius, this.circleRadius ) * Sin( GetRandomReal( 0.0, 360.0 ) * bj_DEGTORAD )
                        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", this.randomX, this.randomY ) )
//                      ...

//                      Hанесение урона всем врагажеским воинам в круге и их проклинание ( 100 %-ые промахи  ).
                        set  casterUnit  =  CreateUnit( this.owner, DUMMY_UNIT_ID, this.targetX, this.targetY, 0.0 )
                        call SetUnitInvulnerable( casterUnit, true )
                        call UnitAddAbility     ( casterUnit, 'Aloc' )
                        call UnitRemoveAbility  ( casterUnit, 'Amov' )
                        call UnitAddAbility     ( casterUnit, 'A003' )

                        call GroupEnumUnitsInRange( tGroup, this.targetX, this.targetY, this.circleRadius, null )
                        loop
                            set  this.enumUnit  =  FirstOfGroup( tGroup )
                            exitwhen ( this.enumUnit == null )
                            call GroupRemoveUnit( tGroup, this.enumUnit )

                            if IsUnitEnemy( this.enumUnit, this.owner ) and IsUnitAlive( this.enumUnit ) and ( not IsUnitType( this.enumUnit, UNIT_TYPE_STRUCTURE ) ) then
                                call UnitDamageTarget( this.caster, this.enumUnit, this.damage, true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE )
                                call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", this.enumUnit, "origin" ) )
                                call SetUnitX( casterUnit, GetUnitX( this.enumUnit ) )
                                call SetUnitY( casterUnit, GetUnitY( this.enumUnit ) )
                                call IssueTargetOrder( casterUnit, "curse", this.enumUnit )
                            endif
                        endloop

                        call RemoveUnit( casterUnit )
                        set  casterUnit  =  null
//                      ...

                    endif

                elseif ( this.duration > this.circleDuration ) and ( this.duration <= ( this.circleDuration + HERO_SLAM_ANIMATION_TIME ) ) and IsUnitAlive( this.caster ) then

//                  Удаление способнсоти для прыжка.
                    call UnitRemoveAbility( this.caster, DEACTIVATE_SPELL_ID )
                    call UnitAddAbility( this.caster, ACTIVATE_SPELL_ID )
//                  ...

//                  Прыжок героя.
                    if ( this.jumpMaxRange  ==  0.0 ) and ( this.jumpStep  ==  0.0 ) then
                        set  this.casterX           =  GetUnitX( this.caster )
                        set  this.casterY           =  GetUnitY( this.caster )
                        set  this.jumpMaxRange      =  SquareRoot( ( this.targetX - this.casterX ) * ( this.targetX - this.casterX ) + ( this.targetY - this.casterY ) * ( this.targetY - this.casterY ) )
                        set  this.jumpStep          =  this.jumpMaxRange  / ( HERO_SLAM_ANIMATION_TIME / FPS )

                        call SetUnitFacing( this.caster, bj_RADTODEG * Atan2( this.targetY - this.casterY, this.targetX - this.casterX ) )
                        call PauseUnit( this.caster, true )
                        call SetUnitPathing( this.caster, false )
                        call SetUnitAnimation( this.caster, "stand" )
                        call SetUnitAnimation( this.caster, "slam" )
                    endif

                    set  this.dx             =  this.targetX - this.casterX
                    set  this.dy             =  this.targetY - this.casterY
                    set  this.dist           =  SquareRoot( this.dx * this.dx + this.dy * this.dy )

                    set  this.casterX        =  this.casterX + this.jumpStep * ( this.dx / this.dist )
                    set  this.casterY        =  this.casterY + this.jumpStep * ( this.dy / this.dist )

                    call SetUnitX          ( this.caster, this.casterX )
                    call SetUnitY          ( this.caster, this.casterY )
                    call SetUnitFlyHeight  ( this.caster, GetParabolaZ( this.jumpHeight, this.jumpMaxRange, this.jumpMaxRange - this.dist ), 0.0 )
//                  ...

//                  Изменение прозрачности героя.
                    set  this.casterA  =  this.casterA + ( 155 / ( this.circleDuration / FPS ) )

//                  call SetUnitVertexColor( this.caster, 255, 255, 255, R2I( this.casterA ) )
                    call SetUnitVertexColor( this.caster, 255, 255, 255, 0 )
//                  ...

//                  Создание "хвоста" во время прыжка.
                    call imagealpha.create( this.caster, R2I( this.casterA ), bj_RADTODEG * Atan2( this.targetY - this.casterY, this.targetX - this.casterX ) )
//                  ...

//                  Анимация двойников и их удаление.
                    loop
                        if ( not this.illusionReady[ index ] ) then
                            call SetUnitVertexColor( this.illusion[ index ], 100, 100, 255, this.illusionA[ index ] )
                            set  this.illusionA[ index ]  =  this.illusionA[ index ] - 15

                            if ( this.illusionA[ index ] > 0 ) then
                                set  this.dx                       =  this.targetX - this.illusionX[ index ]
                                set  this.dy                       =  this.targetY - this.illusionY[ index ]
                                set  this.dist                     =  SquareRoot( this.dx * this.dx + this.dy * this.dy )

                                set  this.illusionX[ index ]  =  GetUnitX( this.illusion[ index ] ) + 16.0 * ( this.dx / this.dist )
                                set  this.illusionY[ index ]  =  GetUnitY( this.illusion[ index ] ) + 16.0 * ( this.dy / this.dist )

                                call SetUnitX( this.illusion[ index ], this.illusionX[ index ] )
                                call SetUnitY( this.illusion[ index ], this.illusionY[ index ] )

                            elseif ( this.illusionA[ index ] <= 0 ) then
                                call RemoveUnit( this.illusion[ index ] )
                                set  this.illusion[ index ]  =  null
                            endif

                        elseif ( this.illusionReady[ index ] ) then
                            set  this.illusionReady[ index ]  =  false
                            call PauseUnit( this.illusion[ index ], true )
                            call SetUnitAnimationByIndex( this.illusion[ index ], 6 )
                        endif

                        set  index  =  index + 1
                        exitwhen ( index >= this.maxIllusionCount )
                    endloop
//                  ...

                elseif ( this.duration > ( this.circleDuration + HERO_SLAM_ANIMATION_TIME ) ) and IsUnitAlive( this.caster ) then

//                  3авершение работы способности.
                    call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", this.targetX, this.targetY ) )
                    call SetUnitVertexColor( this.caster, 255, 255, 255, 255 )
                    call SetUnitFlyHeight  ( this.caster, 0.0, 0.0 )
                    call PauseUnit         ( this.caster, false )
                    call SetUnitPathing    ( this.caster, true )
//                  ...

//                  Замедление всех вражеских воинов в области действия.
                    set  casterUnit  =  CreateUnit( this.owner, DUMMY_UNIT_ID, this.targetX, this.targetY, 0.0 )
                    call SetUnitInvulnerable( casterUnit, true )
                    call UnitAddAbility     ( casterUnit, 'Aloc' )
                    call UnitRemoveAbility  ( casterUnit, 'Amov' )
                    call UnitAddAbility     ( casterUnit, 'A002' )
                    call IssueImmediateOrder( casterUnit, "thunderclap" )
                    call RemoveUnit( casterUnit )
                    set  casterUnit  =  null
//                  ...

//                  Hанесение финиального урона после прыжка.
                    call GroupEnumUnitsInRange( tGroup, this.targetX, this.targetY, this.circleRadius, null )
                    loop
                        set  this.enumUnit  =  FirstOfGroup( tGroup )
                        exitwhen ( this.enumUnit == null )
                        call GroupRemoveUnit( tGroup, this.enumUnit )

                        if IsUnitEnemy( this.enumUnit, this.owner ) and IsUnitAlive( this.enumUnit ) and ( not IsUnitType( this.enumUnit, UNIT_TYPE_STRUCTURE ) ) then
                            call UnitDamageTarget( this.caster, this.enumUnit, this.damage, true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE )
                            call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", this.enumUnit, "origin" ) )
                        endif
                    endloop
//                  ...

//                  Очистка ячейки массива.
                    set this.prev.next  =  this.next
                    set this.next.prev  =  this.prev

                    if ( thistype( 0 ).next == 0 ) then
                        call PauseTimer( period )
                    endif

                    call thistype.deallocate( this )
//                  ...

                elseif ( not IsUnitAlive( this.caster ) ) then
//                  Удаление всех двойников, если они имеются.
                    loop
                        if ( this.illusion[ index ] != null ) then
                            call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", this.illusionX[ index ], this.illusionY[ index ] ) )
                            call RemoveUnit( this.illusion[ index ] )
                        endif

                        set  index = index + 1
                        exitwhen ( index >= this.maxIllusionCount )
                    endloop
//                  ...

//                  Очистка ячейки массива.
                    set this.prev.next  =  this.next
                    set this.next.prev  =  this.prev

                    if ( thistype( 0 ).next == 0 ) then
                        call PauseTimer( period )
                    endif

                    call thistype.deallocate( this )
//                  ...
                endif

                set  this = this.next
            endloop
        endmethod
21

» WarCraft 3 / Количество операций в одном потоке

ledoed, сам не понимаю , как такое могло произойти . Бесконечных циклов нету , все циклу выполняются определённое количество раз через i = i + 1, exitwhen ( i == n )
21

» WarCraft 3 / Количество операций в одном потоке

Maniac_91, да нет. Это тестовая карта. В ней нет никаких триггеров. У меня там одна функция на ~ 350 строк, которая запускается через таймер каждые 0.03125 сек., а внутри функции куча if'ов, loop'ов... Пока что думаю разделить код на несколько таймеров.
21

» WarCraft 3 / Анимация юнита

Zahanc, а можно ускорить настолько, что будет проигрывать нужную анимацию через фрейм? То есть через таймер:
	call TimerStart( timer, 0.0, false, function code )
21

» WarCraft 3 / Анимация юнита

Zahanc, функцию ускорения анимации не подскажите? И на сколько можно ускорить анимацию?
21

» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3

Ходили же слухи о том, что BLIZZARD готовят Warcraft 4 или обновление графики Warcraft 3...
Может всё это с улучшенной графикой, новыми функциями и будет тем самым обновлением?
21

» WarCraft 3 / Как на Jass быстро посчитать количество боевых единиц?

Может это поможет?
native GetUnitCount           takes integer unitid              returns integer
native GetPlayerUnitTypeCount takes player p, integer unitid    returns integer
21

» XGM Конкурсы / Fun Spell Contest 2018

Принимаю участие в конкурсе!
А импорт обязателен? Или можно обойтись и без импорта?
21

» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3

Может кто-нибудь объяснить мне, человеку знакомому с программированием только благодаря JASS, почему у BLIZZARD нет исходного кода и почему его нельзя восстановить? Во что превращается исходный код после компилирования? Ведь, например, в JASS код после компиляции остаётся таким же читаемым или даже вообще не меняется.
21

» WarCraft 3 / Где ошибка?

У Вас тут вероятность срабатывания = 0,00001% (х. з. сколько там чисел после запятой в типе real). Вот и не срабатывает, потому что не прокают эти проценты.
21

» WarCraft 3 / дроп дерева

- На все случаи жизни:
	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