• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Wait in timer

Status
Not open for further replies.
maybe he meant a looping wait inside a timer?...sample, a timer runs for every 0.1 seconds, then damages enemy(s) for every 5 seconds inside the loop?...

to do this, you need to use hashtables/indexing, set it to zero first during the casting...
then increase the variable to 0.1, when it reaches 5.0 set it back again to zero inside the loop...
 
an example of trigger:


JASS:
function timer takes nothing returns nothing
timer t = get expired timer blablabla.. (it is a 0.01 timer)

call BJDebugMsg("a")
call TriggerSleepAction(1.00)
call BJDebugMsg("b")

endfunction

well nothing happens past the wait...

ill try bribe thing

EDIT:
with Executefunc it simply skips the wait
and with a normal call it just bug like before :(

I dont get what u told me to do Justify ><
 
Last edited by a moderator:
He probably writed something like this.

JASS:
function waitfunc takes nothing returns nothing
    call TriggerSleepAction(1.00)
endfunction

function somefunc takes something returns something

//something
    call ExecuteFunc("waitfunc")
//actions that will be executed 1 seconds later.
endfunction
 
Read first post and his post again, he is talking about something completely different.
 
Then I should have read your post again, you were talking about something completely different.
 
He probably writed something like this.

JASS:
function waitfunc takes nothing returns nothing
    call TriggerSleepAction(1.00)
endfunction

function somefunc takes something returns something

//something
    call ExecuteFunc("waitfunc")
//actions that will be executed 1 seconds later.
endfunction

Yeah, which in that case of course would need to be changed to this:

JASS:
function waitfunc takes nothing returns nothing
    call TriggerSleepAction(1.00)
//actions that will be executed 1 seconds later.
endfunction

function somefunc takes something returns something

//something
    call ExecuteFunc("waitfunc")
endfunction
 
Save values to globals first, then call ExecuteFunc.

JASS:
function WaitedFunc takes nothing returns nothing
    local effect e = PassedEffect
    call TriggerSleepAction(PassedReal)
    call DestroyEffect(e)
    set e = null
endfunction

function MainFunction takes something returns something
//...
    set PassedEffect = AddSpecialEffectTarget(SomeUnit, "someEffect", "origin")
    set PassedReal = 5.00
    call ExecuteFunc("WaitedFunc")
//...
endfunction

or (I have never used it so I am not sure) you can use WaitedFunc.execute(unit, effect) to pass parameters, .execute use a trigger, a trigger action and globals to pass data.

I want my post to stay below 100:vw_sad:
 
Quite off-topic but you don't need to null handle arguments of function, they are not concerned with the bug (personally tested but you can test it yourself).
But locals declared in the corpse of a function have to be nulled, so it's lame when you have to return them :/ (just use a global in this case)
 
JASS:
function WaitedFunc takes effect e, real yourtime returns nothing
    call TriggerSleppAction(yourtime)
    call DestroyEffect(e)
    set e = null
endfunction

function Mainfunction takes nothing reutrns nothing
   call WaitedFunc(youreffect, 5.)
endfunction

?????

That won't work. WaitedFunc will run in the thread Mainfunction is, where you can't use waits --> WaitedFunc will crash it. You have to execute that function.
 
Status
Not open for further replies.
Back
Top