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

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}"
...

Check box not linked to the property

Hello, I am using boilerplate but currently I am having an issue with linking my checkbox using handlebars. I have created json property equipped for weapon. I have created a listener but in no way I am able to make it work. So the in the actor sheet box automatically unchecks after update. and console log does not register anything Can anyone please give me advice on how to solve this or show how the handlebars should be working for checkbox on Foundry? This is my .hbs file code snippet...

Having a issue with item sheets

the names of the spaces for the item characteristics aren't showing, a very big line of text is showing instead im not experient enought in html to understand what im doing wrong....
No description

Would a Dialog Window be enough for this functionality?

In this system I'm trying to implement on foundry you roll a pool of dice and keep 2, pretty simple. The problem is that you won't simply pick the 2 highest, you are allowed to choose which dice to keep since the discarded dice interact with the system by generating special effects. I thought of showing a dialog window with each individual dice were you'd mark a checkbox for the chosen dice, and then print it on chat, but I don't know if it's possible to handle data that way inside a dialog....

How do I make an @variable

Hi all, I am new to system development. How do I make a @variable that can be used in dice formula. Do I have to write code to check for the @variable and swap it out. Or is there an easier way to make a global variable on a character sheet? I feel like this is a dumb question so I apologize if it is. So for an example I have a power die variable on characters this power die can be added to weapon damage. So I was hoping to be able to added it directly to the formula using an @ symbol like dnd5e does....

Incrementing items by drag and drop

I'm trying to handle incrementing item quantities rather than adding new items when you drag and drop an item to a character sheet, as long as the item already exists in their inventory and is of the right type. I've set up a hook in my ready hook section (using the Boilerplate as a base) but now it's both incrementing the existing item and adding a brand new one. ```JS   Hooks.on("preCreateItem", async (item, options, userId) => {     const actor = item.parent;...

data from onchange event

Hey quick question, i feel like an idiot. I'm used to angular as a framework, and handlebars obviously is much more toned down compared to it, so I can't seem to figure out the correct way to do this: I have a couple checkboxes representing a numeric value, so if i check the third checkbox, the value is set to three. If I check the second checkbox, the value is set to two, ecc. How do I apply a value to the individual checkboxes that is included in the event object passed to the onchange event?...

Modeling items that have items?

I'm trying to develop the Panic at the Dojo system, and I'm unsure how to implement one feature. In this system, you create "Stances" by combining a Style and a Form; these then can be assigned to a character, and they can switch between them. I'm not sure how to model that in Foundry's default systems....

Getting quench running

Having some trouble getting going with Quench, if anyone can point me in the right direction. I feel like I must me missing something simple. I've installed the package into my dev environment, and I get the UI in Foundry and the example tests run. In my system module code, though, I can't get it running. I've copied in the nonsense tests into ./tests, a directory at the root of my project. I've imported registerExampleTests into my .mjs entrypoint and tried to register the hook like:...

Issue with system json file

Hey there! I am trying to figure it out why is my system json file is screaming at me that is not parsing correctly. I hope that is a simple mistake on my part but I can't see it Link to the system.json file. ...

Accessing data in active effects via @ symbol

I noticed other systems are able to expose certain bits of data and access it in active effects eg: attribute: system.armor.ac mode: add value: @str.value However I can't seem to get the same functionality in my system. I have an actor data model module>data>actor.mjs file that just exports an actor class that extends foundry.abstract.TypeDataModel I have an actor document module>documets>actor.mjs that extends the actor data model...

multiple token attributes

Greetings! I am trying to start developing system that has multiple attributes but they are all relevant to the game and while being on the battlefield. Thing is that you can't seperate them into primary and secondary since they are three attributes that are relevant to the character. I do know that cypress has a same issue on this issue but would rather ask here on how to do that....

effect in "add" mode continually re-applied to actor/sheet

I have a datamodel value of type new fields.ArrayField(new fields.BooleanField(), { initial: [false], }) And I have an effect in "add" mode that adds another false to the array. Which seems to work. however, when i close and re-open the character sheet I see that the array is now 3 [false, false, false]. Other datamodal attributes eg: number don't behave this way. ...

Handlebars looping through getters

Hello, I'm trying to loop through and objects property including its getter, but since Handlebars 4.6.0 this is not allowed unless allowedProtoMethods is set to true (https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access). How/where can I set that option? For context I have a nested object to represent ability scores and accessing deeper sub stats with getters, and to list out the ability scores I'm looping through them. I can always output them each individually, but have a loop to do this would be ideal....

SchemaField with increasable max?

I'm trying to understand the new schema fields and have a situation where I sometimes want to increase the "max" value of a field. Is that possible? I have this ```schema.carryLoad = new fields.SchemaField({ value: new fields.NumberField({...
Next