Solved Freespecial that leads to a (functional) jump?

Question that is answered or resolved.
Greetings, fellow developers!

I've made a special move for one of my characters that is a super jump, following below:
Code:
anim	freespecial6		#Super Jump
	loop		1 4 7
	dropframe	7
	offset	48 63


	delay	5
	frame	data/chars/tails/jumpland_00.png
	frame	data/chars/tails/jumpland_01.png

	bbox	37 32 22 32
	frame	data/chars/tails/superjump_00.png
	delay	1
	@cmd	dash	0 6
	@cmd	keymove 1
	frame	data/chars/tails/superjump_01.png

	delay	3
	frame	data/chars/tails/superjump_02.png
	frame	data/chars/tails/superjump_03.png
	frame	data/chars/tails/superjump_01.png

	frame	data/chars/tails/superjump_04.png
	@cmd	animframe	"ANI_JUMP"
	frame	data/chars/tails/superjump_04.png

Here are the animation scripts that I'm calling:
Code:
void dash( float Vx, float Vy, float Vz )
{
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0)
    {
      Vx = -Vx ;
    }
	changeentityproperty(self, "velocity", Vx, Vz, Vy);
}

Code:
void animframe (void Ani, int Frame)
{
    void self = getlocalvar("self");
    	performattack		(self, openborconstant(Ani),1);
    	changeentityproperty(self, "animpos", Frame);
}

Code:
void keymove(float V, int flip)
{// Move hero if direction button is pressed
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
	float xdir = 0;
	float zdir = 0;

    if (playerkeys(iPIndex, 0, "moveleft"))			// Left is pressed?
    	{
    		xdir = -V;
    		if (flip != NULL()) {changeentityproperty(self, "direction", 0);}
    	}
    if (playerkeys(iPIndex, 0, "moveright"))		// Right is pressed?
    	{
    		xdir = V;
    		if (flip != NULL()) {changeentityproperty(self, "direction", 1);}
    	}
    if (playerkeys(iPIndex, 0, "moveup"))		{zdir = (-V*0.5);}	// Up is pressed?
	if (playerkeys(iPIndex, 0, "movedown"))		{zdir = ( V*0.5);} 	// Down is pressed?

	changeentityproperty(self, "velocity", xdir, zdir, NULL());
}

I'd like to lead the character to a funcional jump, where it's capable to jumpattack and such. Should I change any aiflags? should I substitute "performattack" by "executeanimation" on the animframe animatioscript?
 
If animframe was designed for multipurpose, you should add flag parameter to run different functions if you want player to be in jump state after changing animation.

BTW to enter jump state, you can set these:
Code:
        changeentityproperty(vSelf, "aiflag", "attacking", 0); // Disable attacking status
        changeentityproperty(vSelf, "aiflag", "jumping", 1); // Enable jumping status
        changeentityproperty(vSelf, "takeaction", "common_jump");

It's missing vSelf, but I'm sure you know how to acquire that :).
 
Ohhh, works perfectly, Bloodbane , thanks a lot!

Is there any place that explains each AIflag? And I don't know this "takeaction" function, where could I know more about it?
 
Back
Top Bottom