void conditionalflip()
{
void self = getlocalvar("self");
int p = getentityproperty(self, "playerindex");
int SDir = getentityproperty(self, "direction");
int MDir;
if(Face==0){ // Same facing?
MDir = SDir;
}
if(Face==1){ // Opposite facing?
if(SDir==0){ // Facing left?
MDir = 1;
} else { MDir = 0;}
}
if(Face==1) {
changeentityproperty(self, "direction", !SDir);
}
}
flipframe
flipframe {frame}
Used to make character turn around when frame+1 is played.
Management is not responsible for any damage caused of using this command in improper animation such as WALK.
magggas said:msmalik681, i known about "flipframe" command, this is not the case man.
Like i said above, i want that the player flips only if the move is performed behind the enemy.
That is why i need a script to check the enemies direction first and then flip if is needed.
i want that the player flips only if the move is performed behind the enemy.
void conditionalflip()
{ // Flipping based on currently grabbed enemy
void self = getlocalvar("self");
void target = getentityproperty(self, "opponent");
if(target)
{
int Direction = getentityproperty(self, "direction");
int TDir = getentityproperty(target, "direction");
if(TDir == 0 && Direction == 0){
changeentityproperty(self, "direction", 1);
} else if(TDir == 1 && Direction == 1){
changeentityproperty(self, "direction", 0);
}
}
}