Jump to content

HP and 'needs repairs' status of gens/purifiers/etc.


Recommended Posts

I'm looking for some sort of flag that indicates that a settlement structures such as a generator, water purifier, scavenging station, crop, etc. is in need of repair. Getting the current and maximum HP of such structures would also be very beneficial (and together would be sufficient to replace a 'repair' flag). For turrets, the 'health' actor value can be used to only partially fulfill my requirements, but this doesn't seem to be used by the other structures mentioned. Besides actor values, I've looked through keywords, reference types, and properties/variables of the associated 'workshopobjectscript' script, and so far have come up dry. At least some of these structures seem to come from furniture records which have a DEST (destructible) header that includes a 'health' value, but I have no idea where this would be reflected in the live status of the game. I've also looked for records controlling how the workshop 'menu' is drawn so that I might be able to peek at the logic behind the decision to show a 'repair' option, but I've not found this yet.

 

I'm using FO4Edit and I'm very new to FO4 modding (and this is the first Bethesda game I've attempted modding), so any suggestions or hints that might lead me in the right direction would be greatly appreciated.

Edited by FlatulentGerbil
Link to comment
Share on other sites

Well, it's a bit embarrassing in retrospect, but for turrets which have actor health values, I plan to use the 'GetHealthPercentage' function to determine that a turret has been damaged, and I'll compare their health values to '0' to determine if they're destroyed. For other structures that aren't treated as actors (examples of which I listed previously), the 'GetDestroyed' function can be used to determine if the object is destroyed, but I'll be using the 'GetDestructionStage' function for a bit more resolution, which seems to have the following stages for relevant settlement structures (that I've observed in quick testing):

  • -1: undamaged
  • 0: damaged
  • 2: destroyed

I'm guessing that stage '1' is something like when a car is on fire but has not exploded yet, but I've not tested this.

Edited by FlatulentGerbil
Link to comment
Share on other sites

  • Recently Browsing   0 members

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