» Thu Apr 29, 2010 7:30 pm
There may be a "chicken and egg" problem here. You can only detect a successful block by those methods after the block succeeds, but you appear to want to detect it before it happens, so you can substitute an animation.
The problem is going to be the lack of any event in the opponent's animation that will trigger any scripted code to test the effectiveness of the block. IIRC blocking is just a random chance, but you appear to want to make it a player skill thing (not PC skill, actual human player skill) which the engine isn't set up for. It is doing collision detection to see if blocking applies at the time of strike, but that doesn't call any code that lets you catch the event and handle it differently - there's no OnBlock block, and you can't script OnHit on the player. To make matters worse, a block must be in place just before the blow lands, so you need to be called before the event happens, so that you can potentially prevent it, in which case you shouldn't have been called in the first place!
So let's consider what IS possible. If you start a timer when the player begins to block, and can catch the blow landing by the animation or sound methods, you could check the interval between them to see how timely the block was made. That could let you do something to make it more skillful, but it probably can't include changing an animation that's already playing to a new one. At best, you might be able to vary the damage taken, so a last-second block reduces damage taken better than one that's been up all the time.