Warcraft III resources & community, 2003–2006 · archived

Curious about emulating a sine curve

8 posts
#1

Curious about emulating a sine curve

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:
http://www.geocities.com/invalidsyntax17/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.
#2
You might want to post this in the Map Dev Forum. The people there are better at math. I, for one, have no idea how to use half of the math functions in the WE.

~The_Raven
#3
Hehe... I find msot math functions really difficult. But I will start trigonometry this year... And for now, I have incredible problems with vectorial geometry. I had a test and i knew almost nothing... I'm gonna take a D.
#4
Taking geometry in 8th grade, gonna take Alg. 3-4 during the summer, then catch closer to Daelin's level of math :wink:

As for this, have you tried using some functions, the WEU's special effects wave, and maybe the "Damage Area" function?
#5
No... that's not the solution. He's trying to obtain a shape from points. Like... you take each point of a shape and you have to know where to make it. It's a formula obviously, but I have no idea which.
#6
quite interesting idea. i will try to find the needed formula.
#7
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 =)
#8
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)