League-of-Foundry-Developers / torch

Simple torch module for Foundry VTT
10 stars 16 forks source link

Error when adding custom source. #45

Closed Padhiver closed 1 year ago

Padhiver commented 1 year ago

Hello ! I'm trying to add a custom light to the module but I get an error no matter how I do it, even using the default example I get this error. Do you have any idea what it could be? Latest version of Foundry and dnd5e.

{
  "dnd5e": {
    "system": "dnd5e",
    "topology": "standard",
    "quantity" : "quantity",
    "sources": {
      "Candle": {
        "name": "Candle",
        "type": "equipment",
        "consumable": true,
        "states": 2,
        "light": [
          { 
            "bright": 10, "dim": 15, "angle": 360, "color": "#ff9329", "alpha": 0.5,
            "animation": { "type": "torch", "speed": 5, "intensity": 5, "reverse": false } 
          }
        ]
      }
    }
  },
  ...
}

image

HigginsTheRed commented 1 year ago

I'm running into this exact issue right now, how did you resolve it?

Padhiver commented 1 year ago

I reworked my json, it had errors. Here is the one that works:

{ "dnd5e": { "sources": { "Bougie": { "consumable": true, "light": [ { "bright": 1.5, "dim": 3, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } } ] }, "Torche": { "consumable": true, "light": [ { "bright": 3, "dim": 6, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } } ] }, "Lampe": { "consumable": false, "light": [ { "bright": 4.5, "dim": 13, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } } ] }, "Lanterne à capote": { "consumable": false, "states": 3, "light": [ { "bright": 9, "dim": 18, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } }, { "bright": 0, "dim": 1.5, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } } ] }, "Lanterne sourde": { "consumable": false, "light": [ { "bright": 18, "dim": 36, "angle": 57, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "torch", "speed": 2, "intensity": 3, "reverse": false } } ] }, "Lumière": { "consumable": false, "light": [ { "bright": 6, "dim": 12, "angle": 360, "color": "#63aed4", "alpha": 0.5, "animation": { "type": "torch", "speed": 1, "intensity": 1, "reverse": false } } ] }, "Flamme": { "consumable": false, "light": [ { "bright": 3, "dim": 6, "angle": 360, "color": "#7f4a14", "alpha": 0.5, "animation": { "type": "flame", "speed": 2, "intensity": 3, "reverse": false } } ] } } } }

HigginsTheRed commented 1 year ago

Thank you so much. Didn't even occur to me to remove the "system": , "topology": , and "quantity" :