Implementing Locational Body Damage via Scripting

Post » Tue Jun 19, 2012 8:47 am

This is something I was hoping the Papyrus would supporrt due to Fallout 3 and NV having this, but it seems all functionality was stubbed or greyed out.

This is something that belongs in the engine itself and not done with scripts, I can only hope the SKSE can do something about this, until then I want to talk about the feasiblity of this with using Papyrus alone.

I want to start small so I want to mainly talk about projectiles like arrows and ice spikes. Melee combat not apply.

I notice in the body part data that the game supports things like 'nodes' on bodies, and the human body has nodes for the head, shoulder, torso, leg, etc. So my first question is to ask if there is any possible way of getting the xyz coordinates of these body part nodes. If so, then this would be trvial, we can just take get the difference of the projectile and node, and we can say the arrow hit the head if the head node's position vector and the projectile's position vector are less than a certain number. I can't find any info on getting body part node positions in game however.

Now, my initial take on this is to look at the OnHit function the CK provides. It takes in the projectile i.e the arrow or ice shard. This seems to give me some hope in that I can l assume I can get the xyz coordinates of the projectile since it is a in game object. Now, the hackey solution here is as follows:

We have the xyz of the projectile, and we can get the xyz of the Actor who was hit by the projectile, the question now is where is the Actor's head xyz relative to the xyz of the Actor? I assume the xyz reported by the getPosition function or whatever is not the head itself, or this would also be easy. So I assume it is somewhere near the midsection of the Actor's mesh, like the torso, so the head is, if the actor is standing, [x,y,(z+offSet)] relative to the Actor, if standing. The moral of the story here is the head can be "estimated" by knowing the pose of the Actor [standing, crouching, bleeding out,], and doing simple math on the xyz in order to get a "hitbox" for the head to allow instant kill head shots.


These are my intial ideas, and I have not scripted much in previous titles, so if anyone can point me in the right direction or offer some cool new ideas on tackling this I would be very happy! Thanks!


If you couldn't tell, my goal is to make a mod that allow head shots from ice spikes to be lethal.
User avatar
keri seymour
 
Posts: 3361
Joined: Thu Oct 19, 2006 4:09 am

Post » Tue Jun 19, 2012 2:52 am

bump
User avatar
Kaley X
 
Posts: 3372
Joined: Wed Jul 05, 2006 5:46 pm

Post » Tue Jun 19, 2012 12:44 am

I will be watching this thread, keep us updated with any progress. If I do end up making a combat mod, locational damage will be the most important feature. Maybe you should ask Spookyfx? He is probably working on it.
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Tue Jun 19, 2012 11:52 am

Bump for importance.

User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Mon Jun 18, 2012 8:35 pm

If you can't get the xyz of the different body nodes directly, could you attach small objects to them and get the xyz's of the objects?
User avatar
Marlo Stanfield
 
Posts: 3432
Joined: Wed May 16, 2007 11:00 pm

Post » Mon Jun 18, 2012 10:35 pm

This would bring us closer to having a mod that every time you hit something with an arrow, it hits them in the knee.
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am

Post » Tue Jun 19, 2012 12:32 am

If you can't get the xyz of the different body nodes directly, could you attach small objects to them and get the xyz's of the objects?

That's a very good idea, I will look later on and see if this could be possible.
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Tue Jun 19, 2012 11:50 am

Functions like http://www.creationkit.com/MoveToNode_-_ObjectReference will probably be useful for that, but trying to call that many times in quick succession will probably not work particularly well, I expect. Since the information seems to be available to Papyrus in this native function, hopefully it will be plausible for SKSE to eventually let us access a node's coordinates directly.

Cipscis
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Tue Jun 19, 2012 8:28 am

Functions like MoveToNode will probably be useful for that, but trying to call that many times in quick succession will probably not work particularly well, I expect. Since the information seems to be available to Papyrus in this native function, hopefully it will be plausible for SKSE to eventually let us access a node's coordinates directly.
Cipscis

Moving in the right direction by finding that from the reference, however, I do not think with the right implementation the function will not have to be called more than once. You have to ensure the projectile is infact no longer in transit, and you can safely assume this when the target that it hit enters a state change, probably a combat transition or in general, its AI packages are interrupted. Once you know this, you can call moveToNode(theProjectile, "Head"), and take the delta of the projectiles impact location and the projectiles location at the node. A small delta would imply a direct hit, and larger deltas follow the same, above a certain threshold of course.

The main problem now is getting the projectiles location, I hear this is currently impossible besides doing a jury-rigged solution of making your own object, and treating it like a projectile, which would mean the ice spike spell would have to be modified in a very different way if you wanted to use a in game object vs projectile. I will continue to think on this so I do not turn my reply into a stream of consciousness :P
User avatar
Abel Vazquez
 
Posts: 3334
Joined: Tue Aug 14, 2007 12:25 am


Return to V - Skyrim