A character/monster generator for TTPRGs.
Victor makes monsters as instructed.
By giving Victor a ".vic"-file that contains instructions for how stats should be calculated, creations will come alive.
As an example of how these are defined, you can look in the examples folder
To have Victor make a Tiny d10 character, you simply run the command
$ victor create ./examples/tinyd10_character.vic
Which will print out information about the generated character.
Victor is a command line tool. The required parameter is the markdown file that contains the definitions to be used. There are also some options.
--average
will calculate the average values for dice rolls, instead of using random numbers. This is useful to see what an average monster would look like.
--fill PATH
takes the path to a PDF with a fillable form, and will put the values of the generated creature into the fields with the same name in the PDF.
--output PATH
takes the path to where to store the outputted PDF.
The language is Python-based, and has a lot of similarities. But it is also made to be somewhat specific for making character sheets.
To have a variable be a part of the result, you would assign it to a subselector of the object $
.
As an example $.Strength = 5
Variables made without the $
object will be accessible only within the generator script, and not a part of the result.
You use the random
function for random values, like so:
$.Charm = random(1, 8)
To roll dice, there is a roll
function that takes strings based on the Troll language to return a result.
Example $.Dexterity = roll("sum 3 largest 4d6")
, which will give Dexterity a value that is the sum of the 3 largest among 4 d6 rolled. For more information on Troll, see: TODO: Insert link
roll(string)
- Do a dice roll based on Trollmin
- Return the smallest of provided valuesmax
- Return the largest of provided valuesswap
- Swap two valuesswap_largest(candidates, target)
- Swap the largest value amongcandidates
with the one intarget
, wherecandidates
is a dictonary of value, andtarget
the name of one.apply_modifiers
- Apply values from a tableprint
- Print out inforound_up
- Round up a valuerandom
- Return a random valuedistribute(points, bins)
- Randomly distributepoints
intobins
evaluate(string)
- Evaluatestring
as an expressionlen(list)
- Return the number of elements inlist
assign(values, variables)
- Assignvalues
tovariables
specified as a list of strings.
-
load_tables(filename)
- Load tables from a yaml-file. -
random_table(table, count = 1)
- Pickcount
random values fromtable
. Can be both a list with equal chance, or a dictionary with ranges for each item. -
table_lookup(table, key)
- Return the value ofkey
intable
-
ranged_table(table, key)
- Return the value ofkey
in atable
with ranges.