foreveryone1.github.io

5e.tools

Visit the main site.

Running 5etools Locally (Offline Copy)

There are several options for running a local/offline copy of 5etools, including:

Option 1 When using Chrome (or similar), a command-line switch is required to load some pages locally. On Windows, this can be accomplished by creating a Chrome shortcut and editing the properties of the shortcut to add --allow-file-access-from-files to the shortcut Target:

Chrome tutorial

Be sure to close any running Chrome instances (and kill any remaining Chrome processes as required) before opening the shortcut. A summary of the security implications can be found here.

Option 2 Install Node.js, open a command line prompt in this directory, and npm i && npm run serve:dev. Then access the site on http://localhost:8080/

Option 3 Host the project locally on a dev webserver, using e.g. devd or Python3 python3 -m http.server ..

How to import 5etools creatures/spells/items into Roll20

  1. Get Tampermonkey for Firefox or Chrome.

  2. Click here and install the script.

  3. Open the Roll20 game where you want the stuff imported.

  4. Go to the gear icon and click within the Import by Category on the thing you want imported.

  5. Follow the prompts and make selections as are needed.

  6. Let it run. The journal will start fill up with the stuff you selected. It’s not too laggy but can take a long time depending on the amount of stuff you selected.

  7. Bam. Done. If you are using the Shaped sheet, be sure to open up the NPC sheets and let them convert before using it.

You can convert stat blocks to JSON for importing via this converter.

Dev Notes

Data Sources and Versioning

Only “official” (that is, published by WotC) data is to be included in the site. Anything else should be added to the homebrew repository.

Prioritise RAW above all else. Aim to provide a 1:1 copy of the original data. Obvious typos (for instance, mathematical errors in creature statblocks) may be corrected at the discretion of the maintainer(s).

Aim to use the latest version of any published material. Older versions which are sufficiently different (and relevant to community interests) can be moved to the homebrew repository.

Page-Specific Notes

Languages page. As there is no well-defined RAW format for language data, the languages page collects together information from several disjoint places. A priority list of sources to be considered is:

Within this ordering, the following prioritisation should be made:

Target JavaScript Version

Targeting ES6 was the original intent, but more modern features have long since crept into the code. Therefore, if something is available as standard in both Chrome and Firefox (preferably in versions dating back at least a couple of months), and isn’t bleeding-edge, one can reasonable justify using it. As with all things, use common sense.

Style Guidelines

Code

CSS

Data/Text

JSON Cleaning

Trailing commas

To remove trailing commas in JSON:

Find: (.*?)(,)(:?\s*]|\s*})

Replace: $1$3

Character replacement

Convention for dashes

Convention for measurement

Convention for Dice

Dice should be written as [X]dY[ <+|-|×> Z], i.e. with a space between dice and operator, and a space between operator and modifier. Some examples of acceptable formatting are: d6, 2d6, or 2d6 + 1.

Convention for Item Names

Item names should be title-case, with the exception of units in parentheses, which should be sentence-case. Items who’s volume or amount is specified by container (e.g. (vial)) treat the container as a unit.

Mouse/Keyboard Events

Avoid binding ALT-modified events, as these are not available under MacOS or various Linux flavors. Binding SHIFT-/CTRL-modified events is preferred.

Dev Server

Do npm run serve:dev to launch a local dev server that serves the project files on http://localhost:8080/5etools.html.

Version bump

Do npm run version-bump -- [OPTION], where [OPTION] is one of the following:

It will first run the tests and fail to increase the version if the tests fail. It will then automatically replace the version in the files where it needs to be replaced, create a commit with the message chore(version): bump and create a tag (in the form v1.2.3) at the commit. This feature can be easily disabled by doing npm config set git-tag-version false.

License

This project is licensed under the terms of the MIT license.