А какой путь нужно писать? Если те же эффекты можно взять из редактора объектов, то откуда брать путь, например, к трещинам на земле после Удара Грома?
ledoed, функции, которая вызывала остановку потока уже нету. Я код уже переписал. А код, что скинул сверху, это код к которому я добавлял что-то, после чего она начала останавливать поток. Как то так.
Я уже переделал код, и удалил большую часть, которая вызывала остановку потока. Это то, что осталось после. Сейчас я заново пишу код, с 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
ledoed, сам не понимаю , как такое могло произойти . Бесконечных циклов нету , все циклу выполняются определённое количество раз через i = i + 1, exitwhen ( i == n )
Maniac_91, да нет. Это тестовая карта. В ней нет никаких триггеров. У меня там одна функция на ~ 350 строк, которая запускается через таймер каждые 0.03125 сек., а внутри функции куча if'ов, loop'ов... Пока что думаю разделить код на несколько таймеров.
Ходили же слухи о том, что BLIZZARD готовят Warcraft 4 или обновление графики Warcraft 3...
Может всё это с улучшенной графикой, новыми функциями и будет тем самым обновлением?
Может кто-нибудь объяснить мне, человеку знакомому с программированием только благодаря JASS, почему у BLIZZARD нет исходного кода и почему его нельзя восстановить? Во что превращается исходный код после компилирования? Ведь, например, в JASS код после компиляции остаётся таким же читаемым или даже вообще не меняется.
У Вас тут вероятность срабатывания = 0,00001% (х. з. сколько там чисел после запятой в типе real). Вот и не срабатывает, потому что не прокают эти проценты.
» WarCraft 3 / Как задетектить инвентарь?
» WarCraft 3 / ubersplat
» WarCraft 3 / ubersplat
» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3
Ред. scopterectus
» WarCraft 3 / ubersplat
» WarCraft 3 / Высота юнита GetUnitZ
» WarCraft 3 / Количество операций в одном потоке
Ред. scopterectus
» WarCraft 3 / Количество операций в одном потоке
» WarCraft 3 / Количество операций в одном потоке
Ред. scopterectus
» WarCraft 3 / Количество операций в одном потоке
» WarCraft 3 / Анимация юнита
» WarCraft 3 / Анимация юнита
Ред. scopterectus
» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3
Может всё это с улучшенной графикой, новыми функциями и будет тем самым обновлением?
» WarCraft 3 / Как на Jass быстро посчитать количество боевых единиц?
Ред. scopterectus
» WarCraft 3 / Как на Jass быстро посчитать количество боевых единиц?
» WarCraft 3 / Как на Jass быстро посчитать количество боевых единиц?
Ред. scopterectus
» WarCraft 3 / Как на Jass быстро посчитать количество боевых единиц?
» XGM Конкурсы / Fun Spell Contest 2018
» WarCraft 3 / Blizzard готовят Producer Update для Warcraft 3
» WarCraft 3 / Гора в лесу
» WarCraft 3 / Где ошибка?
Ред. scopterectus
» WarCraft 3 / Где ошибка?
» WarCraft 3 / PlaySound 71 звука подряд
Ред. scopterectus
» WarCraft 3 / дроп дерева
» WarCraft 3 / Скрытие стандартных иконок