» Sat Dec 10, 2011 6:10 am
If you keep tabs on the player's health, you should be able to differenciate between hits on the player and hits on NPCs as long as they don't happen on the exact same frame ? If the PC gets hit, he loses health, if he dodges the "armor hit" sound doesn't play.
Still, if you use simple sound detection for this, using your exemple : the first dagger hit on a plate armored enemy would still do normal damage (if the script doesn't know you're fighting a plated ennemy yet) and the first hit on the next enemy would do nothing.
Also doesn't cover checking what type of weapon the player is being hit with in a fight (unless they have specific sounds ? no idea really).