Creating a body size based on selected traits
Heya. I've been toying with the idea of learning this modding thing, specifically trying to create clothing that is no longer "one size fits all." The XML file is a lot of confusing numbery stuff, but reading other posts gives me a little glimpse as to how to guess-and-proceed.
The goal of this would be twofold:
- Add a bit more realism by discarding the "one size fits all" mechanic.
- Add an environmental challenge to maxed out combat builds (Strong, Tough, Athletic, Melee) by requiring them to find clothing or armor that fits. Crafted items, such as the dogman fur coat, should either be exempt (the player will always craft it to fit themselves) or created in the player's size (which makes more sense, but may be more headache to do than is worth).
The main thing I need to figure out first is this:
- Is there a way to determine a body size for a creature based on traits it has selected?
For example: Humans start at a baseline of 10 (this could be 0, but I wanted to keep positive integers). If they pick the Strong or Tough trait, they would add 2. Athletic or Melee adds 1. Weak subtracts 2, and Frail subtracts 1.
Would using a Condition work? (Apply +2 to nBodySize if Strong trait is detected on spawn/load). Some other method?
The second thing to determine is this:
- Is there a way to prohibit clothing items from being worn based on a condition or variable? Can this be a range instead of a single locked number?
For example: You selected Strong and have an nBodySize of 12. You pick up a pair of boots that can only be worn by someone with an nBodySize of 11, 12, or 13. It can be equipped normally.
- Is there a way to add a Condition if certain conditions are met? Similar to the "Wearing a Tough Glove," but designed more for ill-fitting clothes. Can these conditions stack?
For example: You have an nBodySize of 12. You can wear boots sized 11, 12, or 13 without penalty. A size of 10 applies "Tight-fitting boots" and a 5% faster fatigue rate. If you wear a pair, it stacks to 10% faster fatigue rate. A size of 14 applies "Ill-fitting boots" and a 3% faster fatigue rate per boot.
NPC creatures should, in theory, only be able to equip what will fit based on what traits they have, following the same rules as the player.
For full concept as I have it written out so far, click the spoiler:
Start at Medium (nBodySize="10" nBodyGroup="0")
Strong: Size +2 Group +2
Tough: Size +2 Group +1
Athletic: Size +1 Group +0
Melee: Size +1 Group +0
Weak: Size -2 Group -1
Frail: Size -1 Group -1
(Apply variables as conditions?)
Use nBodySize for footwear (sized numerically). nBodyGroup for clothing (sized as a group)
Clothing Thresholds (up to 9 stacks? however many slots there are...):
2 groups smaller: Cannot Equip ("It's too small to wear.")
1 group smaller: Tight-fitting Clothes (2% faster fatigue rate, 2% decreased warmth)
Bodygroup-sized: No penalty
1 group larger: Ill-fitting Clothes (1% faster fatigue rate, 2% increased warmth)
2 groups larger: Cannot Equip ("It's too large to wear.")
Footwear Thresholds (up to 2 stacks):
3 sizes smaller: Cannot Equip ("It's too small to wear.")
2 sizes smaller: Tight-fitting Boots (5% faster fatigue rate)
1 size smaller: No penalty
Body-sized: No penalty
1 size larger: No Penalty
2 sizes larger: Ill-fitting Boots (3% faster fatigue rate)
3 sizes larger: Loose-fitting Boots (5% faster fatigue rate, 2% decreased warmth)
4 sizes larger: Cannot Equip ("It's too large to wear.")
Consider also an "Unopened Shoebox, size n" item. When used, grants a pair of 100% boots in the size indicated, then turns into "Shoebox" and can be used as regular storage (holds one pair of hiking or tactical boots as indicated). Can also randomly scavenge the empty shoebox itself at times.