Проблема решилась переустановкой, но немного позже заметил ее источник:
"Enable Init function checking" в расширенных настройках. Без понятия, как она включилась, ну да ладно.
scope PackBuilding initializer Init //Packs a building into an item !T; !G
//TODO: Beautify
//GLITCHED: heals fully after packing in; Does not provide the item back if cancelled
//GLITCHED: Upon destruction of the item altar flag does not reset
globals
private constant integer SPELL_ID = 'MS00'
endglobals
private struct timerData //Used by the antiblight and animation timers
unit u
location l
endstruct
private function RemoveBlightUnit takes nothing returns nothing
//Kills the antiblight unit
local timerData data = GetTimerData(GetExpiredTimer())
call ReleaseTimer(GetExpiredTimer())
call RemoveUnit(data.u)
set data.u = null
call data.destroy()
endfunction
private function AnimationTimerFollowup takes timerData data returns nothing
call RemoveUnit(data.u)
call CreateItem('MI00', GetLocationX(data.l), GetLocationY(data.l))
set data.u = null
set data.l = null
call data.destroy()
endfunction
private function Conditions takes nothing returns boolean
return (GetSpellAbilityId() == SPELL_ID)
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local location l = GetUnitLoc(u)
local timer t = NewTimer()
local timerData blightData = timerData.create()
local timerData animData = timerData.create()
local unit blight = (CreateUnit(p, 'spu0', GetLocationX(l), GetLocationY(l), 0))
set animData.u = u
set animData.l = l
call TriggerSleepAction(0)
//Remove the building and create an item at it's location.
if GetUnitTypeId(u) == 'm000' then
call SetUnitAnimationReverseFollowed(u, 3, 1, 1, true, FollowUpFunc.AnimationTimerFollowup, animData)
elseif GetUnitTypeId(u) == 'm001' then
call RemoveUnit(u)
call CreateItem('MI01', GetLocationX(l), GetLocationY(l))
//Set the IsInItem flag to prevent multiple altars.
set playerProperties[GetPlayerId(p)].isAhdesAltarInItem = true
elseif GetUnitTypeId(u) == 'm002' then
call RemoveUnit(u)
call CreateItem('MI02', GetLocationX(l), GetLocationY(l))
elseif GetUnitTypeId(u) == 'm003' then
call RemoveUnit(u)
call CreateItem('MI03', GetLocationX(l), GetLocationY(l))
endif
//This whole thing to wait a second before killing the blight unit
//Waiting is required for the antiblight to spread
//I didn't use dispel because of possible cheese with it.
set blightData.u = blight
call SetTimerData(t, blightData)
call TimerStart(t, 1, false, function RemoveBlightUnit)
//Cleanup
set blightData.u = null
set animData.u = null
call blightData.destroy()
call animData.destroy()
set blight = null
set p = null
set u = null
set l = null
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function Actions)
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
set t = null
endfunction
endscope
Вот весь скоп. Через onDestroy еще не очень привык, перепишу.
8gabriel8, О, выглядит полезно, спасибо.
Но сами стартпосы меня привлекали тем. что их можно удобно в редакторе по карте таскать. Видимо придется работать ручками.
» WarCraft 3 / Выключились все триггеры и не хотят включаться обратно
"Enable Init function checking" в расширенных настройках. Без понятия, как она включилась, ну да ладно.
» WarCraft 3 / Как лучше всего создать области на карте?
» WarCraft 3 / Как лучше всего создать области на карте?
» WarCraft 3 / Юнит не сохраняется в структе
Отредактирован ApaxHoqpuJL
» WarCraft 3 / Юнит не сохраняется в структе
Отредактирован ApaxHoqpuJL
» WarCraft 3 / Юнит не сохраняется в структе
Отредактирован ApaxHoqpuJL
» WarCraft 3 / Приказ отмены постройки орков
Отредактирован ApaxHoqpuJL
» WarCraft 3 / Приказ отмены постройки орков
Отредактирован ApaxHoqpuJL
» WarCraft 3 / Приказ отмены постройки орков
Дебаг показывает что GetTriggerUnit() и GetConstructingStructure() оба возвращают строящееся здание.
» WarCraft 3 / Приказ отмены постройки орков
» WarCraft 3 / Стартовая позиция без игрока
Но сами стартпосы меня привлекали тем. что их можно удобно в редакторе по карте таскать. Видимо придется работать ручками.