Gauntlet equip fix

If you liked this item, please rate it up on Steam Workshop page.

Author: mohard

Last revision: 31 Jan, 2023 at 18:09 UTC (1)

File size: 3.07 KB

On Steam Workshop

Description:

If your dwarves refuse to wear gauntlets that are a part of their uniform, displaying yellow "three dots" on their equip screen, then this is a mod for you.

What does it do?

TL;DR Allows your military dwarves to equip their gauntlets, no matter what other clothing they already wear.

Dwarf Fortress has a sophisticated system for working out what clothing and armor your dwarves are allowed to wear. It’s unfortunately also rather hard to understand, hidden from the player, and rather clunky in places. Much like the whole game. One of the common issues with the system is that your military dwarves will refuse to wear their gauntlets if they already wear both gloves and mittens. This mod aims to address this issue by tweaking the mittens’ properties so that gloves + gauntlets + mittens can be worn together. You should never again see the dreaded "three dots" next to the handwear ever again! Well, as long as your Urist McAxedwarf doesn’t accidentally lose his hand somewhere, that is…

This mod’s only effect is to allow the combination of: gloves, gauntlets, mittens (one pair each) to be a valid, wearable combination for your military. No valid vanilla combinations are lost. No additional non-vanilla combinations are added. Except for the military wearing the armor they are supposed to be wearing this should make no impact on your fort.

(Note that you can also use the "Uniform replaces clothing" setting to force wearing gauntlets without resorting to mods, but this comes with its own set of quirks. Namely that your military dwarves won’t wear any clothing, and if you do include clothing in their uniform they will not get rid of tattered items.)

Reporting bugs

I have tested this change on a few forts, with various combinations of available handwear, and found no weird issues. If you spot something strange happening, or you dwarves refuse to wear gauntlets again, please make a screenshot of:

  • the equip screen
  • the equip details screen
  • the dwarfs’ items tab
  • the dwarfs’ health tab
  • the squad schedule and orders

and send it to me over a DM.

Adding to existing saves

It’s not possible to add a mod to an existing save. You can perform the update to raw files yourself though, it’s really easy. But make sure to back up the original file so you can safely revert if anything goes wrong, or if you simply don’t like the change.

The exact steps are:

  • find the file
    "Dwarf Fortress/data/vanilla/vanilla_items/objects/item_gloves.txt"
  • backup the file (copy and paste it somewhere else, or same place with a different name)
  • open the file with any text editor
  • locate the line with
    [ITEM_GLOVES:ITEM_GLOVES_MITTENS]
  • a few lines down, in the same "block", change
    [LAYER_SIZE:15]

    to

    [LAYER_SIZE:25]
  • right below, change
    [LAYER_PERMIT:20]

    to

    [LAYER_PERMIT:30]

Note that the changes to raws will be visible in ALL of your saves upon loading them unless overridden by some save-specific mods.

Note that manual raw changes will most likely be reverted when new DF versions are published, or when you run the "Verify integrity of game files" from Steam.

Compatibility

This mod has been tested on DF v.50.05, but should work with no changes for all earlier and subsequent DF versions.

This mod modifies the definition on mittens in `vanilla_items/objects/item_gloves.txt`. Any other mods that do the same will probably conflict in some way, but may also work just fine. If in doubt, try it out on a pocket world and let us all know how it went. I’ll try to include known compatibilities and incompatibilities in the description.

It is 100% safe to use with any mods that don’t modify the above file.

Any mitten-like items added by other mods will not be changed, and may still NOT work properly.

Similar mods

Shaped Gloves by @Dawnmist

The Shaped Gloves mod addresses the same issue by using the [SHAPED] tag. It does not modify the mittens’ size/permit but has the side effect of making some valid vanilla combinations invalid. It’s a tradeoff, and maybe you prefer the other solution. An alternative to this mod, be sure to check it out.

Shaped Shoes/Boots by @Dawnmist

The "Shaped Shoes/Boots" mod addresses the same issue but for footwear, using the [SHAPED] tag. Has the side effect of making some valid vanilla combinations invalid. Alternative to "Over Boots".

Over Boots by @GhostPutty

The "Over Boots" mod addresses the same issue but for footwear. Adds another valid wearable combination, allowing military dwarves to wear socks, shoes, and boots at the same time. Admittedly a bit cheaty since shoes + boots is not a valid combination in vanilla. Alternative to "Shaped Shoes/Boots".

Credits

@Dawnmist – for his mods that utilize SHAPED tag to solve the same issue and for discussion in comments

@GorillaxJax – for explaining how the layer/size/permit system actually works

dwarffortresswiki.org – for being a great resource

Solution details

Vanilla has 3 dwarven handwear items:

  • gloves – the first layer (Under)
  • gauntlets – the second layer (Armor)
  • mittens – the third layer (Cover)

Yes, this means that mittens are being worn ON TOP of gauntlets. Maybe it doesn’t surprise you, but it did surprise me.

Their layer size/permit are:

  • gloves – size:10, permit:10
  • gauntlets – size:20, permit:15
  • mittens – size:15, permit20

What does the permit mean? It means that when you sum the size of all other items worn on the same layer or lower, they must be lower or equal to the permit. Otherwise, the combination will not be valid.

Vanilla allows the following combinations to be worn:

  • only gloves
  • only gauntlets
  • only mittens
  • gloves + gloves (same layer, gloves1 size is 10, gloves2 permit is 10, 10<=10 so this is OK)
  • mittens + mittens (same layer, mittens1 size is 15, mittens2 permit is 20, 15<=20 so this is OK)
  • gloves + mittens (gloves on a lower layer, gloves size is 10, mittens permit is 20, 10<=20 so this is OK)
  • gloves + gloves + mittens (gloves on a lower layer, gloves1 size is 10, gloves2 size is 10, mittens permit is 20, 10+10<=20 so this is OK)
  • gloves + gauntlets (gloves on a lower layer, gloves size is 10, gauntlets permit is 15, 10<=15 so this is OK)
  • gauntlets + mittens (gauntlets on a lower layer, gauntlets size is 20, mittens permit is 20, 20<=20 so this is OK)

The problematic combination is gloves + gauntlets + mittens, which they try to wear once they already have gloves + mittens, and are asked to put on gauntlets as part of the uniform:

  • gloves + gauntlets + mittens (gloves and gauntlets on lower layers, size is 30 (gloves 10 + gauntlets 20), mittens permit is 20, 30>20 so this is NOT OK!)

The above tells us that mittens need to have permit 30 for this combination to work. We also don’t want to allow wearing >2 mitten pairs at the same time, to maintain vanilla behavior, so we must also bump its size to >15. Increasing both settings by 10 makes it all work smoothly.

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.