Bronxernijn
You can change this now in User CP.
- Reaction score
- 43
Dear people, I have a small problem. I am creating an object for use in the game (it is going to be expanded with other functions). This is the very first piece of JASS code I wrote. Somehow it does not do what it is supposed to (spawn a footman at the center of the region after 5 seconds). I think the event function is not totally correct. It is basically a converted GUI trigger. What did I do wrong?
JASS:
struct Capt
real SizeCor = 12
region Reg = CreateRegion()
static method Create takes integer x, integer y returns Capt
local Capt c = Capt.allocate()
local rect r = Rect((x-c.SizeCor), (y-c.SizeCor), (x+c.SizeCor), (y+c.SizeCor))
call RegionAddRect(c.Reg, r)
call CreateNUnitsAtLoc(1, 039;hfoo039;, Player(0), GetRectCenter(r), 0)
return c
endmethod
endstruct
function CaptInit takes nothing returns nothing
local integer x = 30
local integer y = 30
local Capt capturable = Capt.Create(x, y)
endfunction
function CaptEvent takes nothing returns nothing
local trigger c = gg_trg_Capturables
call TriggerRegisterTimerEventSingle(c, 5)
call TriggerAddAction(c, function CaptInit)
endfunction