Jump to content

Photo

GetHitLocation works! But...

gethitlocation delay limbs headshot perk

  • Please log in to reply
5 replies to this topic

#1
PAPVAFS11

PAPVAFS11

    Enthusiast

  • Members
  • PipPip
  • 139 posts

I'm trying to improvise a simple armored VS unarmored check, mostly for the sake of headshots and so on. I'm using GetHitLocation in a perk to check the bodypart struck. Unfortunately, it seems that GetHitLocation is updating after the hit, so I can't adjust the damage correctly on the spot.

 

Am I using this wrong? Is there a workaround? Or is this just not going to work?



#2
pepperman35

pepperman35

    Old hand

  • Members
  • PipPipPip
  • 893 posts

Not sure, but you might want to give this page a read.  GetHitLocation



#3
PAPVAFS11

PAPVAFS11

    Enthusiast

  • Members
  • PipPip
  • 139 posts

I've been over that page before. The thing is that GetHitLocation does actually work, and the Fallout 4 sister to that page seems to back that up. It's just reporting after the hit lands.

 

So, for example, if I shoot a raider in the arm from a cold start, I get -1 on the first shot. If I shoot him in the head after that, GetHitLocation returns the arm. If I shoot him in the arm after that, it gives me his head as the hit location. I can't get the part struck at the exact moment it's struck.



#4
LarannKiar

LarannKiar

    Old hand

  • Members
  • PipPipPipPip
  • 1,277 posts

I don't think there's a workaround because you need to actually hit the target before "GetHitLocation" can return anything.

 

You may want to use "WornCoversBipedSlot" instead. Here's a list of Fallout 4's body slots.

 

Returns true if the subject wears a helmet or cap:

 

Condition: WornCoversBipedSlot

 

Parameter 1: Integer: 30 (or 31, see body slot list)

 

Run on: Subject

 

Comprasion: ==

 

Value: 1

 

If you'd like to alter the damage input for body parts, you need to edit the NPCs' Body Part Data.



#5
PAPVAFS11

PAPVAFS11

    Enthusiast

  • Members
  • PipPip
  • 139 posts

I appreciate the advice, and I wasn't aware of the WornCoversBipedSlot condition before. Unfortunately, I'm struggling to figure out how that'd help me tell which part of a character has been hit.

 

I'm aware of editing body part data. In fact, working with that was actually what gave me the idea to try this. I'd just hoped to be able to manipulate the incoming damage depending on whether the character is wearing armor where they're hit.

 

If what I'm looking for isn't possible, I guess I'll just have to figure out something with scripts, or on-hit effects.



#6
DieFeM

DieFeM

    Old hand

  • Members
  • PipPipPip
  • 981 posts

If you create an object mod for a weapon, and you attach an enchantment to it (Property modifiers->peEnchantments ADD), and this enchantment is set to "fire and forget" and "contact", with Target conditions using GetHitLocation and Effect archetype to "script", when you hit an NPC on the "Hit Location" corresponding to the condition then the OnEffectStart event in the script will be triggered.







Also tagged with one or more of these keywords: gethitlocation, delay, limbs, headshot, perk

IPB skins by Skinbox
Page loaded in: 1.251 seconds