(Periodic Event - Every X seconds) How To Change X in Game?

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
How Accurate is a action (Wait 0.01 seconds)

How Accurate is a action (Wait 0.01 seconds)?

What is the most accurate method when i need my timer to be as close to .01 sec as possible.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Periodic Event - Every X seconds

is perfectly precise for the purposes of the game - the frame rate is ~.02 seconds, and it's far more accurate than that.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
How Do i set a variable For (Periodic Event - Every X seconds)
It will only take a const.
 

theDTD

Active Member
Reaction score
8
>hmmm, try:
>make a variable for x
>so it will be, "every (variable) seconds"
>then make another trigger that accepts an input in game (ex. chat)
>then convert entered string to (x variable type)
>set converted string = to x variable
 

Dirac

22710180
Reaction score
147
create other trigger....

Events
xxx
Conditions
xxx
Actions
Set REAL = 0.03
Trigger Add Event to (your trigger goes here) Every REAL time seconds
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
Thats the thing, (Periodic Event - Every (non variable) seconds)

But it does allow ...
Time - Elapsed game time is (Real((Custom value of Track 0 Degrees 0007 <gen>))) seconds

I think that will work. Ill just hide the amount of time i wanted the timer to go by in there.



*Edit

That does not work, I think when the game starts it figures out the custom value of Track 0 Degrees 007 at the start of the game, thus if i change it, it will do nothing.
So i think its a const.
 

GooS

Azrael
Reaction score
153
Hmpf, can't find it right now there has been made a study out of this, realting to periodic events, timers and waits with a result list on how far of they are.

Period, I don't remember

Timers, may be of by a couple of minutes in a day, saying 5 minutes results in:

86400 seconds per day, 5 minutes is 300 seconds
300/86400 = 0.00372222222222222
So timers might be of with 0.0037 seconds / second, or 3.7 milliseconds per second
(5 minutes can be of, but I've heard a couple of minutes from many places but never a real number)

And as said, wait is kinda random especially when used at such low values, if you want something to happen every 30 seconds, sure one second here and there doesn't make a diffrence, sliding a unit with waits and you might aswell use blink.

Put things that might affect both of these must be what is happening during and the resulted effect.

In anyway in all my timed triggers I use a timer or the periodic, as me thinks they might be based upon the same time.
How Do i set a variable For (Periodic Event - Every X seconds)
It will only take a const.
Not quite following you there, what's the for, for?

It is already an event in GUI, if you want it to start after a condition has been met, say 1minute of gametime.

Code:
E. Time elapsed = 60.00 seconds
A. Trigger - Add Event to (This Trigger) using (Periodic Event - Every 0.01 sec)
(Roughly)

or use a timer for callback in jass

JASS:
call TimerStart(whichTimer, 0.01, true, function callbackFunction)

(Is it even correct o_O ^)

Anyways, why would you want to do something so frequently, 0.03 makes no diffrence in appearance but alot of diffrence on a non-high performance computer.

//==GooS
 

vypur85

Hibernate
Reaction score
801
Timer is accurate.

Code:
Countdown timer - Start YourTimer as One-shot.... that will expire in 0.01 seconds
Code:
Event
 YourTimer expires
Condition
Action
 -Do your stuff-
Waits are not accurate with low values but are ok with higher values. I think 0.3 is still a fine value (from my experience). Below that will not be reliable.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
Hmm, Well how do i put a varible in there? It looks like it only takes const.

The time for my timer is not a const. any idea?
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
Countdown timer allows you to set it's period.
I see... I will mess with this....trying to understand it.




Well, it's better if you can describe what you're planning to do.
I Need my timer to go off after (X) Seconds to do (Some events).
I Need my timer to be able to turn off and on. (Thus use of turning a trigger on and off)
I Need to be able to change after the game starts, how long it should take for the timer to go off and do (Some events)


EDIT*

Ya That works with count down timer. And is that very accurate?
I Am only doing this because the wait command doesn't seem to be accurate.


Problem Solved. Thnx Everyone
 

Exfyre

hmm...
Reaction score
60
Easiest way is to create a timer (repeating) with X seconds. Then u will have a trigger like this:

Trigger:
  • Events
    • -(Your Timer) Expires
    • Conditions
    • Actions
      • -do actions here


Trigger:
  • Events
    • -Entered chat string blah
    • conditions
    • Actions
      • -set (your timer) to expire in (int(entered chat string)) seconds (or however you want this to change)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I reorganized the forums somewhat but I doubt anyone would notice
  • The Helper The Helper:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1
  • The Helper The Helper:
    and I am back :)
    +1
  • The Helper The Helper:
    Happy Tuesday!
    +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