Making a Wait Without Waits...

Komaqtion

You can change this now in User CP.
Reaction score
469
Why timers are better? Look at PolledWait function:

JASS:
function PolledWait takes real duration returns nothing
    local timer t
    local real  timeRemaining

    if (duration > 0) then
        set t = CreateTimer()
        call TimerStart(t, duration, false, null)
        loop
            set timeRemaining = TimerGetRemaining(t)
            exitwhen timeRemaining <= 0

            // If we have a bit of time left, skip past 10% of the remaining
            // duration instead of checking every interval, to minimize the
            // polling on long waits.
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
        call DestroyTimer(t)
    endif
endfunction


PolledWait uses Timers.

If you can read the green comments you'll see that it's not that good with lower periods either, as they skip intervals, and they still use TSA, so it still won't be very accurate... It's not that you use timers that's the only good thing, it's how you use it too, you know :p
 

tooltiperror

Super Moderator
Reaction score
231
TSA is too inaccurate to use correctly, and too controlled to make random times :(

Timers are just all around better tbh. Working with them is easy once you get the hang of it.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
umh?.... TSA does NOT keep counting when you pause the game?
atleast didn't for meright now when i tested...

My guess is that your test is bad. We're talking about timers in multi-player, not timers in single-player. In single-player, it literally pauses the game when you alt-tab out and use the pause function. Multi-player is a bit different.

- Jesus4Lyf
"In terms of the dilemma of do you use a triggercondition and timers, or do you use a triggeraction and sleeps, I'd say what you're doing is fine. Purists might disagree. No one knows what's more efficient - TSA or timers. It shouldn't matter anyway. "

what i could read there is no 100% answear why timers is better

Timers are better when you need extreme precision, and extremely short periods (such as 0.15s or lower). Waits are useful when you don't care about precision.

TSA is too inaccurate to use correctly, and too controlled to make random times :(

You can make random times with the Random functions. Just don't expect TSA to be random the way you want it to. It will be random enough.

Timers are just all around better tbh. Working with them is easy once you get the hang of it.

True, but beginners will find them confusing, and people who don't work in structs will find it tedious. Once you're working in structs, they're wonderful though.

[ljass]PolledWait[/ljass] leaks, and is very rarely needed. Usually, if you care about accuracy you use timers directly. If you don't, a wait will suffice.

When you become very good with vJass, you will find yourself using fewer and fewer waits, simply because you need precision. Some people get the idea that all waits are bad (which is false), and avoid every wait (even [ljass]call TriggerSleepAction(0)[/ljass] when you simply need to update an item position after the item drops from a unit, or something similar).

Generally you will find all of your functions are run immediately, on events or timer expire events, simply because that's the common way for games to work.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
and still isn't worth it imo since then you would need to make another trigger... :p

well you could say the same thing about jass, if you have learned it, its easier than gui...

edit: wow you wrote alot :p
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
and still isn't worth it imo since then you would need to make another trigger... :p

well you could say the same thing about jass, if you have learned it, its easier than gui...

If you're making a spell in GUI, you're going to need another trigger, as it will be noticably laggy-looking if you simply use waits. I was talking purely about JASS though, not GUI.
 

Chaos_Knight

New Member
Reaction score
39
This is what i wanted, a Wait that is MUI, But isnt
Trigger:
  • Wait "whatever" seconds

Is this possible?
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
you could use locals too.. that is imo easier to get a grip on.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
well thats true but 3-4 custom scripts isn't that much ether
 

Skippy

Active Member
Reaction score
39
You can't use locals in GUI functions. So if you use locals, you have to convert every GUI function that uses local variable to jass. That would be much more than 3-4 scripts.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
noo?... it will not?
Code:
Lazer
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Laza
    Actions
        Custom script:   local unit t = GetSpellTargetUnit()
        Game - Display to (All players) the text: IM A FIRE MY LAZA!
        Wait 3.00 seconds
        Custom script:   set udg_Temp_unit = u
        Unit - Cause (Triggering unit) to damage Temp_unit, dealing 500.00 damage of attack type Spells and damage type Normal

2 scripts for each thing that must be transported over...
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Oh, GOD JESUS !
If you're wondering about what's faster/better in terms of alternatives in GUI to make spells MUI, JUST LEARN JASS !!!!

It's isn't that hard !

And if you should use locals, it's simply easier to just code the whole thing in JASS as otherwise you'll just have to set the locals to globals and stuff just to make it work in GUI...2

There are plenty of good JASS tutorials out there, just pick one or pick the good stuff out of each :p

But I think we've gone a bit off topic here though XD
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
well think the last 15psot have been offtopic :p

btw is there any "tool" for wc3 that allowes c# or c++ coding?
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
daim^^ could have sold my soul to the devil for one =)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yes there is ?!

Reinventing the Craft, which has just been "relaunched" allows for programming in WC3 :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top