Jump to content

Scripting for hit-location based armor values


Geeves83

Recommended Posts

This might do the trick

 

float BonusDam
begin scripteffectstart
if gethitlocation != 1 ;Check Location. 1 = Headshot,else return.
return
endif
if GetIsCreature == 1 ;Check if is Human. 1 = Non-human.
return
endif
if getEquipped "FormList with all Helms" == 0 ;check if is wearing helm,1 He is,0 he is not.
set BonusDam to player.GetAttackDamage ;didn't tested it, is a command from NVSE. http://nvse.silverlock.org/
set BonusDam to BonusDam / 1.5 ;divide the Damage,because the normal damage will not be anulled
damageav health BonusDam ;Bonus damage when the victim is not wearing helmet,and takes a headshot.
endif
end

 

Made in a notepad,so might have a typo.

 

2 Problems:

1:Need to attach this effect script to all ammo(or combine with the script present).

2:The damage bonus is based in the player current weapon damage,so in a gunfire between NPCS ,if the player is using a fatman....(to solve this you can substitute the BonusDam in the damageav line to any constant damage you want.)

 

Didn't tested ,but should work for anything that uses ammo (i'll test this soon).

 

Edited: Yep . works for any NPCs,Original or Mod.(unless the NPC uses a special ammo from the mod).If you wanna see the result of my "field test"...

Link to comment
Share on other sites

  • 2 months later...

I decided to pick up on this project. Dunno if you ever managed to finish this, Geeves83. After a lot of trial and error, I have made a lot of progress. The current script works:

 

scn 0HelmetHeadshot

begin scripteffectstart
if getHitLocation == 1 && getIsCreature == 0 && getEquipped 0HelmetList == 0
setAV damageThreshold 0
endif
end

 

"0HelmetList" is a form list that I made that includes all the helmets. Now, if you shoot someone in the head who doesn't wear a helmet, they don't get any Damage Threshold against that. This script is attached to every ammo type as an Impact Script. The only problem is, and I have hit the limit of my current scripting skills (this is the 2nd script I have ever made):

 

They still have 0 DT after the headshot is made. So if it doesn't kill them on the first headshot, they don't get their original DT back.

 

Any ideas how to fix this would be greatly appreciated, as this is a great step towards more intuitive and fun shooting gameplay in my opinion. Also, my next step is to make a script that only counts the helmet DT for headshots if they wear a helmet.

Edited by CabooseNor
Link to comment
Share on other sites

Ideally, I would like the script to behave like this:

 

scn 0HelmetHeadshot

float OriginalDT

begin scripteffectstart
if getHitLocation == 1 && getIsCreature == 0 && getEquipped 0HelmetList == 0
set OriginalDT to getAV damageThreshold
setAV damageThreshold 0
---APPLY DAMAGE TO THE TARGET NOW---
setAV damageThreshold OriginalDT ; Restores the Damage Threshold back to its original value
endif
end

 

I have no idea if there even exists a way or any commands to fill the hole in that script; to make the damage apply after I reduce the DT to 0, and then restore the original DT afterwards. Help!

Edited by CabooseNor
Link to comment
Share on other sites

  • 1 year later...

Ideally, I would like the script to behave like this:

 

scn 0HelmetHeadshot

float OriginalDT

begin scripteffectstart
if getHitLocation == 1 && getIsCreature == 0 && getEquipped 0HelmetList == 0
set OriginalDT to getAV damageThreshold
setAV damageThreshold 0
---APPLY DAMAGE TO THE TARGET NOW---
setAV damageThreshold OriginalDT ; Restores the Damage Threshold back to its original value
endif
end

 

I have no idea if there even exists a way or any commands to fill the hole in that script; to make the damage apply after I reduce the DT to 0, and then restore the original DT afterwards. Help!

there is no simple way you could add that try to guess the original damage by a formula then correct it

if im not wrong PN have something like this

 

 

i really into make batter headshots maybe add this to arms and legs to for that armor that only protect torso

 

and if be even more luck separate the damage of the head and the face (the idea : put a invisible mask on the player/npc if he is using a helmet .if is possible detect if the mask hp get lower or the helmet)

Edited by betto212
Link to comment
Share on other sites

I thinked on a way to fix this

is consider that the helmet "TRUE" DT is 4 times its DT

 

if a body armor have 24 then its helmet counter part would give 6 of DT

total of 30DT

 

 

 

the proto code

 

if bodyArmor dt = helmet DT * 5

do nothing

return

elseif bodyArmor dt > helmet DT * 5

...

damageav health difference

elseif bodyArmor dt < helmet DT * 5

...

restoreav health difference

endif

 

 

 

 

 

=========================================

and after this formula some extra dmg could be add to make kill headshots

so what you think ? someone want to do some help on this

Edited by betto212
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...