Jump to content

Armour mod - how to get health of armour?


niccolo

Recommended Posts

Okay, so I'm whirring away at a mod and the pieces are starting to fall into place; I'm typnig out the code when I realise I'm stuck at a point...

 

My mod basically replaces one set of power armour with another - so you can talk to someone and they'll take your outcast power armour and give you a Brotherhood power armour or vice-versa - as an example.

 

Anyway, I want to set it so that the armour you get in return has equal condition to the one given away and I thought to do this via globals; set a global to the condition of the first armour and then generate a second armour in equal condition.

 

I know how to set an item's health, but I don't know how to retrieve the condition of the specific armour lifted out of the player's inventory.

 

Does anyone have an idea? (Yes, I'm willing to use FoSE... as soon as I remember how to get it into GECK)

Link to comment
Share on other sites

Even with FOSE, you can't get the current health of an item in a container. You can get the health if the player has it equipped, though, with the FOSE commands GetHealth http://fose.silverlock.org/fose_command_doc.html#GetHealth and GetEquippedCurrentHealth http://fose.silverlock.org/fose_command_doc.html#GetEquippedCurrentHealth

 

Then divide the two results to get the health percent. The numbers these two functions return are the base 'hitpoint's for the item, and the current number of hitpoints (health) left.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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