Oracle
█▀▀▀█ █▀▀█ █▀▀█ █▀▀ █ █▀▀
█ █ █▄▄▀ █▄▄█ █ █ █▀▀
█▄▄▄█ ▀ ▀▀ ▀ ▀ ▀▀▀ ▀▀▀ ▀▀▀
Oracle is a tool for picking random items from a table.
Installation
go install github.com/script-wizards/oracle
Usage
You can run oracle
with no arguments and it will load up a Yes/No oracle.
You can create custom tables defined in YAML files. See examples. Pass the file path as an argument.
oracle random-events.yaml
Dice Notation
Put dice notation in curly braces, like There are {1d4} kobolds.
The following formats are supported:
- Standard
xdy[[k|d][h|l]z][+/-c]
- Rolls and sums
x
y
-sided dice, keeping or dropping the lowest or highestz
dice and then adding or subtractingc
. - Example:
4d6kh3+4
- Fudge
xdf[+/-c]
- Rolls and sums x fudge dice (-1 and 1), and then adding or subtracting
c
. - Example:
4df+4
- Versus
xdy[e|r]vt
- Rolls
x
y
-sided dice, counting the number that rollt
or higher.
- Comparison
{xdy[<|>]t}
- Rolls
x
y
-sided dice, then compares the result tot
. Useful forX-in-Y
. - Example:
1d6<3
for2-in-6
Add option to return multiple outputs
One use-case for room generation is to output 3 things for the user to draw their own connection. For example:
Where each of these outputs are drawing from different tables (monster, feature, decoration).
Replace regex with linear search
Regex is slower compared to built-in methods like Index. https://stackoverflow.com/questions/39908955/golang-regex-get-value-inside-parentheses
We could do it in one pass, and enforce rules such as no nested curly brackets.
Word wrap status bar
Small windows cannot display the full status bar. This is most troublesome when working with the stats.yaml example, or long entries.
We may have to rewrite bubbles list. Or investigate the following bubbles:
Add way to open files from the program
New users may not know how to pass filename argument to program. Consider adding an open file dialogue or support drag and drop.
Currently, you can drag a file directly onto the executable on Windows. Need to test on other systems.
Reference other tables from an item
We want the ability to chain tables. Should force lowercase.