preload button hover image:
Current Time: Aug 12, 2022, 04:26:40 am
 Dwarf Fortress File Depot » Utilities » gui/unit-info-viewer.lua
Registration is not required to download. However, it will allow you to vote, comment, and upload. Forgot your password?
File Listing: gui/unit-info-viewer.lua
Last Updated: Jun 19, 2013, 05:05:13 pm
First Created: Jun 03, 2013, 03:51:47 pm
File version: 1.04
For DF version: 0.34.11
Downloads: 261 (305) Size: 8.5 KB
Views: 4,046 (4,267) Type: ZIP
Rating (0 votes): Unrated
Uses a lua viewscreen to display information about a unit's age, birth day, life expectancy, shearing products, milking products, grazing value, Egg laying, body size, and death info.

extract to hack/scripts/gui

add a key binding to dfhack.init such as:
keybinding add Alt-I gui/unit-info-viewer

(written for dhack r3)
Designed for fortress mode, may work in adventure mode (most likely will have issues with dates and ages).

Age, max age (as an average), and grazing (small number has to eat more), are limited to members of the civilization (animals and citizens).
Birth day is limited to citizens (since I couldn't figure a way to filter out wild animals that had been tamed/trained).
Shearing and milking products are currently limited to members of the civilization who are of an adult age.

Body size is currently given as 2 values in cubic decimeters (used by the game) rather than cubic centimeters (used by the raw declarations):
> The first value is the size that triggers a pressure plate and thickens/thins on strength and fat (energy storage).
> The second value is the base size (determines butchering products).

Not all possible causes of death have a nice death string as I think that many of the causes of death are only possible during world gen and will therefore be unused during fort mode. If any of these are encountered, please let me know how the unit died and what message the game reported. Currently omits time of death and killer/slayer info.

Provides a context for dfhack.gui.getSelectedUnit() and receives a unit context from most unit contexts. Does not receive a unit from the justice screen, military scheduling of new orders, and unit->relations. Should work just about everywhere else.

Change log:

Version 1.04
  • removed calculated body size, with a growth bug fix running, it isn't needed.
  • added egg laying info.
  • fixed ghost info not showing up.
  • allowed body size info for undead.
  • changed/fixed wrong char for masterful training.
  • updated cause of death by trap string.
Version 1.02
  • enabled working with arena mode by removing requirement for dfhack.isWorldLoaded()
Version 1.01
  • fix vampires showing as dead
  • update estimated size calculation, I think it should now be accurate for any unit that first spawns full grown
Raw Data: JSON / Text
Checksum / Hash
SHA-256: 44bcc782f3add1dd2b26c816b4bd23334bbece7ca3bea22f3aefb898cb8f33fd
IP: logged
More From This Author
No comments have been posted for this file yet.

Website © 2022 FenriSoft. The core site script is PHCDownload (© 2005-2022).
Hosted by Linode.