Superku is right, the way I handled my combat in my "Tales of Symphonia" styled combat game/project is like this...

-Player swings sword. Theres a trace going from the base of the sword to the tip.

-When it comes in contact with an entity, I check to see what kind of entity it is with skills, like;
Code:
if(hit.entity)//Did I come in contact with an entity?
{
   enemy_hit = hit.entity;//Set a pointer to the enemy I hit
   if(enemy_hit.skill10 == 2) //Is the thing I hit an enemy?
   {
      enemy_hit.skill11 = 1; //Let the enemy know I am hitting it
   }
}


-What this does is simply setting a pointer to whatever I am coming in contact with, then checking to see if what I am hitting is an "enemy" type. If it is, I set its "I am being hit" skill (skill11 in this case) to 1.

-In your enemy code, you then just have to set it like...
Code:
function enemy()
{
   my.skill10 = 2;
   while(my.health>0)
   {
      if(my.skill11==1)//Checking to see if the enemy has received a "hit" confirm
      {
         //Do hit animations, reduce damage, etc
         my.skill11 == 0; //Reset the skill
      }
      wait(1);
   }
}



-I added a "stun" skill to my enemies which determined how long the hit frame should last between hits. So say if I have a stun of 40, then there will be a wait time of 40 frames unil the enemies "hit" skill gets reset to 0.


This is the way I did it, and it may not even be the "best" way to do it. But it works, and if anyone out there can give this guy some better advice please do so. I dont like giving misinformation laugh

Last edited by exile; 09/27/12 09:08.