Giter VIP home page Giter VIP logo

blood-n-guts's Introduction

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

  • Blood splatter on floor, on tokens, and blood trails behind moving tokens.
  • Customizable blood Color based on race or npc type.
  • Customizable blood splatter glyphs.
  • Blood respects walls, but not see through walls.
  • Many options to customize blood size and spread and frequency.
  • Can support house rules such as bloodied at 50% health
  • Currently supports DnD5E and PF2E and more to come (please add your request as an issue on the repo)
  • Only works on active scenes

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:

  • Health Threshold - the percentage of total health to start showing blood.
  • Damage Threshold - the damage as a percentage of health to show blood.

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.

  • If you add a customisation with the same name as a default - it will overwrite the default with your settings.
  • New entries will be added in addition to the defaults.

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:

  • The full rgba string [r,g,b,alpha] e.g. "half-elf":"rgba(223, 96, 96, 0.7)",
  • A CSS color name e.g. "elf": "silver",
  • "name" tells Blood 'n Guts to read the creature's name for the color to display e.g. "dragon": "name",

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.

  • Everyone has access to change Violence Level but only GMs have access to Advanced Settings.
  • GM sets the level appropriate for their needs and then other clients can turn their violence level down if they are having issues.

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.

blood-n-guts's People

Contributors

danheuck avatar dmrickey avatar edzillion avatar mcglincy avatar rrenna-uptake avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blood-n-guts's Issues

Randomise end point of bezier curves on the tile.

The problem is that in a trail with trailsplat density of < 1 will mean the splat is always v centered since it is at the end of a curve. If we randomised the endpoint somewhat it would look better. Could be randomised to appear on the approaching side of the tile.

Consistently Inconsistent colours with PF2e NPCs

lookupTokenBloodColour for certain types of creature alternates between the correct colour of blood and "undefined".
Have tested with various types
Undead: Skeletal Champion, Skeletal Giant, Skeleton Guard;
Plants: Leaf Leshy, Gourd Leshy;
Constructs: Adamantium Golem, Flesh Golem, Iron Golem

Creatures such as Animals or Humanoids consistently return the correct "blood" colour, Characters also seem fine.
The faulty behaviour occurs even with the same actor dragged onto the map multiple times in a row.
Console outputs:
Undead
Plant
Construct

Behaviour still occurs when Blood N Guts is the only active module

Scene navigation

There are potential problems with the current implementation, which will break when the DM pulls players to a scene.

[feature request] About face compatibility

I found out that the blood trail function makes the token stand still even though I have About face installed (module that rotate the tokens based on the last input direction)

[feature request] Vaesen compatibility

token.actor.data.data:

token.actor.data.data
{}
  advantage: ""
  attribute: {}
    empathy: Object { label: "ATTRIBUTE.EMPATHY", value: 0 }
    logic: Object { label: "ATTRIBUTE.LOGIC", value: 0 }
    physique: Object { label: "ATTRIBUTE.PHYSIQUE", value: 0 }
    precision: Object { label: "ATTRIBUTE.PRECISION", value: 0 }   
  bio: Object { age: "", archetype: "", motivation: "",}
  capital: 0
  condition: {}
    mental: Object { isBroken: false, states: {} }
    physical: Object { isBroken: true, states: {} }
  experience: 0
  memento: ""
  note: ""
  resources: 0
  skill: Object { agility: {}, closeCombat: {}, force: {},}

[feature request] Damage thresholds

My other suggestion (or request) would be thresholds. I would only turn on trails once the token drops below X% (50 or something), similar to the "bloodied" or "wounded" conditions a lot of systems use.

Per Token Settings overriding the general settings

Please add settings in the Token Configuration UI that allows to:

  • Have individual Violence level per token - helpful to make blood oozes who splatter blood at extreme level.
  • Have individual Blood color per token. Solves the issue with blood color for special monsters that otherwise have to be automatically recognized by type, which is a very 5E data and although it can be done for other games like PF1, PF2... it is best that the DM has the tools to set the color per unit.

Please add support for Pathfinder 2nd Edition

This is solely needed as this mod is pretty system-agnostic in its functionality, it just needs to recognize the health values of more systems. Perhaps the value to watch should be exposed in the Settings.

Blood effects not working

I noticed in my game today that if the scene isn't active when a token is dropped on to the map they do not have blood effects. For example I preset up the encounter before bringing my players over to the map they do not bleed. I have tested this a couple times and can be recreated by viewing a scene dropping a token and then activating the scene. Trying it side by side with a token I dropped after activation and that second token works as expected.

Fire ready hook when module is ready for API calls

@KayelGee I've seen 2 things used regarding this issue:

  1. Put the relevant functions/data/whatever on the window object.
  2. Fire your own Hook when your module is 'ready' for other modules to consume. Hooks.call('myArbitraryHookName', args)

I think #2 is the best way to handle what you bring up with some modules being loaded first. And I suspect the best way to do this is a combination of the two.
If your module populates something on the global scope, and then fires a hook, other modules can expect that once Hooks.once('myArbitraryHookName') fires, that global will exist.
The main module I know of which does this is Better Rolls for 5e.

Clear Blood Splats via a macro or chat command?

I see the ways to clear the blood from a scene (via settings button or tiles icon option). Can there be a method to clear them via a macro as well? Even just a chat command /blood clear would be helpful.

Thanks for a cool way to show what everyone is doing in combat to each other.

Ability to apply violence level to >50%, <50% of max hp

Currently, the mod FX configuration is very detailed but not very clear to the casual end users on how to achieve desired effect with multiple numeric fields. At the same time, the five levels of violence are very well defined and can be used instead of strict values.

For example, a default setup could be Shriker for >50% of max hp, Kobold for 25..50% of max hp, and Ogre for 1..24% of max hp.

Save settings between installs.

For custom fonts: css and splatFont
For custom colours: just the bloodColorSettings stuff
For custom voilence level settings violenceLevel stuff

Unofficial Elder Scrolls RPG 3e Support

the way HP is tracked in this game is via one of your Characteristics
let's say a Character has 50 Endurance. his Health Points = Endurance / 2, so 25
most characters do not have more than 50 Endurance ever, even though they can go beyond it

Settings not saving

Hi,
after I leave the game or reload it, the custom settings I made, get back to the default ones.
I'm on 7.5.0

Error after update

After the latest update I now get an error anytime a scene loads

blood-n-guts | drawSplats: splatStateObj.tokenId
foundry.js:10020 TypeError: Cannot read property 'data' of null
at lookupTokenBloodColor (helpers.js:104)
at new SplatToken (SplatToken.js:22)
at Token. (blood-n-guts.js:455)
at Generator.next ()
at fulfilled (blood-n-guts.js:11)
draw @ foundry.js:10020

"Violence Setting" broken

Unable to save settings if anything but "disabled" is selected on "violence level". When trying to select a violence level other than disabled, I get the following error in console:

image

More detail:
-This seems to work on another world fine but not on my main world nor on a copy of the main world.
-Uninstalling and reinstalling the module does not fix the issue unfortunately.
-When I initially changed the settings, it was while testing on an inactive scene.
-Testing again on another world where it initially worked and it no longer allows me to switch violence levels there either with the same error. On this world, the settings were always changed while on an active scene.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.