Roll20 API Scripts with shared library code in TypeScript
For each plugin you want to use, go to https://github.com/derammo/der20/releases and download EITHER
- der20_library.js (unless you already have it from another plugin) AND the specific plugin you want to use, such as der20_rewards_plugin.js
OR
- the complete self-contained script, such as der20_rewards_complete.js, which will be a much larger file than the corresponding plugin
Install all *.js files as separate scripts in the Roll20 API Console. Only install one copy of der20_library.js. The order of scripts does not matter, but plugins will fail to start until the library is installed.
The command reference for all plugins is at https://derammo.github.io/der20
This is a framework for making many Roll20 scripts from a common code base in TypeScript. TypeScript source files compile down to a monolithic JavaScript file for each Roll20 script. The monolithic files that are self-contained contain a tiny AMD loader so they can load into an anonymous scope in Roll20.
The same sources are also compiled into an additional format, with all the library sources under src/der20 compiled into one Roll20 API Script called der20_library.js and each plugin under src/plugins/* compiled into a small Roll20 API Script named der20_*_plugin.js that requires der20_library.js to also be installed into the Roll20 API script host. Either format can be used and contains the same code, with the library+plugin format being far more readable in terms of the compiled code.
All Roll20 scripts are found in dist/* after building. To add a new plugin, add the name to the PLUGINS variable in Makefile, and place sources under src/plugins/NAME/*.ts . The configuration file src/plugins/NAME/tsconfig.json will be generated by make.
Executable scripts without the Roll20 wrapping are found in build/* after building. These can include scripts (EXECUTABLES variable in Makefile) that run locally. For an example, see src/executables/parser_test/*
Outside Roll20, code can be referenced from testing executables and run under Node.js for local debugging. This project will not duplicate the effort of "Mock20" and so there is no local emulation of Roll20 functions. Instead, functionality is written in a generic way so it only becomes dependent on Roll20 for final presentation of dialogs etc.
Currently, local testing of individual dialogs can be done in a browser. See test/show.html for an example.
Please contact derammo for creating a release. The tools required are included in the Makefile, but please don't do it :)
Requirements: Node.js, npm, GNU Make
Installation: 'make'