- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi guys,
I am having strange issues involving a system that periodically sets a unit's fly height implemented in a spell. A snippet from the spell:
A snippet from the height changing system:
The issue is this: with the current code (as given above), the unit does not change it's height, but
Any ideas? I will explain better if needed. [EDIT: Could it possibly be because the spell is in zinc but the system is in normal vJASS? I'm too lazy to rewrite either one of them to confirm ]
Thanks,
Mr_Bean
I am having strange issues involving a system that periodically sets a unit's fly height implemented in a spell. A snippet from the spell:
JASS:
DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl", GetUnitX(target), GetUnitY(target)));
Height.change(target, 500.0, 500.0);
TimerStart(GetExpiredTimer(), 2.0, false, function thistype.lowerCaster);
JASS:
public static method change takes unit u, real h, real s returns thistype
local thistype this = thistype.allocate()
local real difference = GetUnitFlyHeight(u) - h
if difference != 0.0 then
set .target = u
set .height = h
set .speed = s
set .increment = 0.03 * .speed
call UnitAddAbility(.target, 'Amrf')
call UnitRemoveAbility(.target, 'Amrf')
if difference < 0.0 then
call TimerStart(NewTimerEx(this), 0.03, true, function thistype.raise)
else
call TimerStart(NewTimerEx(this), 0.03, true, function thistype.lower)
endif
endif
return this
endmethod
thistype.lowerCaster
does execute (used a debug message). Then, if I comment out the one line as follows, the unit magically has its height changed:
JASS:
DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl", GetUnitX(target), GetUnitY(target)));
Height.change(target, 500.0, 500.0);
//TimerStart(GetExpiredTimer(), 2.0, false, function thistype.lowerCaster);
Any ideas? I will explain better if needed. [EDIT: Could it possibly be because the spell is in zinc but the system is in normal vJASS? I'm too lazy to rewrite either one of them to confirm ]
Thanks,
Mr_Bean