Block moment

Post » Thu Apr 29, 2010 9:28 pm

Hi,
I am looking for a script that queries per GetCrosshairRef if the player blocks in a small period, the attack of the enemy. I do not know how to retrieve the precise moment.

The player blocks the opponent's attack at the right moment, and then he runs an animation. And need the retrieval of the perfect block moment. I need the player to press only in this short period, the Block button.

I hope yo understand me :/
User avatar
Maya Maya
 
Posts: 3511
Joined: Wed Jul 05, 2006 7:35 pm

Post » Fri Apr 30, 2010 4:19 am

You could try isanimgroupplaying to check if the player is playing the blockhit animation, or getsoundplaying to see if the player is playing the blockhit sound.
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » 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.
User avatar
mimi_lys
 
Posts: 3514
Joined: Mon Apr 09, 2007 11:17 am

Post » Thu Apr 29, 2010 7:32 pm

Thank you, I think I try the IsAnimGroupPlaying function to check if player plays the blockhit anim. I must see how it looks ingame if I play the new anim fast enough.

FYI it should be a disarm script, where the player press the block button in the right moment and disarm his enemy with a new Anim. :)
User avatar
Farrah Lee
 
Posts: 3488
Joined: Fri Aug 17, 2007 10:32 pm


Return to IV - Oblivion