League of Extraordinary FoundryVTT Developers

LOE

League of Extraordinary FoundryVTT Developers

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

Join

commissions

package-development

system-development

other-topics

workgroups

development

package-ideas

package-compatibility

pixijs-canvas-shaders

progress-reports

dev-guides-and-docs

ui-ux-sheets-forms

hooks

development-basics

manifest-plus

tools-and-workflow

active-effects

wiki

dnd5e-dev

package-stewardship

swade-dev

typescript

starfinder-dev

lancer-dev

pathfinder1e-dev

foundryvtt-v10-research

coc7-dev

a5e-dev

v10-updatathon

svnsea2e-dev

package-jam-2022

blackflag-dev

api-announcements

New Interpretation of Dim Light

I want characters in my system to only be able to see out to a certain radius ("Nightsight Radius" stat) except in Bright Light. That is, they can see in an area that meets any of the following: - within Darkvision radius - within Bright Light - within Nightsight radius AND Dim Light ...

Package and compendium pack IDs may only be alphanumeric with hyphens or underscores; unable to DEL

Somehow in one of the earlier versions of FoundryV13 I managed to write an invalid flag (has an equal sign). I thought I fixed it with a -=, but it managed to slip thru to one of my system users. Now i can't delete the actor. ```js // Get a list of invalidActors const myActors = []; for (const id of game.actors.invalidDocumentIds) { // have to remove the offending flag before we can get the item...
No description

NumberField represented by checkboxes

