Check if player is blocking...

Post » Sun Jun 24, 2012 4:46 pm

I tried this using the method described in http://www.gamesas.com/topic/1360112-full-dump-of-all-animation-variables/page__view__findpost__p__21045545 thread, however as you can see from my investigations there, it doesn't appear to work.

I also tried this:

Scriptname phiTestBlock extends ReferenceAliasObjectReference Property phiAlias autoEvent OnInit()	RegisterForAnimationEvent(phiAlias, "blockStart")EndEventEvent OnAnimationEvent(ObjectReference akSource, string asEventName)	if asEventName == "blockStart"		Debug.Notification("Blocking...")	endifEndEvent

phiAlias is set in the CK to the player, and the script is attached to an alias set to the player in a quest that starts with the game. The above does nothing. Blocking with either a weapon or shield never sends an event, and never prints the notification.

I also tried the same with blockAnticipateStart, blockStartOut, blockHitStart. The only one that seems to work at all is blockStartOut but it is terribly laggy. It will register, the notification prints, but if I block again a second later it won't register, making it pretty useless for scripting purposes.

The whole idea of registering an event is pretty useless actually, since the idea is to check IF the player is blocking WHILE the player is blocking, not WHEN the player blocks. I could have worked around it by implementing an equivalent "blockStopOut" or whatever and doing my script stuff until then, but as I said, it doesn't seem to be reliable. =(

So, I am currently looking for a way to reliably check whether the player is blocking, while the player is blocking.
User avatar
Donatus Uwasomba
 
Posts: 3361
Joined: Sun May 27, 2007 7:22 pm

Post » Sun Jun 24, 2012 5:41 am

Just tried registering for the "PlayerOnBlock" event, which is the only other animation I could see remotely related to this. Also does nothing. =(
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Sun Jun 24, 2012 6:59 am

Currently testing whether using an OnHit() check on the shield itself might work...
User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am

Post » Sun Jun 24, 2012 8:10 am

It takes me so long to set up these test scripts... =P

Another thing I want to test is whether the abHitBlocked variable on the OnHit event would work on the player if they were blocking when a magic attack hit them.

Also, how do concentration spells register? Like if the player is holding down block while an ice mage spams frost, how many OnHit events register?

Do shields register the same/as often as weapon blocks?

Will a weapon block even register with abHitBlocked in an OnHit event if the attack was magic?

Will a shield without the magic damage reduction perk?
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Sun Jun 24, 2012 5:41 am

Shield and Weapon Blocks are coded identically for conditions - all block perks that specifically affect the shield have special conditions or effects that apply only to shields. It's the same thing as Bow Bashes and Shield Bashes.

Concentration Spells only trigger as one casting event, I'm not sure about OnHit events.

I doubt a shield block would trigger abHitBlocked against a spell, but I can't say for sure.
User avatar
Bird
 
Posts: 3492
Joined: Fri Nov 30, 2007 12:45 am

Post » Sun Jun 24, 2012 3:35 am

Just take a look at the perk allowing your to block arrows and the one allowing you to block spells. All the things you want to do are covered there.
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Sun Jun 24, 2012 6:48 pm

Just take a look at the perk allowing your to block arrows and the one allowing you to block spells. All the things you want to do are covered there.

Sort of... That does give me some more to work with anyway, thanks.

I see IsBlocking is listed as a condition function. I hadn't even tried using myRef.IsBlocking() in a script. I wonder if it would work that way?
User avatar
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm

Post » Sun Jun 24, 2012 5:18 am

If it's not a script function in CK Wiki, it cannot be used as a script function. Which is really frustrating when there are some useful condition and perk entry commands. :|
User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Sun Jun 24, 2012 7:45 am

If it's not a script function in CK Wiki, it cannot be used as a script function. Which is really frustrating when there are some useful condition and perk entry commands. :|
That's why it's better to do it with perks. You can use elaborated methods to use conditional functions in scripts, but you'll end up with really slow detection methods. Something not feassible to use in combat.
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Sun Jun 24, 2012 12:36 pm

Problem is none of the perk entry points do what I need them to!

Basically I want to be able to fire some script when the player blocks something. Spell or weapon.

Also, I want to be able to fire some script when the player swings their weapon.

Haven't found a viable solution so far but I'm sure there's a way to make it work. Like you said though, the way it works may end up being too slow for combat.
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Sun Jun 24, 2012 12:38 pm

Well, Quick Reflexes works when the player does a power block, though that may be too precise timing for you.
User avatar
Danny Blight
 
Posts: 3400
Joined: Wed Jun 27, 2007 11:30 am


Return to V - Skyrim