| 10-19-2008, 12:19 AM | #1 |
hello, i have a problem regarding on XE_preloadability, XEcast and timer utils, i have 2 codes that doesnt work and 1 code that works, i dont know why the 2 codes doesnt work while the other one works heres the code CODE 1 : Working JASS:scope BurningLand initializer init globals private constant integer spell = 'A00Q' private constant integer dspell = 'A00R' private constant string order = "flamestrike" private boolean really = false endglobals private struct data unit cast integer level endstruct private function check takes nothing returns boolean return GetUnitAbilityLevel(GetTriggerUnit(), spell) > 0 endfunction private function startignite takes nothing returns nothing local timer t = GetExpiredTimer() local data d = GetTimerStructA(t) local xecast xe = xecast.createBasicA(dspell, OrderId(order), GetOwningPlayer(d.cast)) set xe.level = d.level call BJDebugMsg("timer running") set xe.recycledelay = 3 call xe.castOnPoint(GetUnitX(d.cast), GetUnitY(d.cast)) if really == true then call BJDebugMsg("end of spell") call PauseTimer(t) call ClearTimerStructA(t) call d.destroy() call DestroyTimer(t) set t = null endif endfunction private function Actions takes nothing returns nothing local unit cast = GetTriggerUnit() local timer t = CreateTimer() local data d = data.create() local integer l = GetUnitAbilityLevel(cast, spell) set d.cast = cast set d.level = l if GetIssuedOrderId() == OrderId("immolation") then call BJDebugMsg("turned on") call TimerStart(t, 0.50, true, function startignite) call SetTimerStructA(t, d) elseif GetIssuedOrderId() == OrderId("unimmolation") then call BJDebugMsg("turned off") set really = true endif set cast = null set t = null endfunction //=========================================================================== private function init takes nothing returns nothing local trigger t = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER ) call TriggerAddCondition(t, Condition(function check)) call TriggerAddAction( t, function Actions ) endfunction endscope CODE 2 : Not Working with XE_Preload JASS:scope BurningLand initializer init globals private constant integer spell = 'A00Q' private constant integer dspell = 'A00R' private constant string order = "flamestrike" private boolean really = false endglobals private struct data unit cast integer level endstruct private function check takes nothing returns boolean return GetUnitAbilityLevel(GetTriggerUnit(), spell) > 0 endfunction private function startignite takes nothing returns nothing local timer t = GetExpiredTimer() local data d = GetTimerStructA(t) local xecast xe = xecast.createBasicA(dspell, OrderId(order), GetOwningPlayer(d.cast)) set xe.level = d.level call BJDebugMsg("timer running") set xe.recycledelay = 3 call xe.castOnPoint(GetUnitX(d.cast), GetUnitY(d.cast)) if really == true then call BJDebugMsg("end of spell") call PauseTimer(t) call ClearTimerStructA(t) call d.destroy() call DestroyTimer(t) set t = null endif endfunction private function Actions takes nothing returns nothing local unit cast = GetTriggerUnit() local timer t = CreateTimer() local data d = data.create() local integer l = GetUnitAbilityLevel(cast, spell) set d.cast = cast set d.level = l if GetIssuedOrderId() == OrderId("immolation") then call BJDebugMsg("turned on") call TimerStart(t, 0.50, true, function startignite) call SetTimerStructA(t, d) elseif GetIssuedOrderId() == OrderId("unimmolation") then call BJDebugMsg("turned off") set really = true endif set cast = null set t = null endfunction //=========================================================================== private function init takes nothing returns nothing local trigger t = CreateTrigger( ) call XE_PreloadAbility(spell) call XE_PreloadAbility(dspell) call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER ) call TriggerAddCondition(t, Condition(function check)) call TriggerAddAction( t, function Actions ) endfunction endscope CODE 3 : Not working with TimerUtils JASS:scope BurningLand initializer init globals private constant integer spell = 'A00Q' private constant integer dspell = 'A00R' private constant string order = "flamestrike" private boolean really = false endglobals private struct data unit cast integer level endstruct private function check takes nothing returns boolean return GetUnitAbilityLevel(GetTriggerUnit(), spell) > 0 endfunction private function startignite takes nothing returns nothing local timer t = GetExpiredTimer() local data d = GetTimerData(t) local xecast xe = xecast.createBasicA(dspell, OrderId(order), GetOwningPlayer(d.cast)) set xe.level = d.level call BJDebugMsg("timer running") set xe.recycledelay = 3 call xe.castOnPoint(GetUnitX(d.cast), GetUnitY(d.cast)) if really == true then call BJDebugMsg("end of spell") call ReleaseTimer(t) call d.destroy() set t = null endif endfunction private function Actions takes nothing returns nothing local unit cast = GetTriggerUnit() local timer t = NewTimer() local data d = data.create() local integer l = GetUnitAbilityLevel(cast, spell) set d.cast = cast set d.level = l //call SetTimerData(t, d) *Tried placing it here and doesnt work* if GetIssuedOrderId() == OrderId("immolation") then call BJDebugMsg("turned on") call TimerStart(t, 0.50, true, function startignite) call SetTimerData(t, d) //still doesnt work elseif GetIssuedOrderId() == OrderId("unimmolation") then call BJDebugMsg("turned off") set really = true endif set cast = null set t = null endfunction //=========================================================================== private function init takes nothing returns nothing local trigger t = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER ) call TriggerAddCondition(t, Condition(function check)) call TriggerAddAction( t, function Actions ) endfunction endscope --------------------------------- CODE 1 works well CODE 2, when i started to use XE_preloadability a debug message appears on map init, saying "turned off", even though i havent turned off the spell, also when i started to activate the spell again, the code now doesnt work, like the code automatically turned off after the timer is running, these are the messages that appears when i started the spell and without turning the spell off "turned on" > "timer running" > "end of spell", as you can observe theres no "turned off" message appeared, it suddenly ends the spell without turning the spell off CODE 3 i just dont know why timer utils doesnt work here, what did i do wrong?? thanks |
| 10-19-2008, 01:19 AM | #2 | ||
Quote:
Quote:
|
| 10-19-2008, 01:53 AM | #3 |
About 2: apparently turned off orders fire when you remove an ability, have fun. |
