I added two new helper functions for Jinja2 templates.
pick_multiple
Returns multiple values from an input list (a resolved wildcard for example). The number of items can be specified, otherwise it’s rolled between 1 and the maximum. If the specified amount is too high, it’s autocorrected instead of throwing an error.
Example
Between 1 and maximum
{% set separator = ' and ' %}
{% set characters = ['ash', 'misty', 'brock', 'professor_oak', 'gary'] %}
a hike with {{ pick_multiple(characters)|join(separator) }} in the mountains
Between 0 and maximum
{% set separator = ' and ' %}
a hike
{% set characters = ['ash', 'misty', 'brock', 'professor_oak', 'gary'] %}
{% set charactersAmount = randint(0, characters|length) %}
{% if charactersAmount > 0 %}
with {{ pick_multiple(characters, charactersAmount)|join(separator) }}
{% endif %}
in the mountains
flip_coin
If no arguments are given, returns a random boolean. Otherwise randomly picks an argument.
Example
For branches
{% if flip_coin() %}
1girl,
{% endif %}
laying on grass
I added two new helper functions for Jinja2 templates.
pick_multiple
Returns multiple values from an input list (a resolved wildcard for example). The number of items can be specified, otherwise it’s rolled between 1 and the maximum. If the specified amount is too high, it’s autocorrected instead of throwing an error.
Example
Between 1 and maximum
Between 0 and maximum
flip_coin
If no arguments are given, returns a random boolean. Otherwise randomly picks an argument.
Example
For branches
For quick inline decisions