Hello, I'm developping a system in V12 with AppV2 and for the character sheet i'm trying to do a numberField that can be set by checkboxes (I'm trying to have multiple icons represent the 5 levels, representing how much you stacked already) Is there a way to do it already with foundry system ? formGroup only provide an input for numberField. I saw that you could override the inputs, but what would be the proper way to make each checkbox set the value to a certain value? Should i make some sort of actions and then pass parameter to it and make it the one that alter the value ?...

Non-gm users updating combat documents?

Hio. Working on an implementation of the Doomsong system, in which actors pre-plan their actions at the top of a combat round. My question is as follows: What is the intended method of allowing users to have ownership of combatants for tokens they have ownership of? I am attempting to store planned actions on the combatant itself (it seemed convenient) within the .system, and though this works great for the GM, I discovered to my dismay during my first playtest that players do not own their own combatants. Updating initiative works but my system does not use initiative. permission is returning 3, this appears to be rejected in the backend. Is there a workaround for this? Or a solution, rather. I'm well aware that the easiest workaround would just be to jam this data back into the actor's system data but isolating just felt so elegant at the time....

New FoundryVtt Dev, I want to adapt a system, where to start?

I'm here looking for some help. I want to adapt a system I play regularly, and despite my current JS Experience, I have absolutely no FoundryVTT Development experience. While I see the Boilerplate tutorial, I'm slightly worried because it seems a bit out of date, while I want to make that system up to date with the latest FoundryVTT versions (Aka v13 currently). My main goal here is to adapt said system, and the wiki confuses me slightly due to how many resources seems to be made for pre v13, or even pre v12 for the main tutorial I read, the Boilerplate tutorial....

Actor Item not updating but the world item will update

Ok, So I feel like I am doing something wrong.. I am using Appv2 for a new system I am designing. I am using the boilerplate v12 setup. I have a selectOptions that looks like this ```html <select name="abilityType" class="abilityType"> {{selectOptions abilityOptions selected=system.abilityTypeValue localize=true}} </select>...

The type of a Document cannot be updated with ==type

In v12 I can do this
await actor.update({[`type`]: "npc"})
await actor.update({[`type`]: "npc"})
In v13 I get the errors which suggest using == or recursive: false. Neither of which seems to work. What is the proper way to change a document type in v13?...
No description

New to foundry system dev

Hey all I'm taking over the 3.5e system development and was tipped off about this place. I'm working to rewrite our system for v13 with typescript support. While I'm sure I'll come back later with specific questions, any advice for a newb? I'm a professional C#/ JS (React) developer in my professional life. I've developed 1 module (not released), to add a bunch of custom functionality to token movement and custom form applications to track extra data. I'm mostly interested in developing in TS for foundry and learning how to work with foundry specific classes and systems...

New developer and need some basic help

After much tinkering and following multiple tutorials I still can't get my system to show a custom sheet. All the tutorials I have come across are out of date or incomplete, so I'm sure I'm missing something basic. If anyone knows a good tutorial that shows how to build a system from scratch that would be great. Short of that, just looking for what is required to get a custom sheet to show up in a new system. Just the bare minimum will help at this stage since I'm just trying to figure out how things are linked and talk to each other and it seems that has changed over the versions....

Problem using Tagify on boilerplate

Hi all, I'm trying to use Tagify on boilerplate. I created a field in an item to add tags. I'm trying to add the call on the onRender of the item-sheet.js but the chips are not working. Does anyone had this kind of challenge before?

BaseData vs DerivedData

I have been thinking for a few days about the difference between BaseData and DerivedData. Both, as I understand, are for calculating properties that are not persisted in the database, either coming from the configuration or calculated from others. The point is, when to use one or when to use the other? What is your opinion?...

Trouble using actor.update with a DocumentID field

Hi All, I have a link from on character to another with a doucment ID field. When I drop on actor onto the other, I want to make the link....

Custom Classes by Item Type?

Hello Everyone, I’m trying to set up custom document classes for items based on their type. For example, a Weapon class if type === "weapon", Armor class if type === "armor", etc. I know it’s pretty straightforward to assign different sheets using Items.registerSheet(..., { types: [...] }), but I wanted to know if the document itself could be a custom class, not just the sheet. Any guidance is appreciated....

Problems updating to v12

Hi guys, I am still working on the same system, using v11 (as that is the version I have installed due to some other games I am running) and starting from the boilerplate system builder using Data Models. My goal however has always been to get this system running on v12, so today I installed all my coding software on another machine along with the latest version of foundry and transferred over my project, only to find that I cannot even open it - base foundry does not even load. On examination of the console, I found the following error: Uncaught (in promise) Error: A DataSchema must be an object with string keys and DataField values. After fiddling around for a while, I found out the following: first, if I remove any of the files containing my Data Models, I can load base foundry, but none of the other Data Models load either; second, if I remove the line in the _module file that exports any of my Data Models, foundry also fails to load and I get the following error:...

Where/how are Active Effects calculated

I have an AE that may boost a characteristic by a fraction. I want the boost to be the floor of the sum of all the AE's. Where are these calculated so I can override the calculation? I was thinking about using a fake/virtual prop: system.characteristics.str.boost instead of system.characteristics.value as the key.

Extend ActiveEffect.changes

How do I extend the ActiveEffect changes array. I want to include additional details for my systems AE changes. I updated the UI to allow editing, but they don't save into database, likely because of a schema issue. My defineSchema knowledge is pretty much non-existent, so some pointers there may be helpful. Where I'm going with this: I currently have several AE to increase BODY (for example) that expires after 12 seconds. A second increase before the 12 seconds could be a separate AE. But there are crazy people who will increase their BODY every second, making for lots of AEs, which eventually make the token hard to see. I'm trying to consolidate all the increases into a single AE, then expire each change as appropriate. This means I need to store some extra info in the change array....
No description

Allowing system scope in game.settings.register

Just getting started with your type system again and trying to figure out how to get game.settings.register function to stop complaining about my system scope not being assignable to the namespace variable. Do I need to define it somewhere else?

Array keeps resetting

Hi, I am very new to system development/programming and trying to put together a system for an rpg that does not currently have an implementation by starting from boilerplate. Due to the requirements of games I currently run on foundry, I am using version 11+. I am trying to store player-inputted values in an arrayField of variable length determined by player level, attached to the player characters datamodel. The idea is that players can only store a limited number of values, before they need to replace one. However, every time the Document updates, the array resets to empty. How can I get the array to persist? What am I missing? The datamodel declaring the array ```cs ...

Extends Chat Message, issue with model data

I intend to extends ChatMessage to add a field to the schema. and then add it to the renderTemplate data to be shown. But during the "getHTML" function the value that I added to the schema is always empty. Do I have to setup something else to make it reach getHTML with the proper value ? The class extending the ChatMessage...

Adding custom Roll class to CONFIG.Dice.rolls

Hi guys, Currently re-implementing an abandoned system to be able to use it in Foundry 11+. I have a custom created Roll class that extends Roll<D> as defined in the foundry-vtt-types module. I got the class to actually roll the way I want but no I'm focussing on the Chat Message it should give out. However for the system to be able to recreate the instance of my roll object from the provisioned data I probably need to configure the CONFIG.Dice.rolls to accept my custom class, because if I do not the message holds a rolls variable that holds the following as an array element
0: "{"class":"RollSR6","options":{},"dice":[],"formula":"5d6cs>=5","terms":[{"class":"Die","options":{"flavor":null},"evaluated":true,"number":5,"faces":6,"modifiers":["cs>=5"],"results":[{"result":4,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":1,"active":true,"success":false,"count":0}]}],"total":0,"evaluated":true}"
0: "{"class":"RollSR6","options":{},"dice":[],"formula":"5d6cs>=5","terms":[{"class":"Die","options":{"flavor":null},"evaluated":true,"number":5,"faces":6,"modifiers":["cs>=5"],"results":[{"result":4,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":2,"active":true,"success":false,"count":0},{"result":1,"active":true,"success":false,"count":0}]}],"total":0,"evaluated":true}"
...
Next