-
Notifications
You must be signed in to change notification settings - Fork 0
/
SteamDesc.txt
142 lines (136 loc) · 5.65 KB
/
SteamDesc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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.
[h1]A message from the creator[/h1]
Do you really use this mod, or even better want to build off of it? Please consider [url=https://ko-fi.com/badonnthedeer]donating to me[/url] so I can pay my bills. I'm recently unemployed and every little bit helps!
[h1]How to Use:[/h1]
Declare the module before it's needed (typically at the beginning of the file) with
[code]local TTF = require("TraitTagFramework");[/code]
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
[code]Events.OnGameBoot.Add([your function here])[/code]
If you're creating new traits, feel free to mingle your trait and tag declarations together, like so:
[code]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)
[b]TTF.Add("AT_Carpenter", "Anthro,HabitatBuilder");[/b][/code]
[h1]Available Functions[/h1]
[list]
[*][h3]ToString()[/h3]
Returns the entirety of the table and tags in a string.
[*][h3]TagTableToString(string traitName)[/h3]
Returns the tags associated with a trait as a string
[*][h3]Add(string traitName, string tags)[/h3]
Add(s) tag(s) to the TraitTags module.
[b]Note: For tags, use alphanumeric symbols only, and separate each tag with a comma.[/b]
[*][h3]Remove(string traitName)[/h3]
Removes a trait and all of its tags from the TraitTags module.
[*][h3]RemoveTag(string traitName, string tag)[/h3]
Removes the specified tag from the specified trait in the TraitTags module.
[*][h3]GetTable()[/h3]
Returns the entirety of the TraitTags table as a table.
[*][h3]GetTagTable(string traitName)[/h3]
Returns the table of tags associated with a trait as a table.
[*][h3]GetTagStatistics()[/h3]
Returns a string containing each tag used, and how many times they're used.
Note: I find this helpful for balancing purposes.
[*][h3]GetPlayerTraitTags(Player player)[/h3]
Returns a string containing each tag a player has.
[*][h3]GetPlayerTagStatistics(Player player)[/h3]
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];..."
[*][h3]PlayerHasTag(Player player, string targetTag)[/h3]
Returns a boolean, which is true if the player has the targetTag.
[*][h3]PlayerTagCountLargerThan(Player player, string subjectTag, string comparatorTag)[/h3]
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).
[*][h3]GetAllTraitsWithTag(string subjectTag)[/h3]
Returns a collection of Traits that have the subject tag.
[/list]
[h1]All Vanilla Traits put in .Add[/h1]
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", "");
[h1]Credits[/h1]
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 :)
Workshop ID: 2987177652
Mod ID: TraitTagFramework