Template:EncounterTable/doc: Difference between revisions

Created page with " Helper Template for formatting encounter tables. This automatically calculates chance provided weights. Each argument is one row, represented by <code>{{Template:EncounterT..."
 
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Doc/start}}
Helper Template for formatting encounter tables. This automatically calculates chance provided weights.
Helper Template for formatting encounter tables. This automatically calculates chance provided weights.
Each argument is one row, represented by <code>{{[[Template:EncounterTable/Row]]}}</code>. It has four named arguments, but two are exclusive to each other.
It takes one named parameter:
==Parameters==
==Parameters==
{|class = "wikitable"
!Parameter
!Description
|-
|roll
|indicates how weight will be calculated.
* <code>once</code> (default) will calculate chance by the total sum of weights as if rolling from the table only once.
* <code>each</code> will calculate chance as if rolling for each item down the list (weight/100).
|}
==Row Parameters==
Each unnamed argument is one row, represented by <code>{{[[Template:EncounterTable/Row|EncounterTable/Row]]}}</code>. It has four named arguments, but two are exclusive to each other.
{|class = "wikitable"
{|class = "wikitable"
!Parameter
!Parameter
Line 11: Line 23:
|-
|-
| table
| table
|if the item is chosen from another table, use this instead. The table name should be formatted <code>MainTableType#Table Name</code>. Cannot be used if item is specified.
|if the item is chosen from another table, use this instead. Cannot be used if item is specified.
|-
|-
| quantity
| quantity
Line 22: Line 34:
==Example==
==Example==
<pre>
<pre>
{{EncounterTable
{{EncounterTable|roll=once
|{{EncounterTable/Row|table=Junk#Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk#Junk 0R|weight=5}}
|{{EncounterTable/Row|table=Junk 0R|weight=5}}
|{{EncounterTable/Row|item=torch|quantity=2d3|weight=10}}
|{{EncounterTable/Row|item=copper nugget|quantity=4d3|weight=10}}
}}
</pre>
{{EncounterTable|roll=once
|{{EncounterTable/Row|table=Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk 0R|weight=5}}
|{{EncounterTable/Row|item=torch|quantity=2d3|weight=10}}
|{{EncounterTable/Row|item=copper nugget|quantity=4d3|weight=10}}
}}
 
<pre>
{{EncounterTable|roll=each
|{{EncounterTable/Row|table=Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk 0R|weight=5}}
|{{EncounterTable/Row|item=torch|quantity=2d3|weight=10}}
|{{EncounterTable/Row|item=copper nugget|quantity=4d3|weight=10}}
}}
}}
</pre>
</pre>
{{EncounterTable
{{EncounterTable|roll=each
|{{EncounterTable/Row|table=Junk#Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk 0C|weight=95}}
|{{EncounterTable/Row|table=Junk#Junk 0R|weight=5}}
|{{EncounterTable/Row|table=Junk 0R|weight=5}}
|{{EncounterTable/Row|item=torch|quantity=2d3|weight=10}}
|{{EncounterTable/Row|item=copper nugget|quantity=4d3|weight=10}}
}}
}}
[[Category:Template documentation]]
{{doc/end}}
<noinclude>[[Category:Template documentation]]</noinclude>