|
Parallel Visions: City of Angels City of Demons ebook and trade paperback available on Amazon (or here). |
![]() |
|||
RandomFunctions Documentation
Contents
Examples
Randomly pick values from a table
Initialize the table:
<rTable name="rainbow color"> ;1;red ;1;orange ;1;yellow ;1;green ;1;blue ;1;indigo ;1;violet </rTable>
Pick a single value from the table:
{{#pickFrom:rainbow color}}
Results in: blue
To generate multiple (20) values:
{{#loop: index
| 1
| 20
| <nowiki/>
# {{#pickFrom:rainbow color}}
}}
Produces:
- orange
- blue
- orange
- violet
- green
- indigo
- blue
- orange
- violet
- violet
- green
- yellow
- blue
- yellow
- blue
- violet
- blue
- red
- yellow
- blue
Using templates
To create a pick table that can be used on multiple pages, create a template containing the table or tables as follows:'
(TODO)
Example Die Rolls
Old school Dungeons and Dragons character generation (i.e. 3D6 rolls):
* Strength: {{#d6:3}}
* Intelligence: {{#d6:3}}
* Wisdom: {{#d6:3}}
* Dexterity: {{#d6:3}}
* Constitution: {{#d6:3}}
* Charisma: {{#d6:3}}
- Strength: 11
- Intelligence: 12
- Wisdom: 8
- Dexterity: 10
- Constitution: 9
- Charisma: 5
Example generator topics
Some useful regular expressions
^(\d+), --> ;\1;
\[([^\]]+)\] --> {{#pickFrom:\1}}
^;([A-Za-z_][A-Za-z0-9_]*)$ --> <rTable name="\1">
[[File:|right|thumbnail|50px]]
Categories[edit]
- Empty CatsRest (category)
- Extension (category)
- Fritz (category)
- Generator (category)
- Has Data Table (category)
- Has Layout (category)
- Has Layout Base (category)
- Has Navbox (category)
- Has Tags (category)
- MediaWiki (category)
- MediaWiki Extension (category)
- PHP (category)
- Random (category)
- Work (category)
