ROLZ

Lookup Lists
Help | Info

Lookup Lists
Often times, roleplaying rulesets contain tables to look up things on. For example, a hit location table:
Lookup List hitlocations
d100 Location
01–10 Head
11–20 Right Arm
21–30 Left Arm
31–70 Body
71–85 Right Leg
86-100 Left Leg
Rolz allows you to define such lookup lists for your Dice Room. Any of your room's wiki pages can contain lookup definitions.
To make a lookup list, go to a room wiki page of your choice, click on "edit page" and add the code [lut MyLookupName] where "MyLookupName" can be any name you want as long as it doesn't contain any spaces or weird characters. After that code, enter a layout table (see the wiki documentation for more information on layout tables).
Note: The following examples will only work if you have the respective lookup lists defined in your room.
For example, the wiki code for the table above looks like this:
[lut HitLocations]
|=d100 |=Location
|01–10 | Head
|11–20 | Right Arm
|21–30 | Left Arm
|31–70 | Body
|71–85 | Right Leg
|86-100 | Left Leg
After saving your wiki page, the lookup list should look similar to the example above.
Using Lookup Lists
After defining a lookup list as shown, you can refer to it in your dice codes. Calling a lookup list works the same as calling a macro. For example, if you have defined a list called "HitLocations", you can then roll on that table by invoking the dice code "#!HitLocations":
Using the previous result
By chaining together a dice roll and a lookup, you can feed the result of the dice roll into the lookup list. For example, to roll a d20+50 on the lookup list above, use the dice code "d20+50 | #!HitLocations".
Lookup with a parameter value
You can pass a parameter value to your lookup by putting the parameter after the lookup name in parentheses. For example, to toll a d20+50 on the lookup list above, use the dice code "#!HitLocations(d20+50)".
Dice codes in lookup lists
By default, Rolz will interpret the result column of your lookup list as a dice code and will attempt to evaluate it. For example, if you have a lookup list of D&D-style attributes:
Lookup List attributebonuses
Attribute Bonus
1–7 −2
8–9 −1
10–11 0
12–13 1
14–20 2
You could then use it in a dice code by calling the lookup with your character's STR attribute if you have one defined in your character sheet: "d20 + !AttributeBonuses(STR)"
Text results in lookup lists
As the first example with hit locations showed, lookup lists often feature descriptive text results instead of dice codes and numbers. In these cases, you can prepend the comment designation to the lookup list in order to force Rolz to see the result as a text only.
For example "#!HitLocations" will interpret the result as a text, whereas "!HitLocations" will make Rolz evaluate the result as a dice code.
Mixing text and dice codes
If your lookup list contains mostly text results, you may want to embed a dice code in a text result occasionally. To do this, wrap the dice code in curly braces:
[lut HitLocations]
|=d100 |=Location
|01–10 | Head
|11–20 | Arm Number: {d2}