Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphere Light #113

Open
1 task done
Doc-Sun opened this issue Oct 24, 2024 · 7 comments
Open
1 task done

Sphere Light #113

Doc-Sun opened this issue Oct 24, 2024 · 7 comments
Labels
feature request New feature

Comments

@Doc-Sun
Copy link

Doc-Sun commented Oct 24, 2024

Is your feature request related to a problem? Please describe.
No real problem, more thematic and fitting to the setting. We should have infused spheres as a light source option

Describe the solution you'd like
Have some way to have a simple "Infused Spheres Light" or make spheres have a toggle to say show light in a bright/dim radius and make it colored based on the color of sphere used even. It is used so often in the books it really should be there.

Describe alternatives you've considered
user could always install a mod(such as torch) but id prefer to keep as much utility into the base game as possible

Additional context
Allowing for something to this effect

image


Checklist:

  • I have searched the existing issues to ensure this feature has not already been requested.
@Doc-Sun Doc-Sun added the feature request New feature label Oct 24, 2024
@MangoFVTT
Copy link
Collaborator

Note that sphere light is a Stormlight specific thing, not a Cosmere generic thing, so putting this in the base system would not make much sense unless we simply want to have generic light presets that users can select (which is what I believe Torch does)

@Doc-Sun
Copy link
Author

Doc-Sun commented Oct 25, 2024

Yep. Like I said no real problem (and clearly I can do it with torch) but having item context based switches in general that show up on a sheet when in inventory or equipped would be something good to have as code and definitely as a base item. If any light source from any cosmere universe such as a sphere or a lantern etc, had a pre coded toggle would be a nice feature. If the majority of the coding team think it's not worth it that's cool. Just think it might be a nice have especially for expandability in the future.

@MangoFVTT
Copy link
Collaborator

The most straightforward way to do it without a huge workload would be to open up token light attributes to effects, so that an Item can add a "light source" effect that modifies those dynamically when equipped. This module does that for dnd5e as a point of reference: https://github.com/kandashi/Active-Token-Lighting

@Doc-Sun
Copy link
Author

Doc-Sun commented Oct 25, 2024

Yep that's kinda exactly what I'm looking for an inactive effect that can be turned on. (I was looking but didn't see lighting as an option so if it can be added that solves that!) Can be put on all the different possible sources of light!

@Dez384
Copy link

Dez384 commented Oct 29, 2024

The easiest way to implement this is with a macro. Here's a quick hack of the community Token Light Picker macro:

function tokenUpdate(data) {
  canvas.tokens.controlled.map(token => token.document.update({light: data}));
}

let torchAnimation = {"type": "torch", "speed": 1, "intensity": 1, "reverse": false};

let dialogEditor = new Dialog({
  title: "Sphere Lantern Picker",
  content: "How full is your sphere lantern?",
  buttons: {
    empty: {
      label: "Empty",
      callback: () => {
        tokenUpdate({"dim": 0, "bright": 0, "angle": 360, "color": "#000000", "luminosity": 0.5});
        dialogEditor.render(true);
      }
    },
    onesphere: {
      label: "Single Sphere",
      callback: () => {
        tokenUpdate({"dim": 5, "bright": 0, "angle": 360, "color": "#e3e3e3", "luminosity": 0.25, "animation": {type: "torch"}});
        dialogEditor.render(true);
      }
    },
    quarter: {
      label: "Quarter-filled",
      callback: () => {
        tokenUpdate({"dim": 15, "bright": 5, "angle": 360, "color": "#e3e3e3", "luminosity": 0.25, "animation": {type: "torch"}});
        dialogEditor.render(true);
      }
    },
    half: {
      label: "Half-full",
      callback: () => {
        tokenUpdate({"dim": 30, "bright": 15, "angle": 360, "color": "#e3e3e3", "luminosity": 0.25, "animation": {type: "torch"}});
        dialogEditor.render(true);
      }
    },	
    full: {
      label: "Filled",
      callback: () => {
        tokenUpdate({"dim": 60, "bright": 30, "angle": 360, "color": "#e3e3e3", "luminosity": 0.25, "animation": {type: "torch"}});
        dialogEditor.render(true);
      }
    },
    close: {
      icon: "<i class='fas fa-x'></i>",
      label: "Close"
    },
  },
  default: "close",
  close: () => {}
});

dialogEditor.render(true)

Changing the buttons to dropdowns and adding colors would be logical next steps.

EDIT: trying to make the code block format properly

@Doc-Sun
Copy link
Author

Doc-Sun commented Oct 29, 2024

My friend. That is beautiful! I could totally see many uses for that!

@Dez384
Copy link

Dez384 commented Nov 4, 2024

I've made a macro quick fix for this issue; it can be found in the Cosmere Useful Macros module.

Here is the text for the script:
Sphere Lantern Picker.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature
Projects
None yet
Development

No branches or pull requests

3 participants