Jump to content

Trait Training Books


Recommended Posts

Just finished putting together my first proper mod for Project Zomboid (The first one I made was just a minor edit to some vanilla code for some XP values).




Trait Training Books



What does it do?

Trait Training Books adds a series of books to the game that can be used to learn traits in a ladder like system of progress.

Currently the mod is only in initial release so at the moment there are only books in the game to handle the reading line of traits.


An example of how it works in game

If your character has the "illiterate" trait, they have the option of trying to find the TTB book related to the Illiterate trait, in this case named "Burch and Friends - Let's Read Together!".

If the character has the illiterate trait, when they right click the book in their inventory or another container they will see an option in the context menu for "Struggle to Read".

When selected, the player will start reading through the pages of the book in the same way you would read any other skill book. When completed, the Illiterate trait is removed from your character and replaced with the Slow Reader trait.


But how can you read if you're illiterate?

The mod uses a custom class that is based off the ISReadABook class used to read books in order to specifically handle trait books through an action that is on the surface functionally identical to reading, making use of pages and starting and stopping reading as any other literature item in the game would do. This was to work around some of the restrictions surrounding reading timed actions that would typically fail read attempts with the native read class.



I'm still pretty new to modding with PZ so I wasn't able to find a way to request the server value for DayLength which was originally the idea I was thinking of to try and make a variable timer for reading so that the same mod could be used on various server or SP configurations without becoming too impractical at either extreme of DayLengths, so that's something I may try to get in when I learn more about what's availiable to me in LUA and if I can get the DayLength from the server.

Until then though, this mod is specifically balanced for use on Real-Time multiplayer servers or Real-Time SP games.

Reason being I designed this primarily for use on my own MP server but it can still work in SP games or other MP games as long as you're aware of some balancing issues with the books being 25, 50 and 75 pages.

The books are a rare find, with a loot distribution of 0.3, 0.2 and 0.1 in Shelves, 0.5, 0.3 and 0.1 in bookstores and then 1.0, 1.0 and 0.5 inside schoolbags for the basic, intermediate and advanced books respectively. (For comparison, books in Hydrocraft have a 1.0 loot distribution)

So these should be pretty rare finds, combined with how they are consumed on use it should hopefully keep things fairly balanced.


Future Plans

  1. I'm hoping to tinker around with the hobby traits over the next few days and get to grips with how the game handles them on characters, once I work things out there I'm going to start looking at getting in books that can be used to learn other positive traits or remove/lessen negative traits.
  2. I also want to look into seeing if it's possible to implement some usage of the leveling and skillpoint system in the game, so that reading a book may require you have a skill point available that would be consumed when learning or removing a trait with the book.
  3. Figure out a way to adapt the time taken to read pages of these books based on the DayLength setting for the server or SP game.


  • Robert Johnson for the original ISReadABook.lua class that was used as the basis for TTB's reading class.
  • BryBry for help in finding a way to refresh the character's info window to display the updated trait window without requiring a relog.
Link to comment
Share on other sites

Working on an update for it now, friend of mine offered to do sprite art for the mod so going to start getting that in.

Also working on some additional trait books for it, I need to start experimenting with the hobby traits to see how those are handled if added after character creation.

So update will either be today or tomorrow depending on any complications I run into.



This is great especially if set on rare and if its made to teach the jobs specialized trait like axe man etc :))) have to make this extremely hard to find in game

I would love to get Axe Man in, it was one I was thinking about how to go about it.

Maybe a certain requirement in Blade Accuracy and Maintenance and the player's favourite weapon being Axe?

Will have to poke around to see what kind of information I can pull about a player via Lua and how exactly fav weapons work so it isn't unusable for SP, if that doesn't work out could always go based off requiring an axe to be equipped or something.

Link to comment
Share on other sites

I would love a book that taught me how to be more organized. I took Disorganized before realising how bad it was, but I'm too devoted to my character to just start over. Would be nice if there was some kind of cost though. Otherwise people will jusr collect the books and make characters with those negative traits for free points.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...