Mods / Trait Acquirer

Category: #Tweak #Utility
Author: Arkhael
Side: Both
Created: Aug 9th at 7:53 PM
Last modified: 6 days ago
Downloads: 2879
Follow Unfollow 108

Latest file for Various v1.20.x:
traitacquirer_0.9.6.zip 1-click install


Adds trait manuals that can be found in various game structures or purchased from the Treasure Trader to acquire the exclusive crafting recipes from each class.

Also adds two server commands to add or remove any extra traits, though this has no effect on class traits.

Config allows setting permission level for the commands as well as disabling the manuals altogether.

 

To make your own items that add and remove Extra Traits the item needs the class "traitacquirer.ItemTraitManual" and the attribute "traitdata" containing the arrays "add" and "remove" with all lowercase trait names in the relevant array for what you want. See the source for the trait-manual.json that does this for the mod.

New 0.9.4: Trait Exclusivity & ListTraits Command

Traits can be made exclusive with one another by adding to the trait the "ExclusiveWith" array containing the trait codes for exclusive traits. This can be added to new traits or patched onto the default ones as needed.

Example:

{
  "file": "game:config/traits",
  "op": "addmerge",
  "path": "/-",
  "value": {
    "code": "testExclusive",
    "type": "mixed",
    "attributes": {},
    "exclusivewith": ["clothier", "technical"]
  }
}

Be warned that the prevention mechanism is unable to be bypassed so items that add mutually exclusive traits will be unusable, it does take into account removals however so removing an exclusive trait at the same time as you add the other is possible.

All currently loaded traits can be listed alphabetically with the "/listtraits" command, this is a lot of text even with just the default 26. Will be replaced in future with a handbook page that lists trait properties as well as exclusivities to make it easier to keep track from in-game. Replaced with the custom handbook pages in 0.9.6

New 0.9.5: Trader & Loot Configurability

