Detect Headshot with Spell?

Post » Tue Jan 01, 2013 4:14 pm

How can I detect if a spell/projectile has hit the target in the head?

http://www.youtube.com/watch?v=GkzRtx3gWJAshows it's possible, but I cannot figure out how they did it, and http://skyrim.nexusmods.com/mods/14797claims to do it with arrows but their approach sounds buggy as heck.

Anybody know how the more stable-sounding video method was done?
User avatar
Miragel Ginza
 
Posts: 3502
Joined: Thu Dec 21, 2006 6:19 am

Post » Tue Jan 01, 2013 12:53 pm

How can I detect if a spell/projectile has hit the target in the head?

http://www.youtube.com/watch?v=GkzRtx3gWJAshows it's possible, but I cannot figure out how they did it, and http://skyrim.nexusmods.com/mods/14797claims to do it with arrows but their approach sounds buggy as heck.

Anybody know how the more stable-sounding video method was done?

Do you want this to be for a specific spell, or for all spells?
The former is relatively easy, the latter likely impossible.
User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Tue Jan 01, 2013 12:58 pm

A specific spell... specifically I'm trying to make a "Flying Guillotine" spell that decapitates on a headshot, or just really annoys the target if it hits anywhere else.
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Tue Jan 01, 2013 11:58 am

A specific spell...

Ok good, what you'll want to do is make an explosion with a placed small moveable static with a NullTextureSet. The static first (in an onload event) memorizes its coordinates, then sets its own motion to keyframed and does a translationtorefnode on the head of the target of the spell (which has been added to an alias). OnTranslationComplete it then memorizes its new coordinates, compares them to the initial coordinates, and if the distance between the two is small enough (i would say less than 5 units would be a good distance), BOOM headshot. Then the thing clears the alias, then deletes itself.
User avatar
ijohnnny
 
Posts: 3412
Joined: Sun Oct 22, 2006 12:15 am

Post » Tue Jan 01, 2013 8:59 pm

Thanks tons... I figured explosions would come into play here (it's how http://steamcommunity.com/sharedfiles/filedetails/?id=112883201work) but I would have never figured out the keyframing and translation trick.

I'm still a little fuzzy on your approach to getting the headnode of the spelltarget via "an alias"... there is a questAlias conditional to do this perhaps? Or maybe I misunderstand... I was thinking to use ActiveMagicEffect.GetSpellTarget for the objectref and had assumed all humanoids have the same refnode for their heads... SBP_130_HEAD or SBP_30_HEAD not sure which to use here?

And yeah, I can see why doing this en masse would be impossible.
User avatar
Antonio Gigliotta
 
Posts: 3439
Joined: Fri Jul 06, 2007 1:39 pm


Return to V - Skyrim