danno O_Ilusionista
I'm glad that the inversion had good results! After a few more tests, I updated the "antiWallG" function and now I mixed 3 functions into 1: antiwall+depost+tossentity
I mixed all them because the safest way to change the character's position during a grab is before the opponent is released (unbinded). Once a wall does not affect binded entities, so I can fix your position first before unbind and toss him.
This way I don't need to add the "z+1" anymore, plus it will reduce a lot of the "@cmd depost" lines in the character files.
And in the example below I'm showing where add the function inside the throw/slam functions:
I'm glad that the inversion had good results! After a few more tests, I updated the "antiWallG" function and now I mixed 3 functions into 1: antiwall+depost+tossentity
I mixed all them because the safest way to change the character's position during a grab is before the opponent is released (unbinded). Once a wall does not affect binded entities, so I can fix your position first before unbind and toss him.
This way I don't need to add the "z+1" anymore, plus it will reduce a lot of the "@cmd depost" lines in the character files.
Code:
void finishGrab(int Vx, int Vy, int Vz)
{//This new function was created by mixing the "antiwall", "depost" and "tossentity" into a unique function
void self = getlocalvar("self");
void target = getentityvar(self, "grabbed");
int x = getentityproperty(self, "x");
int Tx = getentityproperty(target, "x");
int z = getentityproperty(self, "z");
int Tz = getentityproperty(target, "z");
float wall = checkwall(Tx, Tz);
if(target != NULL()){
if(wall){ //WAS DETECTED ANY WALL IN THE TARGET'S POSITION?? RUN ALL TASKS BELOW!!
changeentityproperty(target, "position", x, z); //FIX THE GRABBED ENTITY'S POSITION ACCORDING TO GRABBER CORRDINATES BEFORE THE OPPONENT IS RELEASED
bindentity(target, NULL()); //RELEASE GRABBED ENTITY, NOW THE OLD FUNCTION "DEPOST" WORKS HERE
tossentity(target, Vy); //TOSS OPPONENT WITH Y VELOCITY ONLY, THIS WAY THE RELEASED OPPONENT WILL NOT BE MOVED AGAINST A WALL AGAIN
}
else //NO WALLS DETECTED?? ONLY THE DEFAULT TASKS WILL RUN
{
bindentity(target, NULL()); //RELEASE GRABBED ENTITY, NOW THE OLD FUNCTION "DEPOST" WORKS HERE
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT WITH NORMAL VELOCITY, X, Y AND Z
}
}
}
And in the example below I'm showing where add the function inside the throw/slam functions:
Code:
damageentity(target, self, 0, 1, atkType);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, TOTAL DAMAGE
finishGrab(Vx, Vy, Vz); //EXECUTE ALL NECESSARY TASKS TO END THE GRAB MOVE (ANTIWALL, UNBIND AND TOSSENTITY)
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR