Page 1 of 1

Why won't Grafs move forward?

Posted: Mon Dec 20, 2021 11:24 pm
by Animebryan
I'm starting to hate these npcs with formulaic movement patterns. I had a hard enough time trying to get Eeries to mimic Dragon Heads (Zelda 2) or Medusa Heads (Castlevania) sine wave pattern. But even if I copy & paste that formula

Code: Select all

3 * sin(t * 3);
or the default sine wave formula for Eeries

Code: Select all

cos(t * 4);
, it still won't move forward, like it's set on Don't Move or speed=0. The only way it'll move forward is during it's default Circle Graf pattern

Code: Select all

x=sin(t * 2) * 2; y=cos(t * 2) * 2;
.

I just want a proper sine wave pattern for them! Similar to

Code: Select all

3 * sin(t * 3);

Re: Why won't Grafs move forward?

Posted: Tue Dec 21, 2021 5:28 pm
by Hoeloe
Notice how the time it works you're actually assigning something? You need to assign to "x" - i.e., the horizontal position. Just writing some equations out doesn't tell it what you want it to do with that equation. You need to assign it.

Re: Why won't Grafs move forward?

Posted: Wed Dec 22, 2021 3:45 am
by Animebryan
Well to be honest, I never learned about graphing formulas so I actually don't understand it. The only reason I came across the Medusa Head sine wave was by googling it & even then it was a pain in the ass to find a lua formula that works with the editor. It was mostly sheer luck.

So I assume you mean that I need to put x= followed by the formula right? Will that be enough to generate the vertical part of the wave too or do I also need to put a y= as well?

Re: Why won't Grafs move forward?

Posted: Wed Dec 22, 2021 3:53 am
by Emral
Yes. You can look at the "Examples" section of the graf's extra settings window for more information on the syntax. There's an example for a circle included to help people get started.

Re: Why won't Grafs move forward?

Posted: Wed Dec 22, 2021 4:37 am
by Animebryan
That's not "More info". What part about
I never learned about graphing formulas so I actually don't understand it.
do you not understand? So far the only thing I learned is that I need to define x with x=, but I don't know if I need a y= as well.
I never needed to define x or y for the Medusa Head sine wave formula for Eeries & it worked perfectly, but when I tried to paste that same formula to Grafs, it doesn't work. It goes up & down but no horizontal movement. Eeries didn't have that problem which means how the formulas work between the two is different & inconsistant, hence the confusion.

When I look at the Graf's Circular Pattern formula, the only difference I see is that x is defined with sin & y with cos, both terms which are completely alien to me but the rest are symmetrical equations (t * 2) * 2, and they somehow form a circular pattern. I don't want a circular pattern, I want a perfect sine wave that's generated by 3 * sin(t * 3); when it's applied to Eeries, like this:

Image

Re: Why won't Grafs move forward?

Posted: Wed Dec 22, 2021 9:18 am
by MrDoubleA
Animebryan wrote:
Wed Dec 22, 2021 4:37 am
That's not "More info". What part about
I never learned about graphing formulas so I actually don't understand it.
do you not understand? So far the only thing I learned is that I need to define x with x=, but i don't know if I need a y= as well.
I never needed to define x or y for the Medusa Head sine wave formula for Eeries & it worked perfectly, but when I tried to paste that same formula to Grafs, it doesn't work. It goes up & down but no horizontal movement. Eeries didn't have that problem which means how the formulas work between the two is different & inconsistant, hence the confusion.

When I look at the Graf's Circular Pattern formula, the only difference I see is that x is defined with sin & y with cos, both terms which are completely alien to me but the rest are symmetrical equations (t * 2) * 2, and they somehow form a circular pattern. I don't want a circular pattern, I want a perfect sine wave that's generated by 3 * sin(t * 3); when it's applied to Eeries, like this:

Image
The reason why is that eeries are hardcoded to always move forward at a certain speed; grafs, however, will always stay to their spawn point, only being offset by the X position given in. To make them move left, you can use functions like:

Code: Select all

x = -t * 1.5; y = cos(t * 4);