• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Wait in timer

Status
Not open for further replies.
Level 29
Joined
Mar 10, 2009
Messages
5,016
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...
 
Level 9
Joined
Jul 4, 2007
Messages
130
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:
Level 12
Joined
Feb 22, 2010
Messages
1,115
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
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Read first post and his post again, he is talking about something completely different.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Then I should have read your post again, you were talking about something completely different.
 

Bribe

Code Moderator
Level 49
Joined
Sep 26, 2009
Messages
9,400
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
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
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:
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
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)
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
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.
Top