edzillion / blood-n-guts

Other
4 stars 16 forks source link

blood-n-guts - A module for FoundryVTT

Spray your dungeons with blood! Blood 'n Guts

Table of contents

Overview

Blood 'n Guts is a module for FoundryVTT that draws blood splats on tokens and floors.

Features

Installation

Paste the link to the module.json file into the 'Manifest URL' field in 'Install Module'.

https://raw.githubusercontent.com/edzillion/blood-n-guts/master/src/module.json

Or download the latest zip file here: https://github.com/edzillion/blood-n-guts/releases

Settings For House Rules

Two of the options in Advanced Config help customise when blood splats appear:

A common house rule is to show blood at 50% health. This can be achieved by setting Health Threshold = 0.5 and Damage Threshold = 0. As this is a common rule so a checkbox is included which sets these settings.

Customization

⚙️ Since v0.7.2 it is possible to save settings on The Forge. In this case the settings are stored in your Assets Library in a folder called blood-n-guts. Replace /Data/blood-n-guts with this folder in the instructions below.

Recomended Forge workflow: install and enable module, files will be created in Assets Library. Go there are download blood-n-guts folder. Edit files locally, then upload back to same location.

⚙️ Since v0.6.9 it is now possible to save settings permanently. These settings files are stored in /Data/blood-n-guts/ (note: this is not inside the modules folder). The files (in JSON format) and the folders will be created for you on install.

Adding a Custom Font

Blood 'n Guts renders splats as individual glyphs from fonts. You can use this online font face generator to convert a font into the required woff & woff2 formats: https://transfonter.org/ (just use the default options), it will also provide some sample css.

Steps:

  1. Copy your font .woff and .woff2 files to the Data/blood-n-guts/fonts folder.
  2. Edit the Data/blood-n-guts/custom.css to add your @font-family definition, note the src urls:
@font-face {
  font-family: 'Example Font Family';
  src: url('../../blood-n-guts/fonts/ExampleFontFile.woff2') format('woff2'),
      url('../../blood-n-guts/fonts/ExampleFontFile.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
  1. Add an entry in the Data/blood-n-guts/customSplatFonts.json file for your new font, this and the css must match.
{
    "Example Font Family": {
        "name": "Example Font Family",
        "availableGlyphs": "ABCDEFGHIJKLMNOP$%&^@!"
    }
}
  1. You must select only the characters that you want to display. I used FontForge to find the valid character glyphs.

  2. Reload the world and you should then be able to select the font in Advanced Configuration.

Customizing Blood Color

Blood color can be set for race as well as npc type. Just add an entry to the Data/blood-n-guts/bloodColorSettings.json file. Each entry consists of a name of the race or type (key), and the corresponding color (value), which can be described in a number of ways:

example (note: keys should all be lowercase!):

{
  "beast": "green", // this will override the default color of all beasts
  "blob": "name" // this adds a new entry which will display blue for a 'blue blob' red for a 'red blob' etc.
  "gnome": "rgba(23, 23, 255, 0.5)" // setting individual red, green, blue, alpha
}

Customising Violence Levels

As in other customisations you can override the default levels or add new ones. Example:

{
  "Shrieker": { // this will override the default 'Shrieker' settings.
    "trailSplatDensity": 9,
    "floorSplatDensity": 1,
    "tokenSplatDensity": 1,
    "trailSplatSize": 25,
    "floorSplatSize": 35,
    "tokenSplatSize": 25,
    "splatSpread": 1,
    "healthThreshold": 0.5,
    "damageThreshold": 0.33,
    "deathMultiplier": 1.5,
    "sceneSplatPoolSize": 20
  },
  "Aboleth": { // this will add a new violence level to the end of the list.
    "trailSplatDensity": 10,
    "floorSplatDensity": 6,
    "tokenSplatDensity": 4,
    "trailSplatSize": 90,
    "floorSplatSize": 120,
    "tokenSplatSize": 60,
    "splatSpread": 2.5,
    "healthThreshold": 0.9,
    "damageThreshold": 0.15,
    "deathMultiplier": 2.5,
    "sceneSplatPoolSize": 175
  }
}

Performance & Clearing Blood

Foundry can start to lag if too many blood splats are being generated. If you are having this problem consider lowering your Violence Level in settings or the Splat Pool Size in Advanced Configuration.

There are 3 ways to clear blood from the current scene:

  1. By chat command / chat macro: /blood clear (GM and PC)
  2. By clicking the Wipe Scene Splats button at the bottom of Advanced Configuration (GM Only)
  3. By clicking the button in the Tile menu on the left (GM Only):

screenshot

Credits and Thanks

Thanks to @Fyorl @vance @skimble @sky @Monkeyy and @Erecon for tech help. Thanks to @ApoApostolov for testing and feedback.