offline
Опыт:
1,815
Активность:
|
Нужна помощь
В результате оптимизации перестал работать тригер!!!Но удивительное в том что синтаксис не замечает ошибок!!!А карта не запускается, отключаю тригер всё норм.
Просьба помочь.
Смысл в том что юнит кастует спел и в точке каста создаётся огненная стена.
Код:
function Trig_Fire_wall_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Fire_wall_Actions takes nothing returns nothing
local integer start = 1
local integer end = 5
local unit caster = GetTriggerUnit()
local player owner = GetOwningPlayer(caster)
local location point = GetSpellTargetLoc()
local real duration = 10.00
local real dist = 70.00
set udg_Fire_Wall_Dummy_Ability = 'A001'
call CreateNUnitsAtLoc( 1, 'h002', owner, point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( duration, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( udg_Fire_Wall_Dummy_Ability, GetLastCreatedUnit() )
loop
exitwhen start > end
set udg_Fire_Wall_Loop_Location = PolarProjectionBJ(point, ( dist * start ), ( GetUnitFacing(caster) - 90.00 ))
call CreateNUnitsAtLoc( 1, 'h002', owner, udg_Fire_Wall_Loop_Location, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( duration, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( udg_Fire_Wall_Dummy_Ability, GetLastCreatedUnit() )
call AddSpecialEffectLocBJ( udg_Fire_Wall_Loop_Location, "Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set udg_Fire_Wall_Loop_Location_2 = PolarProjectionBJ(point, ( dist * start ), ( GetUnitFacing(caster) + 90.00 ))
call CreateNUnitsAtLoc( 1, 'h002', owner, udg_Fire_Wall_Loop_Location_2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( duration, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( udg_Fire_Wall_Dummy_Ability, GetLastCreatedUnit() )
call AddSpecialEffectLocBJ( udg_Fire_Wall_Loop_Location_2, "Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(udg_Fire_Wall_Loop_Location)
call RemoveLocation(udg_Fire_Wall_Loop_Location_2)
set start = start + 1
endloop
call RemoveLocation(point)
set caster = null
set owner = null
set duration = 0
set dist = 0
set udg_Fire_Wall_Dummy_Ability = null
set start = 0
set end = 0
endfunction
//===========================================================================
function InitTrig_Fire_wall takes nothing returns nothing
set gg_trg_Fire_wall = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_wall, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_wall, Condition( function Trig_Fire_wall_Conditions ) )
call TriggerAddAction( gg_trg_Fire_wall, function Trig_Fire_wall_Actions )
endfunction
N1XapOIII добавил:
Внимание синтаксис чекер он.
N1XapOIII добавил:
Модератор просьба закрыть тему, ошибка была, незнаю почему, из-за обнуления переменных. Удалил обнуление всё заработало.
N1XapOIII добавил:
Цитата:
set udg_Fire_Wall_Dummy_Ability = null
|
А точнее в этом месте
Надо было поставить
Цитата:
set udg_Fire_Wall_Dummy_Ability = 0
|
=)
|