Jump to content

Need Help With Armor Health


23BLUENINJA

Recommended Posts

hello, im fairly new at modding and i need help making what should have been a simple script. rather than making a setarmorhealthperc or somthing like that, they make you use an object reference, i think. so far, i havent found one that works. ive tried:

 

setEqCurHealth 90 2 (FOSE, should set the currently equipped armor that covers the upper body bipped slot (thats the two) to 90%, but it doesnt)

 

setObjectHealth 90 ArmorPower

 

i havent found anything elsethat works and if i get help this is going to be an EPIC mod so please some help. NOTE: i need to set the PERCENT of armor health, not a specific number.

 

Thank you!

Link to comment
Share on other sites

  • 3 weeks later...

are you looking for the durability of the armor? or its damage resistance...they're very seperate things.

I'm guessing Durability looking at your choice of commands.

 

Looks like you may be having a syntax problem, generally commands go

Object -> Command - > Subject -> Data

so in your case, you can cut out the Object part (which if you were adjusting a player stat would be "Player")

So:- SetObjectHealth ArmorPower 90

 

just looking at this list, you might prefer the function SetEquippedCurrentHealth

which takes a specific slot on your body and IDs the item equipped there, then sets its health.

Link to comment
Share on other sites

SetEquippedCurrentHealth

Alias: SetEqCurHealth

 

Using this function to set the health to 90 does just that. Not 90%, but 90 hit points. It's refering to the base health of the item you set in the Geck.

 

To manipulate the health of equipped armor, you need to do things like this:

 

To get the health percent (to get fArmorHealthPerc at 0-100):

set rPlayerArmor to player.GetEquippedObject 2
set iArmorBaseHealth to GetBaseHealth rPlayerArmor
set fArmorHealth to player.GetEquippedCurrentHealth 2
set fArmorHealthPerc to (fArmorHealth / iArmorBaseHealth) * 100

 

To set the health percent (first set fArmorHealthPerc 0-100)

set fArmorHealth to ((fArmorHealthPerc / 100) * iArmorBaseHealth)
player.SetEquippedCurrentHealth fArmorHealth 2

 

Edit - and you should always check first to make sure rPlayerArmor is not zero, otherwise you may CTD when FOSE functions are called.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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