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

Circular-styled orbit formula. Lil' help?

Status
Not open for further replies.
Level 11
Joined
May 13, 2010
Messages
167
[GUI guys!]. So, i want to create some sort of formula that checks for the current position of X, wich will constantly circulate around Y, creating some sort of "bubble" with every loop. I am not sure if i explained it right, so here comes a fraking awesome artwork:

Pink dots represent the X variable points while the little cute black one in the centre represents the Y location. The draw's view is from above the Y point, BTW.

attachment.php


attachment.php


attachment.php


attachment.php


attachment.php



(Don't pay that much attention to the timer, ingame will be properly synchronized)

Besides, the X dots will be dummy units with a SFX attached to their chest, so with every new loop (that will make them circulate around the Y point) they will get a new flying height to give the look that the SFXs creates some sort of circle that closes around the Y location. Did i explain myself? While the X dots are smaller in the incredibly awesome picture, they will have a higher flying height around the Y point as well.

Any help? I am pretty sure this is NOT that difficult to achieve.
 

Attachments

  • 1.png
    1.png
    5.6 KB · Views: 190
  • 2.png
    2.png
    4 KB · Views: 142
  • 3.png
    3.png
    4.7 KB · Views: 200
  • 4.png
    4.png
    4.4 KB · Views: 193
  • 5.png
    5.png
    4.1 KB · Views: 142
I dunno that my spells were that much popular ^^

Except this, let's say you have a variable for the flying height of the pink points (on your schemas), let's name it H.

Basically H has some values you've defined in an initialisation trigger or in the cast trigger (or other).

Let's say that every 0.03 seconds we decreases the value from H for this, we make : H = H - x (x is a number)

And like this the height will decreases.

Now, in our present case, your variable is the Current Flying Height of your unit and so, you just need to Set the flying height of the unit to the Current Flying Height - x (some number)
And this should be periodic ^^


For the circle movement, there are multiple ways, in Demon Spinning (linked upper), i stored the actual angle of my unit and i changed this angle (by doing + X) periodically. It was kinda like what i've done for the height.
You can also use Cos and Sin with Coordonnates to simulate the circle from a Point (the Center) with a Distance (the Radius) and some value to have the turning speed.
  • Set Point = (CIRCLE CENTER)
  • Set Point3 = (Position of MyUnit)
  • Set Point2 = (Point offset by ((300.00 x (Cos((1.50 + (Angle from Point3 to Point))))), (300.00 x (Sin((1.50 + (Angle from Point3 to Point)))))))
  • Unit - Move MyUnit instantly to Point2
  • Custom script: call RemoveLocation( udg_Point )
  • Custom script: call RemoveLocation( udg_Point2 )
  • Custom script: call RemoveLocation( udg_Point3 )
In that example, the Radius was 300 and the turning speed was 1.50.
 
Status
Not open for further replies.
Top