Is there a way to use more precise waits?

crabbb622

New Member
Reaction score
9
Wait 0.00 seconds is pretty long and i was wondering if there was a way to wait for a less amount of time. Thanks.
 

_whelp

New Member
Reaction score
54
There would be no use to 0.00 interval waits. If you want time to be accurate, you would use a timer.
 

_whelp

New Member
Reaction score
54
Wow, I didn't really read the post, but using negatives won't work correctly, because you can't reverse time, as I know of.
 

ChaosWarlock

New Member
Reaction score
7
I think he is trying to say waits with more decimal places. 0.0000 <-- like this but substituting any integer for the zeros.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Actually, the problem he's referring to is that a GUI wait, which translates to TriggerSleepAction() in JASS, seems to wait a minimum of 0.27 seconds even if you put a lower value in, IIRC. The way to fix this is indeed to use timers, as _whelp said in their first post.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
JASS:
call TimerStart(CreateTimer(), 0.001, false, function YourFunc)


But there's not much of a point in using anything under 0.01, really... 0.01 sounds like it's too much because people are used to Waits that take forever because they're inaccurate, but the real 0.01 is very short.
 

crabbb622

New Member
Reaction score
9
Actually, the problem he's referring to is that a GUI wait, which translates to TriggerSleepAction() in JASS, seems to wait a minimum of 0.27 seconds even if you put a lower value in, IIRC. The way to fix this is indeed to use timers, as _whelp said in their first post.

That guy has the right idea. But then timers would not be MUI, right?
 

crabbb622

New Member
Reaction score
9
whoops, sorry. here i'll post the code.
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fire
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by ((Real((Integer A))) x 75.00) towards (Facing of (Triggering unit)) degrees) facing (Facing of (Triggering unit)) degrees
          • Set UnitGroup = (Units within 75.00 of (Position of (Last created unit)) matching (((Matching unit) Not equal to (Triggering unit)) and (((Unit-type of (Matching unit)) Not equal to Footman) and (((Matching unit) is dead) Not equal to True))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UnitGroup is empty) Not equal to True
            • Then - Actions
              • Unit - Explode (Last created unit)
              • Unit Group - Pick every unit in UnitGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50.00 damage of attack type Normal and damage type Normal
              • Skip remaining actions
            • Else - Actions
              • Wait 0.00 seconds


the wait would be MUI because i don't reference any variables. but timers are variables so it would destroy that concept

Edit: and i would remove each unit when the next unit was spawned
 

crabbb622

New Member
Reaction score
9
The wait in your if-then-else is unneeded, as it really doesn't do anything.
If there was a unit near, then explode and skip remaining actions, else, pause momentarily and then repeat with Integer A incremented

If you are referring to the 0.00 seconds, people already said that GUI waits have a minumum of .27 seconds. The problem is that i need it to pause shorter and timers would kill my MUI. Any suggestions?
 

crabbb622

New Member
Reaction score
9
>.< You people are useless.

Just kidding, this forum helped me a lot in the past (sometimes), but i guess there are some things you can't do.
 

Azlier

Old World Ghost
Reaction score
461
It's just that timers are so incredibly hard to use in GUI.
 

Sajberhippie

New Member
Reaction score
30
whoops, sorry. here i'll post the code.
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fire
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by ((Real((Integer A))) x 75.00) towards (Facing of (Triggering unit)) degrees) facing (Facing of (Triggering unit)) degrees
          • Set UnitGroup = (Units within 75.00 of (Position of (Last created unit)) matching (((Matching unit) Not equal to (Triggering unit)) and (((Unit-type of (Matching unit)) Not equal to Footman) and (((Matching unit) is dead) Not equal to True))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UnitGroup is empty) Not equal to True
            • Then - Actions
              • Unit - Explode (Last created unit)
              • Unit Group - Pick every unit in UnitGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50.00 damage of attack type Normal and damage type Normal
              • Skip remaining actions
            • Else - Actions
              • Wait 0.00 seconds


the wait would be MUI because i don't reference any variables. but timers are variables so it would destroy that concept

Edit: and i would remove each unit when the next unit was spawned

First off, you DO use a variable, UnitGroup. Also, that trigger leaks points for which you need a variable.
 

Emu.Man00

New Member
Reaction score
41
If you're waiting less than 0.01 seconds nobody will notice the wait at all... am I missing a coding reason this needs to be here?
 

crabbb622

New Member
Reaction score
9
First off, you DO use a variable, UnitGroup. Also, that trigger leaks points for which you need a variable.

Oh, I'm not familiar with that leak, i'll clean it up later; thanks. I didn't notice the variable, but it's legitamate because I set it and and then use it before the wait.

And the wait would be longer than .01 seconds--allegedly, the minimum wait is .27 seconds...i might need it to be half as long or something
 

Sajberhippie

New Member
Reaction score
30
Oh, I'm not familiar with that leak, i'll clean it up later; thanks. I didn't notice the variable, but it's legitamate because I set it and and then use it before the wait.

And the wait would be longer than .01 seconds--allegedly, the minimum wait is .27 seconds...i might need it to be half as long or something

Actually, both the unit group and the wait is inside the first loop (1 to 15).

May I ask why you want to have such a small wait? Why wait at all, I mean... It's not like it's gonna make any large difference. How many FPS does wc3 do? 60? That's about 0.016 as the minimal noticable wait... And the practical minimum wait in GUI is less than double that.
I may be missing something important, but I can't really see why you can't do it at the same time. What is the trigger supposed to do?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top