9
editsAd placeholder
Modding:Treasure Tables: Difference between revisions
Jump to navigation
Jump to search
m
no edit summary
ArousalMax (talk | contribs) (finished describing all I know about Treasure Tables.) |
ArousalMax (talk | contribs) mNo edit summary |
||
Line 2: | Line 2: | ||
<templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Sidebar/styles.css"></templatestyles> | <templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Sidebar/styles.css"></templatestyles> | ||
I'm learning what I'm doing as I go and creating this page to help others learn what they're doing in the future. I won't take offense if it's deleted, I'm not sure if this wiki is the right place for this. Also, for the time being, take everything with a grain of salt. I very well could be wrong. | Disclaimer: I'm learning what I'm doing as I go and creating this page to help others learn what they're doing in the future. I won't take offense if it's deleted, I'm not sure if this wiki is the right place for this. Also, for the time being, take everything with a grain of salt. I very well could be wrong. | ||
== Treasure Tables == | |||
One of the many types of text files crucial to a mod maker's toolkit are Treasure Tables. Treasure Tables define all inventories in the game- what is in them, and what could be. All chests, traders, and corpses use treasure tables to define their loot. For mods adding items, the main way for them to appear in game is to add them to one treasure table or another. Most commonly, mods that add items just for the sake of it add their items to the tutorial chest, a cartilaginous chest found on the Nautiloid. This page goes over the basics of treasure tables. | One of the many types of text files crucial to a mod maker's toolkit are Treasure Tables. Treasure Tables define all inventories in the game- what is in them, and what could be. All chests, traders, and corpses use treasure tables to define their loot. For mods adding items, the main way for them to appear in game is to add them to one treasure table or another. Most commonly, mods that add items just for the sake of it add their items to the tutorial chest, a cartilaginous chest found on the Nautiloid. This page goes over the basics of treasure tables. | ||
=== Example 1 === | |||
Let's look at an excerpt from one of the TreasureTable.txt files in the game: | Let's look at an excerpt from one of the TreasureTable.txt files in the game: | ||
'''new treasuretable "Gold_Pocket_Wealthy"''' | '''new treasuretable "Gold_Pocket_Wealthy"''' | ||
Line 15: | Line 15: | ||
'''object category "Gold",1,0,0,0,0,0,0,0''' | '''object category "Gold",1,0,0,0,0,0,0,0''' | ||
The first line, in a rather self explanatory manner, creates a new treasure table named "Gold_Pocket_Wealthy" | The first line, in a rather self explanatory manner, creates a new treasure table named "Gold_Pocket_Wealthy" | ||
Line 24: | Line 22: | ||
The final line, much like the first, is pretty self explanatory. the "object category" that it begins with is necessary for all items within a subtable- it doesn't mean much to us, since it always stays the same, but it means a lot to the code. "Gold" quite obviously means Gold, the game's currency. The 1 is the weight of that item WITHIN the table- so, if there were multiple items, each would have those odds of being picked. If there were gold listed, with a weight of 1, and a potion of healing, with a weight of 2, each time the table was rolled, gold would have a 1/3 chance of being picked, while potions of healing would have a 2/3 chance of being picked. So, if you got a 13 when rolling the table, 2/3 of the time you would get 13 health potions, and 1/3 of the time you would get 13 gold. | The final line, much like the first, is pretty self explanatory. the "object category" that it begins with is necessary for all items within a subtable- it doesn't mean much to us, since it always stays the same, but it means a lot to the code. "Gold" quite obviously means Gold, the game's currency. The 1 is the weight of that item WITHIN the table- so, if there were multiple items, each would have those odds of being picked. If there were gold listed, with a weight of 1, and a potion of healing, with a weight of 2, each time the table was rolled, gold would have a 1/3 chance of being picked, while potions of healing would have a 2/3 chance of being picked. So, if you got a 13 when rolling the table, 2/3 of the time you would get 13 health potions, and 1/3 of the time you would get 13 gold. | ||
=== Example 2 === | |||
Let's look at one more example that showcases a few different concepts: | Let's look at one more example that showcases a few different concepts: | ||