Project Zomboid

Project Zomboid

125 oy
Trait Tag Framework
   
Ödül
Favorilere Ekle
Favorilere Eklendi
Favorilerden Çıkar
Dosya Boyutu
Gönderilme
Güncellenme
142.491 KB
9 Haz 2023 @ 20:16
22 Oca @ 16:30
6 Değişiklik Notu ( görüntüle )

İndirmek için abone ol
Trait Tag Framework

Açıklama
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.

A message from the creator
Do you really use this mod, or even better want to build off of it? Please consider donating to me[ko-fi.com] so I can pay my bills. I'm recently unemployed and every little bit helps!

How to Use:
Declare the module before it's needed (typically at the beginning of the file) with
local 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");

Available Functions
  • ToString()
    Returns the entirety of the table and tags in a string.
  • TagTableToString(string traitName)
    Returns the tags associated with a trait as a string
  • Add(string traitName, string tags)
    Add(s) tag(s) to the TraitTags module.
    Note: For tags, use alphanumeric symbols only, and separate each tag with a comma.
  • Remove(string traitName)
    Removes a trait and all of its tags from the TraitTags module.
  • RemoveTag(string traitName, string tag)
    Removes the specified tag from the specified trait in the TraitTags module.
  • GetTable()
    Returns the entirety of the TraitTags table as a table.
  • GetTagTable(string traitName)
    Returns the table of tags associated with a trait as a table.
  • GetTagStatistics()
    Returns a string containing each tag used, and how many times they're used.
    Note: I find this helpful for balancing purposes.
  • GetPlayerTraitTags(Player player)
    Returns a string containing each tag a player has.
  • GetPlayerTagStatistics(Player player)
    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];..."
  • PlayerHasTag(Player player, string targetTag)
    Returns a boolean, which is true if the player has the targetTag.
  • PlayerTagCountLargerThan(Player player, string subjectTag, string comparatorTag)
    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).
  • GetAllTraitsWithTag(string subjectTag)
    Returns a collection of Traits that have the subject tag.

All Vanilla Traits put in .Add
Here's a list of all vanilla traits with an example name for your Trait Tags module. This will work in whatever function you add it, just add your own tags and run. (current as of build 41):
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", "");




A message from the creator
Do you really enjoy this mod--or even better--want to build on it? Please consider donating to me[ko-fi.com]! I'm in definite financial need, so every little bit helps! Thank you.

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 :)

İlk olarak Badonn tarafından gönderildi:
Please don't copy this mod and upload it as your own! Please also ask if you can use this in a mod pack. If you would like to translate the mod, send me a message or leave a comment and I'll work with you to add it in! This mod is under the MIT License.

Workshop ID: 2987177652
Mod ID: TraitTagFramework
19 Yorum
Badonn  [yaratıcı] 1 Şub @ 20:08 
@Mitchel Vories AnthroTraits uses this mod
irrelevantredundancy 1 Şub @ 13:31 
what mods use this? It got enabled on my mod list. I want to disable it but I'm not sure if it's still
being used.
Dubble 21 Oca @ 17:16 
update borked this
Ovelton 10 Oca @ 4:23 
@badonn ah ok good to know you realy do think of everything
Badonn  [yaratıcı] 2 Oca @ 21:03 
@Ovelton so other modders can use it!
Ovelton 15 Ara 2024 @ 4:32 
why is this sepret to the main mod?
Beef_taco54434 13 Haz 2024 @ 18:29 
You should add a trait called. Thick furred which give a warmth bonus and better scratch protection
G00SE_ 13 Nis 2024 @ 14:59 
update: I found a way to do it, it was stupidly easy, thanks anyway!
Badonn  [yaratıcı] 13 Nis 2024 @ 14:41 
@G00SE_ you’re correct, this mod has no functionality to remove traits from the CC menu, only label them.
G00SE_ 9 Nis 2024 @ 21:56 
if it is how to do it?