• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Trigger] how to make a parabola?

Status
Not open for further replies.
Level 19
Joined
May 1, 2008
Messages
1,130
i have 2 points and i want a unit to be slideing (sliding trigger) from first poin to second point in a parabola (like a semicircle)
how can i do that?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here you go, this is what it does:

Circle_01.jpg


  • SemiCircle
    • Events
      • Player - Player 1 (Red) types a chat message containing c1 as An exact match
    • Conditions
    • Actions
      • -------- Unit to move --------
      • Set TempUnit = (Random unit from (Units currently selected by Player 1 (Red)))
      • -------- Starting point --------
      • Set TempLoc1 = (Center of Rect 012 <gen>)
      • -------- Ending point --------
      • Set TempLoc2 = (Center of Rect 013 <gen>)
      • -------- Angle from start to end --------
      • Set TempAngle = (Angle from TempLoc1 to TempLoc2)
      • -------- Radius of the semi-circle --------
      • Set TempReal = (Distance between TempLoc1 and TempLoc2)
      • -------- Halfway point between start and end --------
      • Set TempLoc3 = (TempLoc1 offset by (TempReal / 2.00) towards TempAngle degrees)
      • Trigger - Turn on MoveCircle <gen>
  • MoveCircle
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempReal2 Greater than or equal to 90.00
        • Then - Actions
          • -------- End point reached, turn off and reset values --------
          • Trigger - Turn off (This trigger)
          • Set TempAngle2 = 0.00
          • Set TempReal2 = 0.00
        • Else - Actions
          • Set TempReal2 = (TempReal2 + 1.00)
          • -------- Circle from left side --------
          • Set TempAngle2 = ((TempAngle - 180.00) - (180.00 x (Sin(TempReal2))))
          • -------- Circle from right side --------
          • Set TempAngle2 = ((TempAngle - 180.00) + (180.00 x (Sin(TempReal2))))
          • Unit - Move TempUnit instantly to (TempLoc3 offset by (TempReal / 2.00) towards TempAngle2 degrees)
I was lazy and didn't fix the leaks.

"TempReal2 Greater than or equal to 90.00" is used because sin 90° is 1, and you've done a full semi-circle.

It takes (90/TempReal2Increment)/(1/UpdateTime) seconds to do the semi-circle.

In this example it is (90/1)/(1/0.03) = 2,7 seconds.
 
Status
Not open for further replies.
Top