A Project Zomboid framework for adding user-defined strings correlating to player traits. Trait tags are stored in a table accessed by a module and has built-in functions.
Do you really enjoy this mod, or even better want to build off of it? Please consider donating to me so I can pay my bills. I'm recently unemployed and every little bit helps! Declare the module before it's needed (typically at the beginning of the file) withlocal TTF = require("TraitTagFramework");
Depending on your use case, you'll want to add your tags before the player is created. To do this, make a function that gets added to the OnGameBoot event with
Events.OnGameBoot.Add([your function here])
If you're creating new traits, feel free to mingle your trait and tag declarations together, like so:
local AT_Carpenter = TraitFactory.addTrait("AT_Carpenter", getText("UI_trait_AT_Carpenter"), 2, getText("UI_trait_AT_Carpenter_desc"), false);
AT_Carpenter:addXPBoost(Perks.Woodwork, 1)
TTF.Add("AT_Carpenter", "Anthro,HabitatBuilder");
- Returns the entirety of the table and tags in a string.
- Returns the tags associated with a trait as a string
-
Add(s) tag(s) to the TraitTags module.
Note: For tags, use alphanumeric symbols only, and separate each tag with a comma. - Removes a trait and all of its tags from the TraitTags module.
- Removes the specified tag from the specified trait in the TraitTags module.
- Returns the entirety of the TraitTags table as a table.
- Returns the table of tags associated with a trait as a table.
-
Returns a string containing each tag used, and how many times they're used.
Note: I find this helpful for balancing purposes. -
Returns a string containing each tag a player has.
-
Returns a string containing each tag and the amount(count) of each the player has. This list in the string is ordered by count.
String format: "[tag]: [count]; [tag]: [count];..." - Returns a boolean, which is true if the player has the targetTag.
-
Returns a boolean, which is true only if the subjectTag's count is larger than the comparatorTag's count.
Note: This will also return false if one of the tags cannot be found (with a console print warning of a nil if debug mode is on). - Returns a collection of Traits that have the subject tag.
TTF.add("Axeman", "");
TTF.add("Handy", "");
TTF.add("SpeedDemon", "");
TTF.add("SundayDriver", "");
TTF.add("Brave", "");
TTF.add("Cowardly", "");
TTF.add("Clumsy", "");
TTF.add("Graceful", "");
TTF.add("ShortSighted", "");
TTF.add("HardOfHearing", "");
TTF.add("Deaf", "");
TTF.add("KeenHearing", "");
TTF.add("EagleEyed", "");
TTF.add("HeartyAppitite", "");
TTF.add("LightEater", "");
TTF.add("ThickSkinned", "");
TTF.add("Unfit", "");
TTF.add("Out of Shape", "");
TTF.add("Fit", "");
TTF.add("Athletic", "");
TTF.add("Nutritionist", "");
TTF.add("Nutritionist2", "");
TTF.add("Emaciated", "");
TTF.add("Very Underweight", "");
TTF.add("Underweight", "");
TTF.add("Overweight", "");
TTF.add("Obese", "");
TTF.add("Strong", "");
TTF.add("Stout", "");
TTF.add("Weak", "");
TTF.add("Feeble", "");
TTF.add("Resilient", "");
TTF.add("ProneToIllness", "");
TTF.add("Agoraphobic", "");
TTF.add("Claustophobic", "");
TTF.add("Lucky", "");
TTF.add("Unlucky", "");
TTF.add("Marksman", "");
TTF.add("NightOwl", "");
TTF.add("Outdoorsman", "");
TTF.add("FastHealer", "");
TTF.add("FastLearner", "");
TTF.add("FastReader", "");
TTF.add("AdrenalineJunkie", "");
TTF.add("Inconspicuous", "");
TTF.add("NeedsLessSleep", "");
TTF.add("NightVision", "");
TTF.add("Organized", "");
TTF.add("LowThirst", "");
TTF.add("Burglar", "");
TTF.add("FirstAid", "");
TTF.add("Fishing", "");
TTF.add("Gardener", "");
TTF.add("Jogger", "");
TTF.add("SlowHealer", "");
TTF.add("SlowLearner", "");
TTF.add("SlowReader", "");
TTF.add("NeedsMoreSleep", "");
TTF.add("Conspicuous", "");
TTF.add("Disorganized", "");
TTF.add("HighThirst", "");
TTF.add("Illiterate", "");
TTF.add("Insomniac", "");
TTF.add("Pacifist", "");
TTF.add("Thinskinned", "");
TTF.add("Smoker", "");
TTF.add("Tailor", "");
TTF.add("Dextrous", "");
TTF.add("AllThumbs", "");
TTF.add("Desensitized", "");
TTF.add("WeakStomach", "");
TTF.add("IronGut", "");
TTF.add("Hemophobic", "");
TTF.add("Asthmatic", "");
TTF.add("Cook", "");
TTF.add("Cook2", "");
TTF.add("Herbalist", "");
TTF.add("Brawler", "");
TTF.add("Formerscout", "");
TTF.add("BaseballPlayer", "");
TTF.add("Hiker", "");
TTF.add("Hunter", "");
TTF.add("Gymnast", "");
TTF.add("Mechanics", "");
TTF.add("Mechanics2", ""); Special thanks to the Project Zomboid discord modding community for their tireless answering of my questions. Particular thanks to Albion, who has a seemingly encyclopedic knowledge of PZ properties, functions, and modding. You helped a lot :)