I know I am asking a lot of questions about vJass but I'm starting to get the hang of it. I was using my shrinkray spell that I did earlier and I kinda, 'copied' the vJass knockback spell. But it's just to help me understand, this is what I have so far down below. But when I compile it, it gives me a Identifier Redeclared: "ray". I'm assuming that there was a new sytnax of doing things when the tutorial was actually done, hence it was done in 10-13-2007. Any help?
JASS:
globals
timer tim = CreateTimer()
shrinkray ray array Ar
integer Total = 0
endglobals
struct shrinkray
shrinkray ray
unit u
real size
endstruct
function Shrink takes unit u returns nothing
local shrinkray ray = shrinkray.create() // I create a compile error.
local integer q = 20
set shrinkray = shrinkray.create()
set ray.u = u
call SetUnitPosition(u, GetUnit(u), GetUnitY(u))
call PauseUnit(u, true)
if Total == 0 then
call TimerStart(Tim, .05, true, function Shrink_Execute)
endif
set Total = Total + 1
set Ar[Total - 1] = ray
endfunction
function Shrink_Execute takes nothing returns nothing
local shrinkray ray
local integer i = 0
local real newsize
loop
exitwhen i >= Total
set ray = Ar[i]
set newsize = ray.size - 5
call SetUnitScalePercent(ray.u, newsize, newsize, newsize)
if ray.size <= 30 then
call PauseUnit(ray.u, false)
set Ar[i] = Ar[Total - 1]
set Total = Total - 1
call ray.destroy()
endif
set i = i + 1
endloop
if Total == 0 then
call PauseTimer(Tim)
endif
endfunction