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.

      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