Sinusoid Motion

Sinusoid Motion via Script

I though maybe is an error cos BloodBane used it in his Contra mod.

I never used trigonometry functions in Contra mod
I believe you were fooled by some projectile movement which moves in sinusoid-like motion :D.
 
Goliath said:
I was askinig if you know how to write the sin function, to implement it on the current BOR version i´m using, nothing more. :)

If you want to do a curve motion without sin/cos use bezier curve!
 
White Dragon said:
If you want to do a curve motion without sin/cos use bezier curve!

Can you give a code example of How to draw a Bezier curve given 3 points?
 
White Dragon said:
Some post above I done an example for cubic curve. You use quadric curve

Script compile error in 'updateentityscript': bezier_curve line 14, column 16

line 14 = x = bezier_curve(t,3,30,80,160,210);

Tryed to change the main fucction name and x name for beziercurve or bcurve, no luck.

Forgot to #include  ::)

Got annoying blink effect, it´s not a smooth movement:

http://youtu.be/xfaXTKXn9I0
 
I didn´t change the time from your test script, only speed and coords:

Code:
#include "data/scripts/beziercurve.h"

void main() {
    void self = getlocalvar("self");

    if (openborvariant("in_level") && getentityproperty(self,"animationid") != openborconstant("ANI_SPAWN")){
        if ( getlocalvar("bezier_time") <= 1 || getlocalvar("bezier_time") == NULL() ){
            float t = getlocalvar("bezier_time"),x,a;
            float b = getentityproperty(self, "base");
            float speed = 0.005;

            if (t == NULL()) setlocalvar("bezier_time",0);
            else setlocalvar("bezier_time",getlocalvar("bezier_time")+speed);
            t = getlocalvar("bezier_time"),

            x = bezier_curve(t,3,0,100,200,300);
            a = bezier_curve(t,3,b+0,b+144,b+144,b+0);
            changeentityproperty(self,"position",x,223,a);

            drawstring(10,100,0,"t: "+t);
            drawstring(10,110,0,"x: "+x);
            drawstring(10,120,0,"y: "+a);
        }
    }
}
 
Goliath said:
I didn´t change the time from your test script, only speed and coords:

Code:
#include "data/scripts/beziercurve.h"

void main() {
    void self = getlocalvar("self");

    if (openborvariant("in_level") && getentityproperty(self,"animationid") != openborconstant("ANI_SPAWN")){
        if ( getlocalvar("bezier_time") <= 1 || getlocalvar("bezier_time") == NULL() ){
            float t = getlocalvar("bezier_time"),x,a;
            float b = getentityproperty(self, "base");
            float speed = 0.005;

            if (t == NULL()) setlocalvar("bezier_time",0);
            else setlocalvar("bezier_time",getlocalvar("bezier_time")+speed);
            t = getlocalvar("bezier_time"),

            x = bezier_curve(t,3,0,100,200,300);
            a = bezier_curve(t,3,b+0,b+144,b+144,b+0);
            changeentityproperty(self,"position",x,223,a);

            drawstring(10,100,0,"t: "+t);
            drawstring(10,110,0,"x: "+x);
            drawstring(10,120,0,"y: "+a);
        }
    }
}

time in this case is float speed = 0.005; [0,1]
my script is setted to work smoothed in script/ondrawscript event
I hope you not tested into animationscript, in this case isnt so smooth!
 
I read all post in this thread, and I am not very clear what the script that I use.
Ilu script, or the script of White Dragon?

Can someone show me how use it. ?

Thanks.
 
dantedevil, instead of asking which script is best for you, why don't you post what you want to make?
We can give suggestion which script to use or even make script for that :)
 
You're right. If you remember in the gameplay Kitana of my mod, it takes a special where starts spinning faster and faster, until it launches two twister that move across the screen and then disappear.
I would like to use the script, so I can use only one twister that scroll across the screen.
As does the twister that throws Storm in the O Ilusionista video.
 
Ah, I watched that video too. In that video, Storm's twister enters the screen while moving in sinusoid motion then leaves from same side it came from

I can see why you wanted only one twister but since Kitana launches twister from her instead of summoning twister from offscreen, why don't you have 2 twisters? one moves left and the other moves right?

Another solution is to have twister which simply moves up and down in sinusoid manner, sweeping anything in its path before leaving screen
So which one would it be?
 
I think the second option is the best.
I want Kitana launch only one twister from her, wich simply moves up and down in sinusoid manner, sweeping anything in its path before leaving screen.
 
Back
Top Bottom