Back to NxLabs

NxLabs / Vintage Story

Traits and Classes lib

VBy VSCustodian

Framework for adding interconnected classes

Traits and Classes lib

Description

<span style="font-size: 14pt;">Was commissioned by:</span><span style="font-size: 14pt;"> 1death39</span>

&nbsp;

<span style="font-size: 14pt;">Requires:&nbsp;<span style="--darkreader-inline-color: var(--darkreader-text-3598db, #747474);">Player Model lib, Overhaul lib</span></span>

&nbsp;

<span style="font-size: 14pt;">Reworks how player traits and classes stored, accessed and selected on creation.</span>

&nbsp;

<span style="font-size: 14pt;">Compatibility:</span>

  • <span style="font-size: 14pt;">Sonito's Dynamic Traits - probably compatible, seems to work</span>
  • <span style="font-size: 14pt;">MultiClass Reborn - probably incompatible, traits added by the lib are not displayed, no crashes, mod seems to work</span>

&nbsp;

<span style="font-size: 14pt;">Allows for player to have several classes from different categories at the same time.</span>

<span style="font-size: 14pt;">Classes can be chained together, allowing adding specialisations available only to specific classes. Like "armorer" and "weaponsmith" specialisations for "smith".</span>

<span style="font-size: 14pt;">Classes added vanilla way will have 'vanilla' category.</span>

<span style="font-size: 14pt;">To add classes and traits using new JSON api, put files containing structure from docs into 'config/classesandtraits'.</span>

&nbsp;

Docs

<pre class="language-javascript">{ // Player will be able to select only one class from each category "classCategories": [ { // category with no currently avaiable classes will be hidden "code": "mycategory", // category code, including domain; if domain is missing, asset domain will be added "order": 0 // order in which categories follow, vanilla is always 0 } ], "classes": [ { "enabled": false, // use to disable "code": "myclass", // class code, including domain; if domain is missing, asset domain will be added "category": "game:vanilla", // category of this class; if domain is missing, asset domain will be added "requiredTraitsAndClasses": ["anothermod:another-class", "game:hunter"], // if specified, player should have these classes or traits present to be able to select this class; only traits and classes from previous categories count "forbiddenTraitsAndClasses": ["anothermod:yet-another-class", "game:resourcefull"], // same as requiredTraitsAndClasses but inverted // if none of requiredTraitsAndClasses and forbiddenTraitsAndClasses specified, class if always available "traits": ["resourceful", "game:forager"], // same as vanilla classes "gear": [],// same as vanilla classes; only gear from last category that have it specified will be used "additionalGear": [] // same as 'gear', but will be added to player regardless of other gear and wont be overriden } ], "traits": [ { "code": "resourceful", // trait code, including domain; if domain is missing, asset domain will be added "type": "positive", // same as vanilla "persistsOnDeath": true, // if set to false, will be removed from player on death, use this field in cases when you give it to player programmatically, setting it to false for classes will result in undefined behavior "persistsOnWorldReload": true, // if set to false, will be removed from player on death, use this field cases when you give it to player programmatically, setting it to false for classes will result in undefined behavior "attributes": { // same as vanilla "animalLootDropRate": 0.1 // same as vanilla } } ] }</pre>

&nbsp;

Example

<pre class="language-javascript">{ "classCategories": [ { "code": "game:vanilla", "order": 0 }, { "code": "t-1", "order": 1 }, { "code": "t-1.5", "order": 1.5 }, { "code": "t-2", "order": 2 } ], "classes": [ { "enabled": false, "code": "c-1", "category": "t-1", "traits": [], "gear": [] }, { "enabled": false, "code": "c-2", "category": "t-1", "traits": [], "gear": [] }, { "enabled": false, "code": "c-3", "category": "t-1", "traits": [], "gear": [] }, { "enabled": false, "code": "c-4", "category": "t-1.5", "requiredTraitsAndClasses": ["c-2"], "traits": [], "gear": [] }, { "enabled": false, "code": "c-5", "category": "t-1.5", "requiredTraitsAndClasses": ["c-2"], "traits": [], "gear": [] }, { "enabled": false, "code": "c-6", "category": "t-1.5", "requiredTraitsAndClasses": ["c-3"], "traits": [], "gear": [], "additionalGear": [] }, { "enabled": false, "code": "c-7", "category": "t-2", "traits": [], "gear": [] }, { "enabled": false, "code": "c-8", "category": "t-2", "traits": [], "gear": [] }, { "enabled": false, "code": "c-9", "category": "t-2", "traits": [], "gear": [] } ], "traits": [ { "code": "resourceful", "type": "positive", "persistsOnDeath": true,
Read the full description on Vintage Story ModDB →

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.