Modding:Treasure Tables: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(explained a treasure table)
mNo edit summary
Line 15: Line 15:
The second line looks much more confusing, but isn't. Every item within a table needs a subtable. If you want 1 potion of healing that's guaranteed to be in the treasure table, it would still need its own subtable. So, with that in mind, a subtable is created. The numbers within the quotation marks denote the weights for how many times the table will be rolled- As an example, the weights for this table start with "10,1", so, with a weight of 1 (equal to everything else in the table), this table could be rolled 10 times. That means we would get 10 of whatever is listed in the table below. Each subsequent numbered pair denotes another quantity & weight pair- "11,1" means there is a weight of 1 that the table will be rolled 11 times, and so on.
The second line looks much more confusing, but isn't. Every item within a table needs a subtable. If you want 1 potion of healing that's guaranteed to be in the treasure table, it would still need its own subtable. So, with that in mind, a subtable is created. The numbers within the quotation marks denote the weights for how many times the table will be rolled- As an example, the weights for this table start with "10,1", so, with a weight of 1 (equal to everything else in the table), this table could be rolled 10 times. That means we would get 10 of whatever is listed in the table below. Each subsequent numbered pair denotes another quantity & weight pair- "11,1" means there is a weight of 1 that the table will be rolled 11 times, and so on.


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 number of items- so, if it were a 10 instead, each time the table was rolled, it would give 10 gold. Therefore, if the table was decided to be rolled 11 times in the previous step, you would get 110 gold. In this case, you would only get 11. The 1 is followed by 7 zeros. Every example I can find always has these zeros- they just seem to be necessary for the code to work and don't seem to mean much.<table class="sidebar nomobile nowraplinks"><tr><th class="sidebar-title">bg3.wiki modding</th></tr><tr><th class="sidebar-heading">
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 number of items- so, if it were a 10 instead, each time the table was rolled, it would give 10 gold. Therefore, if the table was decided to be rolled 11 times in the previous step, you would get 110 gold. In this case, you would only get 11. The 1 is followed by 7 zeros. Every example I can find always has these zeros- they just seem to be necessary for the code to work and don't seem to mean much.<templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Sidebar/styles.css"></templatestyles><div class="navbox-styles"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbox/styles.css"></templatestyles></div><div role="navigation" class="navbox" aria-labelledby="Modding_homepage" style="padding:3px"><table class="nowraplinks mw-collapsible expanded navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tr><th scope="col" class="navbox-title" colspan="2"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbar/styles.css"></templatestyles><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view">[[Template:Modding navbox|<abbr title="View this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">v</abbr>]]</li><li class="nv-talk">[[Template talk:Modding navbox|<abbr title="Discuss this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">t</abbr>]]</li><li class="nv-edit">[[Special:EditPage/Template:Modding navbox|<abbr title="Edit this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">e</abbr>]]</li></ul></div><div id="Modding_homepage" style="font-size:114%;margin:0 4em">[[Modding:Modding resources|Modding homepage]]</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding homepage</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
Modding homepage</th></tr><tr><td class="sidebar-content hlist">
* [[Modding:Modding resources|Modding resources]]</td>
</tr><tr><th class="sidebar-heading">
Modding resources - Meshes, Models, Tools, etc.</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding resources</categorytree></div></td>
</tr><tr><th class="sidebar-heading">
Modding guides</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding guides</categorytree></div></td>
</tr><tr><th class="sidebar-heading">
Hair modding</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Hair modding</categorytree></div></td>
</tr><tr><th class="sidebar-heading">
Head modding</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Head modding</categorytree></div></td>
</tr><tr><th class="sidebar-heading">
Item modding - Armours, Outfits, Weapons etc.</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Armor modding</categorytree></div></td>
</tr><tr><th class="sidebar-heading">
Race/class modding</th></tr><tr><td class="sidebar-content hlist">
<div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Race and class modding</categorytree></div></td>
</tr><tr><td class="sidebar-navbar"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbar/styles.css"></templatestyles><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view">[[Template:Modding sidebar|<abbr title="View this template">v</abbr>]]</li><li class="nv-talk">[[Template talk:Modding sidebar|<abbr title="Discuss this template">t</abbr>]]</li><li class="nv-edit">[[Special:EditPage/Template:Modding sidebar|<abbr title="Edit this template">e</abbr>]]</li></ul></div></td></tr></table>
<templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Sidebar/styles.css"></templatestyles><table class="sidebar sidebar-collapse nomobile nowraplinks"><tr><th class="sidebar-title">bg3.wiki modding</th></tr><tr><th class="sidebar-heading">
Modding namespace</th></tr><tr><td class="sidebar-content">
<div class="sidebar-list mw-collapsible mw-collapsed hlist"><div class="sidebar-list-title">Modding</div><div class="sidebar-list-content mw-collapsible-content">
* [[Modding:Modding resources|Modding resources]]</div></div></td>
</tr><tr><td class="sidebar-content">
<div class="sidebar-list mw-collapsible mw-collapsed hlist"><div class="sidebar-list-title">Modding resources</div><div class="sidebar-list-content mw-collapsible-content"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding resources</categorytree></div></div></div></td>
</tr><tr><td class="sidebar-content">
<div class="sidebar-list mw-collapsible mw-collapsed hlist"><div class="sidebar-list-title">Modding guides</div><div class="sidebar-list-content mw-collapsible-content"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding guides</categorytree></div></div></div></td>
</tr><tr><td class="sidebar-navbar"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbar/styles.css"></templatestyles><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view">[[Template:Modding sidebar|<abbr title="View this template">v</abbr>]]</li><li class="nv-talk">[[Template talk:Modding sidebar|<abbr title="Discuss this template">t</abbr>]]</li><li class="nv-edit">[[Special:EditPage/Template:Modding sidebar|<abbr title="Edit this template">e</abbr>]]</li></ul></div></td></tr></table>
<div class="navbox-styles"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbox/styles.css"></templatestyles></div><div role="navigation" class="navbox" aria-labelledby="Modding_homepage" style="padding:3px"><table class="nowraplinks mw-collapsible expanded navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tr><th scope="col" class="navbox-title" colspan="2"><templatestyles src="Hlist/styles.css"></templatestyles><templatestyles src="Module:Navbar/styles.css"></templatestyles><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view">[[Template:Modding navbox|<abbr title="View this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">v</abbr>]]</li><li class="nv-talk">[[Template talk:Modding navbox|<abbr title="Discuss this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">t</abbr>]]</li><li class="nv-edit">[[Special:EditPage/Template:Modding navbox|<abbr title="Edit this template" style=";;background:none transparent;border:none;box-shadow:none;padding:0;">e</abbr>]]</li></ul></div><div id="Modding_homepage" style="font-size:114%;margin:0 4em">[[Modding:Modding resources|Modding homepage]]</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding homepage</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
* [[Modding:Modding resources|Modding homepage]]
* [[Modding:Modding resources|Modding homepage]]
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding resources - Meshes, Models, Tools, etc.</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding resources</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding guides</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding guides</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Hair modding</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Hair modding</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Head modding</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Head modding</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Item modding - Armours, Outfits, Weapons etc.</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Armor modding</categorytree></div></div></td></tr></table></div>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding resources - Meshes, Models, Tools, etc.</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding resources</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Modding guides</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Modding guides</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Hair modding</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Hair modding</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Head modding</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Head modding</categorytree></div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Item modding - Armours, Outfits, Weapons etc.</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"><div class="navcat";><categorytree hideprefix="1" hideroot="1" mode="pages">Armor modding</categorytree></div></div></td></tr></table></div>

Revision as of 18:43, 14 August 2024

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.

Let's look at an excerpt from one of the TreasureTable.txt files in the game:

new treasuretable "Gold_Pocket_Wealthy"

new subtable "10,1;11,1;12,1;13,1"

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 second line looks much more confusing, but isn't. Every item within a table needs a subtable. If you want 1 potion of healing that's guaranteed to be in the treasure table, it would still need its own subtable. So, with that in mind, a subtable is created. The numbers within the quotation marks denote the weights for how many times the table will be rolled- As an example, the weights for this table start with "10,1", so, with a weight of 1 (equal to everything else in the table), this table could be rolled 10 times. That means we would get 10 of whatever is listed in the table below. Each subsequent numbered pair denotes another quantity & weight pair- "11,1" means there is a weight of 1 that the table will be rolled 11 times, and so on.

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 number of items- so, if it were a 10 instead, each time the table was rolled, it would give 10 gold. Therefore, if the table was decided to be rolled 11 times in the previous step, you would get 110 gold. In this case, you would only get 11. The 1 is followed by 7 zeros. Every example I can find always has these zeros- they just seem to be necessary for the code to work and don't seem to mean much.