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

Curious about emulating a sine curve

Status
Not open for further replies.
Level 2
Joined
Jan 23, 2004
Messages
26
I was wondering if anyone could perhaps assist me in creating a sine curve with domain limits, with the world editor's trigger editor.
The main idea behind this is for a spell (for name's sake) called "Crushing Wave"
i would start it off like so:

Event - Every 1 Second
Conditions - CrushingWave (a boolean variable) is true.
(the variable turns true when the spell is starting to channel, with other neglible conditions)
my problem is creating the actions that would allow me to cast a dummy "Channel" ability (point targeting spell that can target the ground) along the sine curve, within the (X Axis) degree range of -180 to +180 (or -pi to +pi radians) and the Y Range of about 300 Warcraft Units.
Overall, it should come out looking relatively close to this:
sincurve.JPG


where (0,0) is the origin, and the "Channel" ability is casted every 10 Degrees on the X axis from -180 degrees to +180 degrees (around 36 instances of the spell cast, then I believe.)

Any help would be absolutely appreciated =) and thank you so much! If anything is unclear, please do say so and I'll do my best to clear it up.
 
Level 2
Joined
Jan 23, 2004
Messages
26
thanks a bunch guys lol im still trying to figure out it for myself (getting the proper formula and whatnot)

if i must, as a last resort, i could probably manually place locations as points "relatively" around where the curve would be, but that'd be sorta annoying.
thanks a bunch once again for your trying =)
 
Level 2
Joined
Aug 26, 2004
Messages
29
If you're dealing with Reals (as opposed to Integers), there's an entry in the Function pulldown menu marked Math - Sine. You can use that to calculate the Y axis points. World points can be created using the Conversion - Coordinates to Point stuff.

Sine gives you values from 0 to 1, taking an angle. If it takes a Radian, which I don't think it does, just use the Math - Degrees to Radians thing.

In general, you just want something this:

HalfPoint = Real(NumImpacts) / 2.0

For Integer A = 0 to (NumImpacts - 1)
_ TempFrac = (Real(Integer A) / HalfPoint) - 1.0
_ XOffset = TempFrac x 300
_ YOffset = Sine(TempFrac x 180) x 300
_ ResultPoint = Point with Offset(POSITION POINT, XOffset, YOffset)
 
Status
Not open for further replies.
Top