dantedevil
Well-known member
After testing the game a lot, I found that on some occasions when there are many enemies together in a small space, our hero executes the fatality and continues with the corresponding animation, but the enemy does not.
So I decided that the best thing would be to create a script that checks if the enemy is at a specific distance and with a specific animation, if everything is true, the animation continues, if it is not true, it returns to IDLE.
I know my script is not right obviously.
But before asking for help, I made several attempts and it's the best I could come up with.
However, I couldn't get it formulated as I wanted, since my main idea was to include the animation check in the script header, but I couldn't achieve it.
My idea would be that the final result would be this:
@cmd fatAniCheck 0 80 4 "ANI_DIE23"
This way you can use the same script for all the different fatalities in the game.
So I decided that the best thing would be to create a script that checks if the enemy is at a specific distance and with a specific animation, if everything is true, the animation continues, if it is not true, it returns to IDLE.
I know my script is not right obviously.
But before asking for help, I made several attempts and it's the best I could come up with.
C++:
void fatAniCheck(int RxMin, int RxMax, int Rz)
{// Dantedevil
// Check if enemy start plays Fatality
// Rx = x distance to find type
// Rz = z distance to find type
void vself = getlocalvar("self");
float x = getentityproperty(vself, "x");
float z = getentityproperty(vself, "z");
int dir = getentityproperty(self, "direction");
void vEntity; //Target entity placeholder.
void vAniID;
int iEntity; //Entity enumeration holder.
int iType; //Entity name.
int iMax = openborvariant("ent_max"); //Entity count.
int TDir; float Tx; float Tz; float Disx; float Disz;
//Enumerate and loop through entity collection.
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity); //Get target entity from current loop.
iType = getentityproperty(vEntity, "type"); //Get target name
vAniID = getentityproperty(vEntity,"animationID");
if(iType == openborconstant("TYPE_ENEMY")){
if(vAniID == openborconstant("ANI_DIE23")){
Tx = getentityproperty(vEntity, "x");
Tz = getentityproperty(vEntity, "z");
TDir = getentityproperty(vEntity, "direction");
Disx = Tx - x;
Disz = Tz - z;
if( Disx >= RxMin && Disx <= RxMax && Disz <= Rz && dir == 1) // Target within range on right facing?
return;
} else if( Disx >= -RxMax && Disx <= -RxMin && Disz <= Rz && dir == 0) // Target within range on left facing?
setidle(self, openborconstant("ANI_IDLE"));
}
}
}
}
}
However, I couldn't get it formulated as I wanted, since my main idea was to include the animation check in the script header, but I couldn't achieve it.
My idea would be that the final result would be this:
@cmd fatAniCheck 0 80 4 "ANI_DIE23"
This way you can use the same script for all the different fatalities in the game.
Last edited: