• 🏆 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!

[Trigger] Parabola Formula

Status
Not open for further replies.
Level 6
Joined
Jul 24, 2008
Messages
180
Okay, I have this formula... (((-1/d*d)x*x)*d+d)

Where...
d=1/2 the distance between start and end points
x=horizontal cooridinate of moving object

I'm trying to implement this with X and Z values, where Z is height. It works, except the height never changes. I'll paste the code below and attach the map, as I'm not sure if my classifications in the object editor are correct.


  • Freeze Throw Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freeze Toss
    • Actions
      • Unit Group - Add (Triggering unit) to FreezeThrowing
      • Hashtable - Save Handle Of(Triggering unit) as 5 of (Key (Triggering unit)) in FreezeThrowtable
      • Set Temploc = (Target point of ability being cast)
      • Hashtable - Save Handle OfTemploc as 0 of (Key (Triggering unit)) in FreezeThrowtable
      • Hashtable - Save (Distance between (Position of Caster) and Temploc) as 1 of (Key (Triggering unit)) in FreezeThrowtable
      • Set Distance = ((Load 1 of (Key (Triggering unit)) from FreezeThrowtable) / 2.00)
      • Hashtable - Save (-1.00 x Distance) as 3 of (Key (Triggering unit)) in FreezeThrowtable
      • Hashtable - Save 0.00 as 4 of (Key (Triggering unit)) in FreezeThrowtable
      • Custom script: call RemoveLocation(udg_Temploc)
      • Set Temploc = ((Position of (Triggering unit)) offset by ((Load 1 of (Key (Triggering unit)) from FreezeThrowtable) / 10.00) towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees)
      • Unit - Create 1 Freeze Throw Dummy for (Owner of (Triggering unit)) at Temploc facing (Target point of ability being cast)
      • Unit - Set (Last created unit) movement speed to Distance
      • Custom script: call RemoveLocation(udg_Temploc)
      • Set Temploc = (Target point of ability being cast)
      • Unit - Order (Last created unit) to Move To Temploc
      • Custom script: call RemoveLocation(udg_Temploc)
      • Hashtable - Save Handle Of(Last created unit) as 2 of (Key (Triggering unit)) in FreezeThrowtable

  • Freeze Throw
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FreezeThrowing and do (Actions)
        • Loop - Actions
          • Hashtable - Save ((Load 4 of (Key (Picked unit)) from FreezeThrowtable) + 0.01) as 4 of (Key (Picked unit)) in FreezeThrowtable
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 4 of (Key (Picked unit)) from FreezeThrowtable) Greater than or equal to 2.00
            • Then - Actions
              • Set Temploc = (Position of (Load 2 of (Key (Picked unit)) in FreezeThrowtable))
              • Special Effect - Create a special effect at Temploc using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
              • Unit - Cause (Load 5 of (Key (Picked unit)) in FreezeThrowtable) to damage circular area after 0.00 seconds of radius 200.00 at Temploc, dealing 100.00 damage of attack type Spells and damage type Cold
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_Temploc)
              • Unit Group - Remove (Load 5 of (Key (Picked unit)) in FreezeThrowtable) from FreezeThrowing
              • Unit - Remove (Load 2 of (Key (Picked unit)) in FreezeThrowtable) from the game
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in FreezeThrowtable
            • Else - Actions
              • Game - Display to (Player group((Player((Player number of (Owner of (Load 5 of (Key (Picked unit)) in FreezeThrowtable))))))) the text: Works!
              • Set Temploc = (Position of (Load 2 of (Key (Picked unit)) in FreezeThrowtable))
              • Hashtable - Save ((Load 3 of (Key (Picked unit)) from FreezeThrowtable) + ((Current movement speed of (Load 2 of (Key (Picked unit)) in FreezeThrowtable)) / 100.00)) as 3 of (Key (Picked unit)) in FreezeThrowtable
              • Animation - Change (Load 2 of (Key (Picked unit)) in FreezeThrowtable) flying height to ((((-1.00 / (Distance x Distance)) x Distance) x ((Load 3 of (Key (Picked unit)) from FreezeThrowtable) x (Load 3 of (Key (Picked unit)) from FreezeThrowtable))) + Distance) at 0.01
              • Custom script: call RemoveLocation(udg_Temploc)

#0=target point
#1=total distance
#2=missile dummy
#3=x-value
#4=elapsed time
#5=caster
Distance=1/2(#1)
 
Level 9
Joined
May 28, 2007
Messages
365
Ugly GUI is ugly.

Does your unit have 'Amrf', the Crow Form ability?

If so, I think one of your hashtables is returning 0, so that's why it never changes (its doing 0 multipied by something in there).

((((-1.00 / (Distance x Distance)) x Distance) x ((Load 3 of (Key (Picked unit)) from FreezeThrowtable)

You should display the height first, this might be 0.
 
This is the parabola main script:
[[(4*maxheight)/distance)]*(distance-parabolacounter)*(parabolacounter/distance)]

Maxheight is the maximum height your effect/unit you want it to fly up to.
Distance is the distance between the initial point and the arrival point.
Parabolacounter is an increasing real or integer in the periodic trigger, which increases by a specified value.
 
Status
Not open for further replies.
Top