Frozenwind
System maker
- Reaction score
- 99
I wanna know wether it's possible or not to pass some local value into a timerfunction and then return it.
I got some offset variable and I want to pass it into a timer and then increase it and the timer reruns.
I got this:
I got that I want the function that I marked with "//////" to happen in the timerfunction.
But, how can I increase those real values every time the timer reruns?
Or is it possible to count the number of times the timer expires into a local?
Cos in that case I can make it a formula as in: offset+5*integer
frozenwind.
PS
Don't worry I got a casting unit, this JASS trigger gets runned by a GUI trigger:
I got some offset variable and I want to pass it into a timer and then increase it and the timer reruns.
I got this:
JASS:
function Trig_TB_JASS_Functions_Loop_Actions takes nothing returns nothing
endfunction
function Trig_TB_JASS_Functions_Actions takes nothing returns nothing
// BEGIN INITATION
local location array loc
local unit cast = GetSpellAbilityUnit ()
local real array angle
local real offset = 0.00
local integer array A
local integer array B
local lightning array light
local location array temppoint
local timer t
set temppoint[0] = GetUnitLoc (cast)
set A[0] = 0
set A[1] = 2
loop
exitwhen A[0]>A[1]
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_088" )
set angle[A[0]] = I2R( A[0] * 120)
set loc[A[0]] = GetUnitLoc (cast)
set light[A[0]] = AddLightningLoc( "HWPB", temppoint[0], temppoint[0] )
set A[0] = A[0] + 1
endloop
// END INITATION
// BEGIN LOOPING
set A[0] = 0
set A[1] = 50
set B[1] = 2
loop
exitwhen A[0]>A[1]
set offset = offset + 5
set B[0] = 0
call DisplayTextToForce( GetPlayersAll(), R2S (offset) )
////////////////////////////////////////////////
loop
exitwhen B[0]>B[1]
set angle[B[0]] = angle[B[0]] + 4
set temppoint[1] = PolarProjectionBJ(loc[B[0]], offset, angle[B[0]])
call RemoveLocation (loc[B[0]])
set loc[B[0]] = temppoint[1]
set temppoint[1] = null
set B[0] = B[0] + 1
endloop
set B[0] = 0
set B[1] = 2
loop
exitwhen B[0] > B[1]
if B[0] == 2 then
set temppoint[2] = loc[0]
else
set temppoint[2] = loc[B[0]+1]
endif
call MoveLightningLoc( light[B[0]], loc[B[0]], temppoint[2] )
set temppoint[2] = null
set B[0] = B[0] + 1
endloop
///////////////////////////////////////////
set A[0] = A[0] + 1
call PolledWait( 0.01 )
endloop
call RemoveLocation (temppoint[0])
set temppoint[0] = null
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_089" )
// END LOOPING
endfunction
//===========================================================================
function InitTrig_TB_JASS_Functions takes nothing returns nothing
set gg_trg_TB_JASS_Functions = CreateTrigger( )
call TriggerAddAction( gg_trg_TB_JASS_Functions, function Trig_TB_JASS_Functions_Actions )
endfunction
But, how can I increase those real values every time the timer reruns?
Or is it possible to count the number of times the timer expires into a local?
Cos in that case I can make it a formula as in: offset+5*integer
frozenwind.
PS
Don't worry I got a casting unit, this JASS trigger gets runned by a GUI trigger:
Code:
TB Cast It
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to MySpell
Actions
Trigger - Run TB JASS Functions <gen> (ignoring conditions)