A Python library for producing custom scripts in Blood On The Clocktower.
Project description
Scriptmaker
A PDF writer for Blood on the Clocktower scripts.
Scriptmaker includes some special features:
- support for modern and legacy base3+experimental custom scripts
- homebrew character support via the official app's character schema
- as a result, supports translations too!
- nightorder styles: single-sided rotated, or double-sided full-text
- i18n support with fallback rendering modes
Significant credit goes to chizmw for inspiration and assets!
Stack
- Python
poetry
jinja2
Examples
Trouble Brewing
Custom script & homebrew
Usage
Installation
Install the package with your package manager of choice.
pip install scriptmaker
poetry add scriptmaker
...
Creating a script
- Import everything you need.
from scriptmaker import Character, Data, Script, ScriptmakerError
- Create a data store for your new script.
# Create a datastore (leaving it blank uses a temporary directory)
my_datastore : Data = Data("my/output/directory")
# Load the official characters into it, if you want
my_datastore.add_official_characters()
- Load a script.json file.
with open("my/script.json", "r") as json_file:
my_script_json = json.load(json_file)
# Loads the characters into the datastore, then builds a script object too
my_script : Script = my_datastore.load_script(my_script_json)
- Set your desired options on the script if not already in the script.json.
# Metas are set if there was a _meta block in the script.json
my_script.meta.author = "rsarvar1a"
# Options have defaults; see ScriptOptions()
my_script.options.i18n_fallback = True
- Render it!
my_script.render()
Changelog
1.0.0 - packages are neat
- Character updates:
- adds the Ojo
- Features:
- adds a fallback switch for translations that didn't play well with default style
- Breaking changes:
- if you were using the (unpackaged) version of
scriptmaker
, you will need to write your own scripts
- if you were using the (unpackaged) version of
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scriptmaker-1.0.0.tar.gz
(22.1 MB
view hashes)
Built Distribution
Close
Hashes for scriptmaker-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea571c1b32d4bdbe431f75d50e43f14cd75d33ec5f35a3b48f619ab6ea2899e |
|
MD5 | 5743a55a716743240eea1e72097dc5df |
|
BLAKE2b-256 | 985e280520fefac3c21f12438da8f5ce1d1c49e50e1da89c3d7509e7faa9b312 |