League-of-Foundry-Developers / torch

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

Error encountered using custom JSON file on AGE System #26

Closed lupestro closed 1 year ago

lupestro commented 1 year ago
    Hey @lupestro I was using a custom JSON file before the last update and it was working fine, but now I keep having errors on `library.js` in the exactly the same portion of code that was changed. My errors are normally between lines 25 and 34. Here is the json code I was using.

Note: I am using module on AGE System and FVTT 10.286.

{
    "age-system": {
      "system": "age-system",
      "topology": "standard",
      "quantity" : "quantity",
      "sources": {
        "Lanterna": {
          "name": "Lanterna",
          "type": "equipment",
          "consumable": false,
          "states": 2,
          "light": [
            { 
              "bright": 10, "dim": 15, "angle": 30, "color": "#ff9329", "alpha": 0.5,
              "animation": { "type": "torch", "speed": 5, "intensity": 5, "reverse": false } 
            }
          ]
        },
        "Visão Noturna": {
            "name": "Visão Noturna",
            "type": "equipment",
            "consumable": false,
            "states": 2,
            "light": [{
                "bright": 1000, "dim": 1000, "angle": 360, "color": "#184601", "alpha": 0.4,
                "animation": { "type": "none", "speed": 5, "intensity": 5, "reverse": false },
                "light": {"luminosity": 0.3}
            }]
        }
      }
    }
}

Attached is the error I get when rendering token hud: image

I am logging this here as I believe the error I am facing is closely related to the ones posted in this thread.

Cheers!

Originally posted by @vkdolea in https://github.com/League-of-Foundry-Developers/torch/issues/23#issuecomment-1264132855

lupestro commented 1 year ago

@vkdolea Good catch. I had missed an important edge case. I have a one-line fix but can you send me a character to use with this so I can watch the light going on and off? I just need the character export with nested items. I've loaded AGE into a world with core running pt-BR. I have done preliminary testing on the fix and it all looks good.

lupestro commented 1 year ago

This should be fixed in Torch v2.1.3.