GoGo-Boy
You can change this now in User CP
- Reaction score
- 40
Well I was making a trigger and used ABCT for it. Now everything worked fine... and then I must have changed what made my timer start function not to work... or I dunno. I tried Debug messages at the start of my timer and they don't show off, so I guess it's not running at all ;/. So if you please take a look at it and tell me what I made wrong? (Is, I guess, only a little issue) And if you find other flaws as well, tell me.
PS: I just started this triggers, it's far from being finished, don't wonder about the use of it^^
PS: I just started this triggers, it's far from being finished, don't wonder about the use of it^^
JASS:
scope Porting
globals
private constant real UNIT_LIGHT_Z = 50
private constant real LIGHT_HIGH = 590
endglobals
struct Light
lightning li
unit enter
integer int = 200
real portx
real porty
endstruct
function LightMove takes nothing returns boolean
local Light data = ABCT_GetData()
local real x = GetUnitX(data.enter)
local real y = GetUnitY(data.enter)
set data.int = data.int - 1
if data.int > 0 then
call MoveLightningEx(data.li,false,data.portx,data.porty,LIGHT_HIGH,x,y,UNIT_LIGHT_Z)
return false
endif
call DestroyLightning(data.li)
return true
endfunction
function Actions takes nothing returns nothing
local unit entering = GetTriggerUnit()
local region r1 = CreateRegion()
local region r2 = CreateRegion()
local region r3 = CreateRegion()
local real enterx = GetUnitX(entering)
local real entery = GetUnitY(entering)
local lightning lig
local Light data = Light.create()
local unit port
call RegionAddRect(r1,gg_rct_tl1)
call RegionAddRect(r2,gg_rct_tl2)
call RegionAddRect(r2,gg_rct_tl3)
if IsUnitInRegion(r1,entering) then
set lig = AddLightningEx("SPLK",false,4603,5570,LIGHT_HIGH,enterx,entery,UNIT_LIGHT_Z)
set data.portx = GetUnitX(port)
set data.porty = GetUnitY(port)
endif
set data.li = lig
set data.enter = entering
call ABCT_Start(function LightMove, data, 0.05)
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger Trig = CreateTrigger()
local region r1 = CreateRegion()
local region r2 = CreateRegion()
local region r3 = CreateRegion()
call RegionAddRect(r1,gg_rct_tl1)
call RegionAddRect(r2,gg_rct_tl2)
call RegionAddRect(r2,gg_rct_tl3)
call TriggerRegisterEnterRegion(Trig,r1,null)
call TriggerRegisterEnterRegion(Trig,r2,null)
call TriggerRegisterEnterRegion(Trig,r3,null)
call TriggerAddAction(Trig,function Actions)
endfunction
endscope