Quite simple really (Though implementing it isn't), trader price and stock for manuals is configurable and as are the odds and rates of their appearing in the gear randomizer. Currently all manuals are treated the same to not bloat the config file or require too much work as the manuals aren't anywhere close to their final form.

New 0.9.6: Handbook Update

A new Handbook tab has been added which contains automatically generated pages for each trait giving details as to what effects it has, which traits it is exclusive with and the code needed for use with the commands. It also generates a page for each type of trait: Positive, Mixed and Negative. This page links to all of the traits in that type for easier navigation.

Also in this update are:
Fixes for the application of trait effects, as well as a simplification of the code that does this to hopefully improve stability in multiplayer
Improvement of the commands, including a new flag to allow forced bypassing of the exclusivity rules (Note that if you have a non-compatible trait until it is removed you will not be able to gain new traits without forcing it)
Updating trader patches for 1.20, this unfortunately breaks the trader patches on older versions of the game so if you're running 1.19 and desperately want the patches to work use the old ones from 0.9.5 instead, the error messages from the patch won't break anything else just the trader stuff

 

ToDo:

Class Manual Models and Textures

Particle & Sound effects when using a manual

More manuals to acquire the non-crafting traits through gameplay, likely with custom traits to balance addition and removal of powerful traits.

Configurable prices and drop rates for manuals

In-game class changing items

Handbook page listing traits and their details

Proper Documentation on making new content intended for this mod

Randomizer item to make acquiring traits more interesting <== Currently Working On

Issue Tracker

 

Compatability Confirmed with:

Division of Labour https://mods.vintagestory.at/divisionoflabor 
More Class Traits https://mods.vintagestory.at/show/mod/15539 
Combat Overhaul https://mods.vintagestory.at/combatoverhaul 

Incompatible (Cannot load traits, not is unusable) with:

Gardenerz https://mods.vintagestory.at/show/mod/11187 

 

Shoutout to the TraitLearner mod for having and achieving the idea in an earlier version. I considered taking over maintenance of it but the mod system has changed so much since then it was easier to just start from scratch.
https://mods.vintagestory.at/show/mod/1119

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v0.9.6 354 6 days ago Show traitacquirer_0.9.6.zip Install now
v0.9.5 1020 Oct 9th at 3:36 PM Show traitacquirer_0.9.5.zip Install now
v0.9.4 131 Oct 7th at 4:15 PM Show traitacquirer_0.9.4.zip Install now
v0.9.3 617 Sep 18th at 12:03 PM Show traitacquirer_0.9.3.zip Install now
v0.9.2 757 Aug 13th at 1:04 PM Show traitacquirer_0.9.2.zip Install now

39 Comments (oldest first | newest first)

💬 ArkhaelAuthor, 2 days ago

TheDanleyParable
That's an interesting sounding bug. I'll try and see if I can reproduce it, can you submit a screenshot of the manuals you can't pick up to the issue tracker at the top of the page so I know what I'm looking for.
Edit: I've figured out what causes this, when a stack randomizer resolves with a quantity of 0 I had assumed the game simply wouldn't spawn the item, instead it does this thing where it spawns the item but with a quantity of 0 so it disappears when you interact with it. I've fixed the default configuration so this won't happen in future updates but for now to prevent this happening in your game you need to set the "manualsVarLoot" element in the mod config file to 0. This won't fix any already generated loot but will prevent newly generated chunks from having this issue

💬 TheDanleyParable, 2 days ago

Hey, I can't seem to pick up the trait books... I keep finding them in structures, but they always have a 0 amount and cannot be picked up? how am i supposed to add them to my character?

💬 Bobosaw, 3 days ago

Arkhael

Oh ok. I'll definitely try that as soon as I get the chance. Thanks for the advice.

💬 ArkhaelAuthor, 4 days ago

Bobosaw

Trait codes are case sensitive and are usually the name of the trait in lower or camel case. To find out what the code is for any trait, and which traits have been loaded correctly from other mods, use the handbook page for the trait you want. In the next update I'll improve the error messages from the commands to make it more clear what went wrong and what you might need to do instead.
I have tested for you that Combat Overhaul and More Class Traits both work, as well as Division of Labour, I'll perhaps expand that list in future but there's very little reason it wouldn't be compatible and the only mod I know isn't is Gardenerz

💬 Bobosaw, 4 days ago

Arkhael

Hey dude. It is a class trait I'm trying to remove. Thanks for the info. Looking forward to more updates! Btw, can you add traits from other mods such as the Combat Overhaul mod and the More Class Trait mod? Is there a specific command for that because my attempts to add them are not bearing any fruit.

💬 ArkhaelAuthor, 4 days ago

pudgydumpling

Division of Labour is setup correctly to work with the mod, to use a trait manual hold down right click for longer than 2 seconds. If that doesn't work use the issue tracker and submit your full modlist along with the report.

💬 pudgydumpling, 4 days ago

I found a loot spawned tailoring trait book but it doesn't seem to work when I try to read it - it just does nothing. I'm on 1.20 rc.4 with Division of Labor as a lumberjack, so I suspect that being a modded class is the issue. Is there any known fix for this?

💬 ArkhaelAuthor, 4 days ago

Ijkdenem

Commoners can get traits from the mod and the current items the mod adds provide a way to acquire all of the unique crafting recipes. If playing as a class with traits you can't remove any of the class traits at present but the additional traits will stack with the class ones allowing you to get even more effects. Any other mod that adds traits to the game will also work (For example: https://mods.vintagestory.at/show/mod/15539) but only if it patches the traits.json config file.

💬 Ijkdenem, 4 days ago

can commoners get traits? 

💬 ArkhaelAuthor, 4 days ago

Bobosaw

I can certainly try. Is the trait in question a class trait? If so the mod currently cannot remove those, it can only remove traits that have been added by the mod. If not can you use the issue tracker, linked at the top of this page to submit a screenshot of the traits tab so I have some info to debug off of.

💬 Bobosaw, 5 days ago

For some reason I cannot remove traitsa despite the message saying "Trait Removed" appearing. Any help with this?

💬 ArkhaelAuthor, 6 days ago

Thank you for your patience friends, the handbook update is now complete along with the fixes. In future perhaps I should avoid being too specific with dates if it's going to take me several times longer than I say to do anything.

ComradeTum

I've made some attempts to re-create this issue with server testing and I did manage something similar once. I have some ideas as to what the issue could be and hopefully my improvements to how the attributes are applied has done the job but if not I need some more information from you.

Firstly, if you can get me the log from an actual crash that'd be a great help, I'll set up an issue tracker for this sort of thing as soon as I can.
Secondly, I wanted to ask how consistent this is when players use the items and if it has ever happened as a result of the command.

💬 ComradeTum, Nov 17th at 2:23 PM

Love this mod, a definite must have. Seems to work fine in my SP games but when Ive added it to a 1.19.8 server players readyling the trait books get a CTD and the stack trace seems to be release to a collection being modified while read.

 

I understand that you've got a lot going on so I'm happy to wait for you to have free time and the inclination to work on this more, just thought I'd let you know what I saw in the logs.

 

💬 propaneko, Nov 10th at 10:26 AM

I closed PR just because of me being stupid and I was still working on the mod on the same branch I wanted to push fixes for yours. So now it would change too much with your mod. But glad to hear you're back, and that you gonna push some fixes soon ^^

💬 ArkhaelAuthor, Nov 7th at 4:48 PM

propaneko Rhayvhenn SalazarWindriver

Apologies for the disappearing act, a combination of a death in the family and the Factorio expansion releasing isn't condusive to me spending much time in social spaces.
To answer all the comments in chronological order:

Propaneko: I'll send you my discord via Github, thank you for the contribution. Stacking traits was implemented in 0.9.4, your mod fork seems to revert some of what made that work, either way I'll double check again when I go hunting all these bugs. Not quite sure what exactly you mean by "all the traits seems not to make any effect, only after applying class it works" all the methods the mod give to add traits should (assuming I didn't miss anything) only add traits when they can be applied and then apply them immediately after, if something is going wrong with the application still I'll hunt it down

Rhayvhenn: Thanks for trying the mod, I'll see what I can do to get that one. If possible can you confirm if Propaneko's fork fixed that for you or not?

SalazarWindriver: Vintage Story's logs are good but not all powerful so there's probably nothing you can do to get me anything useful as it's probably an issue with the variable states. My guess is that the difference in the way I've been applying the traits between versions has messed something up in your game state as far as the mod works. No need to worry it won't break the game in any way, I'll add something in the next update to ensure the variable is properly rebuilt on startup. Alternatively what's been happening with you could be some odd mod conflict as I've tried a few times and never been able to replicate this problem so if you could drop your modlist here I'd appreciate it and will take a look-see for potential issues.

ETA on fixes: A few days

ETA on Handbook update: Possibly at the same time as fixes, maybe a day or two more.

I may also set up a proper issue tracker so I can keep on top of all of this.

Thanks for your patience.

💬 propaneko, Nov 6th at 2:22 PM
💬 SalazarWindriver, Nov 3rd at 8:49 PM

so I was able to get the tailor-specific recipe to work. but I just tried to repair a translocator with the technical but it cost me 3 gears which I believe I had working at one point after getting all of them. It's very weird how it keeps changing and I'm not sure there is any way to get a log of what it is doing since it is not crashing.

💬 Rhayvhenn, Nov 3rd at 2:21 PM

propaneko Im having the same issue. Found this mod, seeing it could solve my single player fashion issues, and then hits me with the "An Exception was throwing in while executing this command".
You said you have a workaround, would you be down to share?

💬 propaneko, Nov 3rd at 11:12 AM

Hi there, is there any chance I could contact you on discord? We're trying to figure out your mod and we have some small issues with it. Also will post a small PR for your mod on github as it fixes errors that occures when using commands. If not... any ETA for the stacking trait mechanism being pushed here or on the github? Also all the traits seems not to make any effect, only after applying class it works.

💬 Blackmare, Oct 7th at 3:29 PM

Arkhael Sweet!

SalazarWindriver What Arkhael said. You can have the 4 books provided by this mod, my issue was my expansion to the system where I ran into issues.

💬 ArkhaelAuthor, Oct 7th at 9:52 AM

SalazarWindriver

Class crafting traits will all work together, as will the Technical trait, it's just stat traits that don't stack for the moment. It's actually already fixed on my end I'm just still working on the trait exclusivity, the game is set up to handle it just fine but the game stores the effect to a stat under the name "trait" which overrides every time a trait affects that stat, just had to give them all a unique name.

I did a quick test to confirm that the mod works with the Tailor's Delight crafting recipes and it did on my end, check to be sure you've used the book and have the trait in the Character Traits tab.

💬 SalazarWindriver, Oct 7th at 1:59 AM

So, if I'm reading the last 2 comments correctly, only one class trait at a time?  I have 4 traits and, starting with the clothier trait, I can't seem to make the flax twine with the wooden spindle.  is there a way to make it so you can have all the traits active?  if not is there a way to keep the books and only show what trait is active?

💬 ArkhaelAuthor, Oct 3rd at 8:40 AM

Blackmare

No there isn't, but I can add it as a feature. I'll also make the stat applications cumulative as that's gonna be a requirement if all traits are by default non-exclusive.

💬 Blackmare, Oct 2nd at 2:25 PM

Arkhael is there any way to prevent the use of a book if they already have a different trait? Realized that the trait system isnt cumulative but rather it takes the latest effect.

💬 ArkhaelAuthor, Sep 30th at 9:02 AM

Blackmare

Glad it worked out, I check in on the page every now and again so feel free to share any more issues you may have here.

The item randomiser is a great idea, tbh adding them to the gear randomizer was very much a stopgap measure so they're acquirable through exploration somehow. The eventual plan is their own set of custom ruins for the class ones, rarely from the trader and an option to craft them bound to each class for servers. Still, the idea behind the mod is flexibility for others to do fun stuff like you are as my time and ideas are ultimately limited.

💬 Blackmare, Sep 30th at 5:11 AM

@Arkhael you are not wrong in the trouble shooting being a pain haha

Somehow it got fixed. I want to say it was the lowercasing of all my stuff that fixed it. However I'm not super certain as I tried like 5 different ideas all at once. But now it works and is doing everything I needed on 1.20! Got them in traders and created a new scrapweaponkit type item so that my 400 or so traits dont create a huge burden on the gear randomizer haha.

💬 ArkhaelAuthor, Sep 29th at 8:34 AM

Blackmare

Hey Blackmare, glad to see you're having fun making your own items, it can be a bit of a pain to troubleshoot by yourself so I'll try my best to help you out.

From the sets you've shared below the only difference I can see is that the former has an "i" at the end of "animalharvestingspeed" that the latter doesn't. Which is correct will depend on how you've set the "variantgroups" element up.

As for the black square thing, I have no idea what's up from just that much information, only thing I can tell is that it isn't an unloaded item as they come out as white cubes with a red question mark.

Is the issue with the restart consistent? If not, next time it happens go to the logs folder "AppData\Roaming\VintagestoryData\Logs" and copy the text files in there to somewhere else to preserve them as they're refreshed every time you load a world

Are your items patched into the trader's buy or sell lists? If not then them not recognising them is expected behaviour

If you want to catch me to chat and try and sort this out I'm usually active in the Solstin discord so if you show up there and holler I'll likely notice

💬 Blackmare, Sep 27th at 5:18 PM

New issue I'm running into where my items just become a black square after a restart and are not recognized by traders.

 

If you happen to have some time to chat let me know as everything seems to be done correctly both as a patch and as a wholely new item using the class but both are giving me the same result.


Interesting addition after trying a couple of things i thought might be the issue, i found that these two sets are somehow fundamentally different

"*-animalharvestingspeedi": {
"traitdata": {
"add": [ "animalHarvestingSpeedI" ],
"remove": []
}
},

"*-animalharvestingspeed": {
"traitdata": {
"add": [ "animalHarvestingSpeedI" ],
"remove": []
}
},

The first one being my own written out addition and the second being a copy and paste of your hunter and replacing it with the animal harvesting speed information.

which gives me a path for a fix on my end, albeit a slow one but just thought I'd let you know something wonky is occuring.

💬 Blackmare, Sep 26th at 5:48 PM

Figured it out! I had to patch out the default to make my choices show up instead

"*": {
"all": {"base": "game:item/lore/{type}"}
}




{

"op": "add",
"path": "/texturesByType/*-walkspeed*",
"value": {
"cover": {
"base": "game:item/lore/normal-teal"
}
},
"file": "traitacquirer:itemtypes/utility/trait-manual.json"
},

 

I'm running into an issue patching traitacquierer. My patch currently is allowing my books to show up and will give traits but they arent chaning to the book type I have marked. Do you happen to know why that might be?

It works fine if I edit the traitacquirer files directly so unsure why the patch isnt working

💬 ArkhaelAuthor, Sep 23rd at 12:49 AM

Sylvi

There are no separate commands to remove traits, both of the commands to add traits can be used to remove traits you just have to add the optional argument "rm"
Examples:
/acquiretrait frail rm
/givetrait frail Arkhael rm

💬 Sylvi, Sep 20th at 6:33 PM

Sweet, thank you much for the advice. I noticed the commands to add a trait doesn't have a reverse option that I can find, is the only way to remove the added trait with an item?

💬 ArkhaelAuthor, Sep 20th at 2:07 PM

Sylvi

Should do, there won't be any items to add them unless you make them though. Because of how classes work they're currently unmodifiable so you'll always have those traits no matter what you do with this mod so if you want custom classes the best way to do it is start with a Commoner and add all the traits you want via the mod

💬 Sylvi, Sep 19th at 4:13 PM

ah man this is awsome I've really wanted a trait buy system for custome class setups for awhile now. Its cool to have an option that doesn't just involve disabling class recipes.
Does this work with modded traits?

💬 neobit, Sep 19th at 8:36 AM

Works great. Thanks for the help.

💬 ArkhaelAuthor, Sep 18th at 12:12 PM

neobit
Thanks for the heads up about that incompatability issue, the issue was on my end as the mod hijacks the game's Traits tab the original tab isn't rendered however depending on the order the game loads things additional tabs added by other mods could in turn be taken over by the default traits tab. I have now added a step to remove the original tab at the end of the loading process so it should be compatible with any mods that add more character tabs.
As for the issue of finding the trait items, I intend to properly balance the methods to find or even create the books when I put together a 1.0 version, for now the simplest method is to buy one from a Treasure Trader.

💬 neobit, Sep 12th at 9:41 PM

Hello, I really like the idea of this mod. We started using it on our server, but still noone has found the book.
General guestion: is this compatible with Level up (mods.vintagestory.at/show/mod/11856)? I think we stopped seeing level up window after adding your mod.

 

EDIT: checked it out only with these two mods and yes, definately dont work together.

💬 dashr, Aug 18th at 2:54 PM

Arkhael That sounds really promising. Please keep this coming. It looks like this mod would fit both a modded and vanilla playstyle quite well. Imagine how much more of a progression it would give the game if you could not only find trait books like tinkerer and such, but also the likes of forager, soldier, hardy, etc. As I said, this looks pretty promising, and I hope you can bring these goals to life. To give a little example, we play on a server with Xskills and usually most people tend to use the commoner since you can already learn new skills with Xskills. But with an addition like that it would give even more progression till the endgame.

 

💬 ArkhaelAuthor, Aug 14th at 8:08 PM

@dashr I'm glad you like it, that was part of my motivation but I mainly want to add to the game's exploration loop and give me a reason to start a world without ticking the box to unlock all recipes. I haven't ever played with Xskills but it does seem a good combination to test with and may give me more ideas. I'm itching a bit to add to this but getting my debug environment to work with the config loading and making the scrollbar for the traits menu took as long as the whole rest of the mod and tired me the hell out so I'm working on somethig else that should help with my understanding of the visual code stuff, so look forward to that being next giving this some polish.

💬 dashr, Aug 13th at 2:50 PM

Idk why I never thought of this but it's perfect for a server in combination with Xskills to allow additional progression. Thank you so much for making this :)

(edit comment delete)