- Joined
- Mar 22, 2009
- Messages
- 276
I tried using the return bug with timers but its not working with 1.24d patch. I tried using the hashtable but I failed on converting the timer handle into integer. Yes H2I problem again. I also tried doing it via structs but I've been confused with it.
Im trying to learn it to make jass spells for my map. I need to learn it for me to be able to make MUI/MPI looping spells.
Are there any way to convert handle to integer?
Or give me a sample. Fix this practice jass.
I dont care if I can declare the variables into PracticeB what I want is to practice the method of passing values for future spell making.
Thanks.
Im trying to learn it to make jass spells for my map. I need to learn it for me to be able to make MUI/MPI looping spells.
Are there any way to convert handle to integer?
Or give me a sample. Fix this practice jass.
JASS:
scope Practice initializer PracticeInit
private function PracticeA takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitLevel(u)
local timer t
//what shall I call here to store the value of integer i and unit u to be able to pass it to PracticeB?
call TimerStart( t, 1.00, true, function PracticeB )
endfunction
private function PracticeB takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u // = to what??
local integer i2 = 0
local integer i // = to what??
if i2 <= i then
//I'm planning to put some SetUnitPositionLoc here to make unit u move.
BJDebugMsg(I2S(i))
set i2 = i2 + 1
else
set i2 = 0
call DestroyTimer(t)
endif
endfunction
private function PracticeInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( t, function PracticeA )
endfunction
endscope
Thanks.