• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Distance Equation >,<

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
Alright i have a spell that throws a missile art at 700 speed with a .5 arc. I also have this trigger:

  • Grenade Toss
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grenade Toss
    • Actions
      • Wait 0.18 seconds
      • Set L = (Target point of ability being cast)
      • Special Effect - Create a special effect at L using Abilities\Spells\Human\FlameStrike\FlameStrike.mdl
      • Wait 3.25 seconds
      • Special Effect - Destroy (Last created special effect)
What should the equation for the first wait be so the effect always is created at the same time in comparison to when the missile art hits the ground?
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
Meh, its a bit sketchy and usually inaccurate, but its Distance/Speed. Distance would be a variable real, speed would be a constant.
Speed = Projectile speed for your ability
Distance = (Distance between (Triggering Unit) and (Target point of ability being cast)
Note the distance leaks twice, patch those up.
I'm not sure if speed is effected by arc.
Oh yes, and use timers instead of waits
--donut3.5--
 
Level 10
Joined
Jan 21, 2007
Messages
576
Well i just implented these changes:

  • Grenade Toss
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grenade Toss
    • Actions
      • Set L_Array[1] = (Position of (Casting unit))
      • Set L_Array[2] = (Target point of ability being cast)
      • Wait ((Distance between L_Array[1] and L_Array[2]) / 4200.00) seconds
      • Set L = (Target point of ability being cast)
      • Special Effect - Create a special effect at L using Abilities\Spells\Human\FlameStrike\FlameStrike.mdl
      • Wait 3.25 seconds
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_L)
      • Custom script: call RemoveLocation(udg_L_Array[1])
      • Custom script: call RemoveLocation(udg_L_Array[2])
And it creates the exsplosion every time as soon as the projectile hits the ground... so, whats inacurate about waits o_O?

EDIT: Btw is that how you remove Points w/ arrays? I just geussed.
EDIT2: Btw with the current eqaution im using if you cast the spell from 850 units away it will wait 0.18(0851064) seconds, from 450 units away 0.09(57446809) seconds.
 
Level 10
Joined
Jan 21, 2007
Messages
576
Alright, i'l take you word on it ;). How would i go about making this with timers?
 
Status
Not open for further replies.
Top