HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Way of the "Waiter"

08-24-2007, 03:57 PM#1
MaD[Lion]
Just wanted to make a fancy title.
Anyway i love textmacros, and with textmacro i made a custom wait.

It works in the same way as with PolledWait, but the accuracy is 0.03 seconds accurate. It could be 0.01 but i just wanted to test this method so i based the custom wait on my OOMS system which runs on 0.03.

The only requirement it need is that you have to declare a special function with textmacro, and it only works inside this function.
So when an Event occur, call this function and voila... works.
Also note tat u cant call this function with call functioname(). You need to call it like this:
call Scene.Play(ConditionalFunction.functioname)
It is a bit more to write, but its only copy paste and change the functioname.

Just think of it as a special way to call a special function tat give u a special wait :)

NOTE: the map name is Scene. Since this is an early attempt on a cinematic system. Dont ask me why i make another cinematic system...

Edit: another notation is tat u cant use custom wait inside loops. Scroll down to see how u can use custom wait
Attached Files
File type: w3xScene.w3x (41.3 KB)
08-24-2007, 04:00 PM#2
cohadar
Please post at least some code in JASS tag,
I don't have WE everywhere I go.
08-24-2007, 04:19 PM#3
Rising_Dusk
Normally you go to their table after they've been seated, then asking what type of drink you'd like. Make sure to introduce yourself! That's an important step. Once you've gotten their drinks, check if they're ready to order or would like some appetizers, tell them the specials, so on and so forth.

After ordering, check back with them periodically and refill their drinks BEFORE they need to ask you to do it. When all done, they'll ask YOU for the check (Don't just put it there, makes them feel as if you want to get rid of them).

If you follow all of these steps, you too can master the way of the waiter.
08-24-2007, 04:28 PM#4
NightBreeze
Do you have any idea how hard I had to restrain myself to not post something like that Rising_Dusk? I feel betrayed!

On topic: Have you found a situation where this is more convenient/fitting/user-friendly/etc to use than a timer?
08-24-2007, 05:24 PM#5
MaD[Lion]
yes, the answer is this:
we timer u need to callback another function which means u will lose all local vars. And also you have to write stuff in a new func. So the good thing is tat u can write it all in lines in same trigger file.

here is how u can use the custom wait:

Collapse JASS:
//! runtextmacro NewScene("Test")

call echo("WAIT 1 seconds please")
//! runtextmacro Wait("1")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 2 seconds please")
//! runtextmacro Wait("2")

    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 1 seconds please")
//! runtextmacro Wait("1")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.5 seconds please")
//! runtextmacro Wait("0.5")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.1 seconds please")
//! runtextmacro Wait("0.1")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.1 seconds please")
//! runtextmacro Wait("0.1")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.1 seconds please")
//! runtextmacro Wait("0.1")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.05 seconds please")
//! runtextmacro Wait("0.05")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.05 seconds please")
//! runtextmacro Wait("0.05")

call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))
call echo("WAIT 0.05 seconds please")
//! runtextmacro Wait("0.05")
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ,0,0))

call echo("BOOM")


//! runtextmacro EndScene()
08-24-2007, 05:38 PM#6
NightBreeze
Hmm, I often use a global int for a struct to circumvent the variable problem. I guess I'm convinced though, it sounds useful. Have you tried using it in periodic timers? ^^ see what kind of mayhem it creates
08-24-2007, 08:33 PM#7
MaD[Lion]
i dont like timers because of the handle stuffs. This system is not timer based and never will be