Solved Slowing down in x axis a char's air attack with didhit.c

Question that is answered or resolved.

16-bit Fighter

Active member
I customed a didhit script from SOR2X (Adam's one) for a char to be horizontally slowed down when hitting a char during his run attack that is an air attack. The attack's curve works fine in x axis. But the problem is I don't know what to do for the third parameter (I don't know its name and I don't find it in the manual) to make the char keep on unaffectedly his move in y axis. For now I wrote down 1.5 but it's not perfect since sometimes the char seems to jump a little when hitting an an enemy or obstacle.
I just put the didhit script below, I don't think the run attack move has to be shown (tell me if it has).

void main()
{ void self = getlocalvar("self");
void vAniID = getentityproperty(self,"animationID");
float xVel = getentityproperty(self,"xdir");

if(vAniID == openborconstant("ANI_RUNATTACK")){
changeentityproperty(self, "velocity", xVel/1.6, 0, 1.5);
}
}

Thanks in advance for any help and sorry if the thread must be in "Ask and Answer".
 
Last edited:
This third parameter is usually called the "a" (altitude) in the legacy manual, in practice this is the velocity in the "y" axis.
Here's the description of the manual:

"velocity" - It accepts 3 params. NULL() is valid. Follow by speed in x, z, a direction, entity will move in this speed each A.I. loop.
These values can be modified by A.I. functions, so it is almost useless until it is a non-AI controlled character,e.g., type none.
 
Back
Top Bottom