What is causing this remarkably strange problem
SOLVED
So the conclusion is... Avatar is buggy - don't use it
Use Channel instead ^_^
The title has now been changed from "Leaking? I don't think so..."
As my code was not leaking (well one minor leak that didn't actually influence anything)
After I use the ability there is a very noticable lag in obeying commands for the unit that cast the ability...
If someone could check my code and see if they know what is causing the problem, i would be most grateful ^_^
OKAY
Now after reading that let me point some things out
IT IS NOT THE ABILITY ITSELF WHICH LAGS
did you read that?
awesome!
Now read this...
IT IS THE COMMANDS ISSUED AFTER THE ABILITY HAS BEEN CAST WHICH LAG
did you read that?
Now re-read it just in case.
awesome!
#####
The preload tag is just there so that I know I need to include that resource when i do the init trigger.
*EDIT* I have rewritten the script to lower the amount of units in the group, just in case... but to no avail
same old problem
SOLVED
So the conclusion is... Avatar is buggy - don't use it
Use Channel instead ^_^
The title has now been changed from "Leaking? I don't think so..."
As my code was not leaking (well one minor leak that didn't actually influence anything)
After I use the ability there is a very noticable lag in obeying commands for the unit that cast the ability...
If someone could check my code and see if they know what is causing the problem, i would be most grateful ^_^
JASS:
function corpse_call_conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01H'
endfunction
function unit_dead takes nothing returns boolean
return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0
endfunction
function corpse_call_actions takes nothing returns nothing
//Variables
local unit Caster
local group All
local rect Map
local effect EffectMid
local effect EffectBot
local effect EffectHead
local string CorpseEffect
//Preload Resources
set CorpseEffect = "Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl"
call Preload(CorpseEffect)
//Initialise
set Caster = GetSpellAbilityUnit()
set Map = bj_mapInitialPlayableArea
set All = CreateGroup()
call GroupEnumUnitsInRect(All, Map, Condition(function unit_dead))
//Body of Ability
set EffectBot = AddSpecialEffectTarget(CorpseEffect, Caster, "origin")
set EffectMid = AddSpecialEffectTarget(CorpseEffect, Caster, "chest")
set EffectHead = AddSpecialEffectTarget(CorpseEffect, Caster, "head")
set bj_groupCountUnits = 0
call ForGroup(All, function CountUnitsInGroupEnum)
call SetUnitState(Caster, UNIT_STATE_LIFE, GetUnitState(Caster, UNIT_STATE_LIFE)+(25*bj_groupCountUnits))
call TriggerSleepAction(1.00)
//Clean up
call DestroyGroup(All)
call DestroyEffect(EffectBot)
call DestroyEffect(EffectMid)
call DestroyEffect(EffectHead)
set Caster = null
set EffectBot = null
set EffectMid = null
set EffectHead = null
set Map = null
set All = null
set CorpseEffect = null
endfunction
function AntiLeakFilterCorpseCall takes nothing returns boolean
return true
endfunction
//===========================================================================
function InitTrig_Corpse_Call takes nothing returns nothing
local trigger CorpseCall
local filterfunc filter
local integer index
set CorpseCall = CreateTrigger( )
set filter = Filter(function AntiLeakFilterCorpseCall)
set index = 0
loop
call TriggerRegisterPlayerUnitEvent(CorpseCall, Player(index), EVENT_PLAYER_UNIT_SPELL_CAST, filter)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( CorpseCall, Condition( function corpse_call_conditions ) )
call TriggerAddAction( CorpseCall, function corpse_call_actions )
call DestroyFilter(filter)
set CorpseCall = null
set filter = null
endfunction
OKAY
Now after reading that let me point some things out
IT IS NOT THE ABILITY ITSELF WHICH LAGS
did you read that?
awesome!
Now read this...
IT IS THE COMMANDS ISSUED AFTER THE ABILITY HAS BEEN CAST WHICH LAG
did you read that?
Now re-read it just in case.
awesome!
#####
The preload tag is just there so that I know I need to include that resource when i do the init trigger.
*EDIT* I have rewritten the script to lower the amount of units in the group, just in case... but to no avail
same old problem
Last edited: