JASS:
function Detonate takes nothing returns nothing
local unit u
local timer x
call DisplayTextToForce(GetPlayersAll(), "Detonate")
set u = GetEnumUnit()
call IssueImmediateOrder(u, "thunderclap")
call TimerStart(x,5.0,false, null)
call RemoveUnit(u)
call DestroyTimer(x)
set u = null
set x = null
endfunction
function BombsAway takes nothing returns nothing
local group x
call DisplayTextToForce(GetPlayersAll(), "BombsAway")
set x = GetUnitsOfTypeIdAll('h003')
call ForGroup(x, function Detonate)
call DestroyGroup(x)
set x = null
endfunction
function Propogate takes nothing returns nothing
local unit u
local location loc
local real rx
local real ry
call DisplayTextToForce(GetPlayersAll(), "Propogate")
set u = GetEnumUnit()
set rx = (GetUnitX(u)+(GetRandomReal(-300,300)))
set ry = (GetUnitY(u)+(GetRandomReal(-300,300)))
set loc = Location(rx,ry)
call CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h003', loc, GetRandomReal(0,360))
call RemoveLocation(loc)
set u = null
set loc = null
endfunction
function Seedling takes nothing returns nothing
local group g
call DisplayTextToForce(GetPlayersAll(), "Seedling1")
set g = GetUnitsOfTypeIdAll('h003')
call ForGroup(g, function Propogate)
call DestroyGroup(g)
set g = null
endfunction
function Trig_ThunderBlossom_Conditions takes nothing returns boolean
local location loc
local unit c
local real rx
local real ry
local timer t1 = CreateTimer()
if (GetSpellAbilityId()=='A003') then
set c = GetTriggerUnit()
set loc = GetSpellTargetLoc()
call CreateUnitAtLoc( GetOwningPlayer( GetTriggerUnit() ) , 'h003', loc , GetRandomReal(0,360) )
call RemoveLocation(loc)
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,2.00,false,null)
call PauseTimer(t1)
call Seedling()
call TimerStart(t1,3.00,false,null)
call PauseTimer(t1)
call BombsAway()
call RemoveLocation(loc)
call DestroyTimer(t1)
set t1 = null
set c = null
set loc = null
endif
return true
endfunction
function InitTrig_ThunderBlossom takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_ThunderBlossom_Conditions ) )
set t = null
endfunction
So, it performs the entirety of what the functions say to do, but there's no delay in between function calls. I think I'm misunderstanding how the native TimerStart works, or not utilizing it correctly? I've been doing some reading about timer systems, but it sounds more like they're so you can continuously reuse timers across a bunch of functions. I'd just like to get a single timer to work.
The intent with this spell is that the 'h003' unit is doubled in an ever-widening area for 2^7+1 in total when they finally fire off.
What happens instead is that they all spawn, to the eye, simultaneously, attack instantaneously and as such, cause a little bit of lag. Prior tests of 2^8 and 2^9 came close to freezing the computer up.
So it appears that the problem is that the timer I'm using to delay calls of the Seedling function aren't working at all. Where am I going wrong and how do I fix it?