Solved Script: conditionalflip help

Question that is answered or resolved.
I can see the error: you declared sdir but you use SDir instead
Here's the fixed one:

Code:
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);
   }
}

though as malik posted, I don't have idea what this function is for
 
Magggas, it may sound usual, but is there some particular info in the log file?

Also : glad to see you're working on some new project
 
this is a common feature

Code:
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.

usage :
anim follow25
loop    0
delay  1
offset  54 106
bbox    0 0 0 0
flipframe 1
sound data/sounds/kmatk2.wav
  @cmd slamstart
  @cmd position 1 -43 44 -1 -1
frame data/chars/1kazuya/slamleg0.png

or do you have to have it as script ?
 
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.

So if the player is facing the enemies back and preforms a freespecial they flip so the player is back to back with the enemy is that right ?
 
i want that the player flips only if the move is performed behind the enemy.

Hmmm.... which enemy we are referring here?
I assume it's only single enemy cause it would be more complex if there were more enemies to be checked
 
I think it will display more enemies...
Also, I can remember trying to code something like that in my mod for a back grabbing system. (finally cancelled)
 
I realised that I need this scrip too. I think magggas want to make something similar to sor grab system. Look on this too
 
Ah so that's the enemy. Here's a rough function for conditionalflip:

Code:
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);
     }
   }
}

this function checks current opponent's direction then compare it with self's direction. If they are same then flip
I think this function needs range check added to check if player is behind enemy instead of front but this can be expanded
 
Back
Top Bottom