League of Extraordinary FoundryVTT Developers


League of Extraordinary FoundryVTT Developers

Join the community to ask questions about League of Extraordinary FoundryVTT Developers and get answers from other members.


































How to add buttons to the ProseMirror Menu?

The title is only part of the question, I have already added a button and dropdown to ProseMirror, that inserts text at the cursor. That works fine and all, however I'd like to be able to wrap the selected paragraph in a div that has a custom css class. (similar to the Fonts wrapping the elected text in a span with custom styling) I have inspected the foundry code, how they did it. However they use functions that aren't available from a module scope (at least not that I found them) I also couldn't find any modules that add similar functionality to the PM Editor... is that just not possible for a module?...
try something like this ```js Hooks.on("getProseMirrorMenuDropDowns", (menu, items) => { const wrapIn = foundry.prosemirror.commands.wrapIn; if ("format" in items) {...

How to hijack the place measured template?

Not sure if this is the right place to post this. I'm working on modifying a couple of modules to make foundry on mobile phones work well (for 5e at least). I've made modifications to simplemobile by @Handyfon and enhancedcombathud by theripper93. https://github.com/Handyfon/simplemobile https://github.com/theripper93/enhancedcombathud ...
No description

Do some copy paste, follow the guide, add a new coustom dice, earn some money.

I am looking for someone who would make a minor modification (adding +1 die) in to an already existing module. I have a guide how to do it but I dont have the patience to set up github and a yaml project. If someone who already has it would do it for me i would pay for it. The guide: https://github.com/BernhardPosselt/foundryvtt-special-dice-roller/blob/master/docs/Roller.md Please PM, me if someone is interested....

change token lighting based on changing value on actor or an Effect embedded on the actor.

I'm attempting to add a feature to my system that makes the token glow when it's lightsaber/generic laser sword is ignited. I was able to make a custom token document class that can override the light settings, but that only updates the light settings on refresh or move. is there some way to trigger a redraw or is there a better place to implement this logic? maybe i should make a custom token class.
Thanks for your response. that resembles my first attempt. what ended up working is overriding the _onUpdateDescendantDocuments method on the token document, resetting the tokenDoc, then calling updateLightSource on the token itself. i think i had to override the _onUpdateDescendantDocuments on the actor as well to make sure it picked up the changes.

GitHub Actions on release

Hi there, hope I'm at the right place. I'm actually new to actions on GitHub, trying for release- depending. I have some private (because premium module) repos, all went fine on this action (on 5 other repos with the exact same parameters), but here, it produces an error (see attended screenshot)...
No description

hook preCreateToken update token name

I'm trying to update the token name when dropping a token on a scene. I basically have something like this ``` Hooks.on("preCreateToken", async function (tokenDocument) {...
so switching the hook to createToken and keeping everything else the same seems to get the functionality i'm looking for.

Error on package install

Error message
Error: Cannot read properties of null (reading 'protected')
Error: Cannot read properties of null (reading 'protected')
Does the lang file have a different directory name? The manifest has lang, the repo has languages.
No description

Newbie question on scope

Hey there, total newbie here. I'm a complete amateur to programming. I've completed the todo tutorial for foundry development, but I believe the module I'd like to make is better suited to the game settings scope rather than the flag scope. It's for Markov chain based weather as found in Izirion's Enchiridion of the West Marches. Does that sound correct or am I starting down the wrong path? Also, do you know any good modules that write game settings like this? I think it would help to read pract...

Having trouble to get scripts loaded

Trying to make my first module and I have troubles getting anything loaded in Foundry. Here is what I have done so far: 1. Made the module using the Foundry admin UI view. 2. Added that module to one of my worlds. 3. Created a script to scripts/ folder of the module (I edit these files directly in the module folder)....
You dont want to log out, you want to shut off the world entirely.

Newbie questions on testing.

Hi all, ive put together a simple module for PF2E that allows a user to favorite a spell, feat, item or action and add it appears at the bottom of the character sheet sidebar. This is my first module and I wondered what the procedure is for testing. Do I simply release it or is it best to get some people to test it first?
it is always best to test it first. You should at the very least do so yourself. Either manually in foundry or through unit/integration automated tests. If you can find some people to help you test it, that is even better, since they will likely interact with it in ways you didn't think to. Always test before release 🙂...

Minimise Document using Prototype

Quick question, I've got no idea what I'm doing so please excuse my ineptitude. Say I have a document, e.g. a wall: ```json { "light": 20,...
From a post elsewhere: foundry.utils.diffObject(WallDocument.prototype.constructor._schema.initial(),canvas.walls.placeables[0].document.toObject(), {inner: true})...

Newby accepting advice on the Foundry API and Module Development

Heya,im very new to Module development for foundry and im suuuuper rusty in the codding department but im motivated to make a tool for a custom system that i love and id welcome a bit of help (im already not super experienced and on top of that im really rusty so sorry for very dumb mistakes and questions)

Newb looking for advice on creating Compendium via code

I am new to Foundry and trying to figure out if it will be a good fit for my game. I have a fair amount of custom content that my groups uses and I want to create a content mod for it. I know I can use the in game Create Compendium and Create Item features but I have a fair amount of content and wanted to try creating it via code. I have a moderate amount of experience writing JS and JSON files and it sounds like a fun project to try out. However I haven't been able to find many resources for creating the Compendium with code. The documentation from Foundry only talks about using the in game options and looking through some of the mods that add content wasn't enlightening. I was hoping someone could point me at a guide to get me started on this, or tell me if I am completely barking up the wrong tree and this really can't be done. Thanks!...

Beginners help with doors

Hi foks. Apologies if i've posted this in the wrong place. I am totally new to working with Foundry, although not new to working with Javascript. I want to write a macro that will allow me to open an adjacent door with a key press instead of the mouse. Does anyone know if this is possible?... and a few pointers into which object I need to interact with would be so helpful. Im guessing " canvas.walls.doors[0]" or something? I suppose I just need to change the door "state" from closed to open?...

How to run code from a specific user

Hi, I have the function foo(bar) and when you run this function it opens a window with some details on...

About: #package-development

This thread is not for discussions about Foundry package development, but for discussing the purpose of this forum.