SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Vintage Story

Trait Restrictions

CBy Cheeki

Addon for Player Model Lib that allows to define item food and wearable restrictions based on traits

Trait Restrictions

Description

<p><strong>THIS MOD DOES NOTHING ON ITS OWN. IT REQUIRES A RACE MOD THAT IMPLEMENT THESE FEATURES.</strong></p> <p>&nbsp;</p> <p dir="auto">Traits can restrict which items a character can use to attack or interact with or wear and can be used to override food items values and edibility. <br />For food overrides, you can specify Satiety, Health and the food category. These values are optional and will use the item's base value if omitted, provided it has any.<br />Items that are explicitly allowed as food will not be blocked if listed in DisallowedInteract. If a liquid (example: milk) is specified as disallowed, any containers with milk inside them will not let you drink it.</p> <p dir="auto"><strong>Items or wearables that are explicitly allowed will always be allowed even if disallowed, even by other traits.</strong> The order is Exclusive&gt;Allowed&gt;Disallowed. You can use this in combination with wildcards to disallow a lot of items at once but only allow one or two.<br />Items marked as exclusive will only be able to be used by classes that have those traits and disallowed for everyone else even if in AllowedItems. The wearable restriction system supports usage of: "type:all" "type:armor" "type:clothing" to easily restrict one or both categories of wearables.</p> <p>&nbsp;</p> <div class="spoiler"> <div class="spoiler-toggle">Sample trait and docs</div> <div class="spoiler-text"> <pre>All this acts as normal trait stuff, so they go in trait.json.</pre> <pre>&nbsp;</pre> <pre>{ "code": "exampletrait", "AllowedItems": ["game:spear-generic-iron"], // Allows usage of the iron spear even if it's later disallowed "DisallowedItems": ["game:spear-*"], // Blocks both attacking and throwing of all spears. Disallows both attack and interaction. "DisallowedAttack": ["game:blade-falx-copper-*" ], // Blocks attacking only "DisallowedInteract": ["game:bow-*", "game:bread-*" ], // Blocks use interaction only (includes eating the item). This makes the bow unusable and the bread inedible "DisallowedAsIngredient": ["game:fruit-cloudberry" ], // Blocks eating the item and eating any meal or pie that contain the item "ExclusiveItems": ["game:spear-generic-ornategold"], // Only classes that have this trait can use this item "AllowedWearables": ["game:armor-*-tailored-*"], // Allows wearing all variants and parts of the linen armor, even if later disallowed by wildcards "DisallowedWearables": ["type:armor", "game:clothes-nadiya-*"], // Blocks wearing all armors and the nadiya clothing. Available types: type:all, type:armor, type:clothing "ExclusiveWearables": ["game:armor-body-antique-forlorn-*"] // Makes forlorn hope armor exclusive to owners of this trait only "AllowedFood": { "game:fruit-*": { "Health": 2 }, // Overrides fruit to give health, leaves satiety and food category untouched "game:redmeat-raw-*": { "Satiety": 200, "FoodCategory": "Protein" }, // Makes raw meat edible "game:charcoal": {} // Makes charcoal edible, but gives no nutrition } }</pre> </div> </div> <p>&nbsp;</p> <h3>Used by:<br /><a href="https://mods.vintagestory.at/lupines">Lupines</a><br /><a href="https://mods.vintagestory.at/feralplayerpack">Animalica</a> &amp; <a href="https://mods.vintagestory.at/animalicabtc">Body tools and classes</a></h3>

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.