• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

converting distances to time

Status
Not open for further replies.
You just can't convert distance in time without a speed factor.

For instance, for the grenade spell I use, let's say X is the caster and Y the target. The formula I use is (Distance between X and Y) / (Speed of the missile)

Since W3 uses the same unit for distance and speed, if I try to cast a grenade at 2000 range with 650 missile speed, it will take 2000/650 = roughly 3 seconds for the grenade to hit the target point. And so far it works =)
 
Using the words that kazenokage used, it can mean many things.
I will answer on a perspective that the others hasn't answered yet:
"I want to get the distance between two points, then use that distance value as a time in a timer."

There are functions for this already in world editor if you use GUI. You can get the distance in real value between two points; store that into a variable.
then use that same variable in a timer.

I don't know if this is what he means, though.
 
i mean .... example --- i want a reinforcement in position A , and position B is ready the reinforcements ,, like in call of duty .. like "eta 30 seconds or whatever"
 
update:figured it out ty to chaosium and all of you! well ice its like calling for troop reinforcement and i want to calculate the time it needs for the reinforcement to arrive to my position... anyways +rep to all
 
If you need to know how much time unit need to get from one location to second you need:

- Get distance between that two locations
- Calculate it by:

distance / speed * interval

so let's say distancec between locations is 700, speed is 20 and our loop interval is 0.031250

700 / 20 = 35 * 0.031250 = 1.09 - this is our time.

You can also calculate speed that you need to make unit get from location to second.

Distance * interval / time

so let's say distancec between locations is 700, our loop interval is 0.031250, and we want that unit will get to second location in 1.09 sec

700 * 0.03150 / 1.09 = 20 - this is our speed
 
Status
Not open for further replies.
Back
Top