#Boilerplate System

1 messages · Page 1 of 1 (latest)

minor tundra
#

While not exactly an installable, DIY-system, The Boilerplate System by@unique crane has been a long-running project that has spawned numerous game system implementations that we've approved for listing on our package repository. It seems only fitting that it have a channel of its own for discussions related to its updates and workflows.

wheat plume
#

🎉

warm cave
#

The boilerplate system has been invaluable in letting me make the system im working on now, whenever i wonder how to do something, i pull up the gitlab page and dive into the source.

#

Very cool stuff

unique crane
coarse phoenix
#

@unique crane
On 01. Getting Started I changed line 22 from generator to generate since generator produced this error on my machine

npm ERR! 
npm ERR! Did you mean this?
npm ERR!     npm run generate # run the "generate" package script
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: %localappdata%\npm-cache\_logs\2024-03-29T16_04_46_459Z-debug-0.log```
unique crane
#

I also think there's a few references to the old foundry-generator npm package I created back in the day that I need to remove. I'm pretty sure I caught them all in the wiki, but the Gitlab page itself needs an update from my end.

coarse phoenix
coarse phoenix
#

@unique crane I have one question that is not yet explained in the guide. You do give the option to create the actor and item structures inside the new System Model Data.
And since I chose the glamorous way to headaches I chose to do so.
Do I still need all the lines in the template.json or does the config.mjs do the job now?
I tried to compare it to the way the DND5E System was set up and do find some similarities. But man... Right now I absolutely don't know jack 😅

wheat plume
unique crane
#

You can see the alternative files for data models in the src/datamodels/ directory. Those are what will replace the matching files in the normal directories if you use the generate command.

coarse phoenix
#

oh look at that... I thought I ran the generate command with the choice of using the data model version but I see that the template.json did not get replaced... I'll run the command again and see if I did something wrong

unique crane
#

Yeah, if it worked template.json will only be a few lines

coarse phoenix
#

alright, seems like that does not work

#

> boilerplate@2.0.0 generate
> node src/generate-boilerplate-system.mjs

? Enter the package name of your system, such as "my-system" (alphanumeric characters and hyphens only): fabula-ultima
? Enter the formatted name of your system, such as "My System": Fabula Ultima TTJRPG
? Enter the name of your system for usage in JS classes, such as "MySystem" (alphanumeric characters only): FabUlt
? Enter the name of your system for usage in constants, such as "MY_SYSTEM" (alphanumeric characters and underscores only): FABULT
? Use DataModel instead of template.json? Yes
Success! Your system has been written to the fabula-ultima/ directory.
PS %localappdata%\FoundryVTT\Data\systems\boilerplate> ```
#

template.json still looks like this

unique crane
#

Hmm, I would double check that you’ve got the latest version of Boilerplate. I put out a release earlier this week that fixes a bug with the generate command on Windows.

coarse phoenix
#

used the master.zip from march 26th

#

alright, you changed that 1 day after 😄

#

got myself a new zip file. worked now

undone quartz
#

It looks like some of the example DataModels have label properties defined in schemas. That should probably be cleaned up, as it's a better practice to localize and associate labels in memory instead of saving them to the database

wheat plume
#

Especially now that you can define the label as part of the field itself, in prep for v12

unique crane
#

Good catch, I missed that in the code review for them. Feel free to submit an MR, or I can take a pass at it later this weekend.

unique crane
wheat plume
#

Yeah

wheat plume
#

but otherwise looks good. You'd need to rewrite how you're setting up the context so that way you've got the objectified-system rather than the actual pointer

unique crane
#

Good point. I was going for a lift and shift, but that’s render logic IMO and should be moved.

wheat plume
#

iirc the appeal of the existing actorData.system is that you're already pulling from the upstream toObject(false) call

unique crane
wheat plume
#

as of v10 they removed derived data from toObject and only iterate through the keys present in the schema

#

one option is to for stuff like abilities to just get their own piece of the context pie

unique crane
#

Hmm, I’d rather avoid that if possible. It feels like duplicate work and more places for devs to accidentally miss when doing version upgrades X months down the line.

#

I’ll piddle with it and see what I can come up with. Haven’t tried cloning the object yet or anything else to simplify the object aside from toObject()

wheat plume
#

One more advanced option would be to override one or more toObject implementations

#
toObject(source=true) {
  if (source) return super.toObject(source)
  const data = super.toObject(source)
  // figure out a way to functionalize prepareDerivedData calls and re-use them?
  return data;
}
wheat plume
#

@unique crane what if you used the {{lookup}} helper

wheat plume
#

What dnd5e does for spell schools is it stashes CONFIG.DND5E inside of context then uses lookup to turn the @key into the label and icon

unique crane
#

Is that a core helper? I couldn’t find it on the API docs.

wheat plume
#

It's built in to handlebars

unique crane
#

Oh, nice. I’ll have to play around with that.

unique crane
#

I've been piddling around with this and overriding it is super finicky because of how SchemaField works. I think I'm just going to implement an additional toPlainObject() method in the document class that looks something like this:

toPlainObject() {
  const result = {...this};

  // Simplify system data.
  result.system = this.system.toPlainObject();

  // Add items.
  result.items = this.items?.size > 0 ? this.items.contents : [];

  // Add effects.
  result.effects = this.effects?.size > 0 ? this.effects.contents : [];

  return result;
}
#

Also probably need to implement that in the data model as well in case someone does document.system.toPlainObject()

wheat plume
#

so some version of

BoilerplateDataModel extends foundry.abstract.TypeDataModel {
  toPlainObject() {}
}

// everything then extends BoilerplateDataModel
unique crane
#

Yeah, something like that. I had it in the actor base model and item base model, but it could go in a parent class instead to reduce duplication.

#

Also putting it on the document class itself so that you could do either document.toPlainObject() or document.system.toPlainObject()

#

The data model version would just be return {...this}; since there's not items or effects to worry about.

unique crane
wheat plume
unique crane
#

I think I'm going to make one more pass at this before merging it, following the discussion the other day where Mana pointed out that the spread operator wouldn't be able to handle nested instances. Given that toObject(false) is considered a legacy path now, I doubt I'll keep the toPlainObject() around.

coarse phoenix
#

I'm looking forward to see the actualized version.
Following your system I learn a lot about system development. But some things feel too advanced for me to come up with that on my own ^^

wheat plume
#

@unique crane did some digging tonight in how Foundry's data model works - something to deal with in toPlainObject is that any instance of an EmbeddedDataField, e.g. prototypeToken, is going to be a class instance

faint silo
#

Is this.actor.items.get inside a actor sheet async?

#

I'm getting ReferenceError: undefined. Cannot access 'item' before initialization when calling it. But logging it to console returns the object as expected the line before the error.

wheat plume
wheat plume
faint silo
#

I'll check it. But I don't understand how can it be early. This is a edit button in a actor sheet, just want to open the item sheet. It's working everywhere else, even in the same sheet, but not on one particular item type.

wheat plume
#

Could you provide more context in #system-development? This isn't really about Boilerplate specifics

faint silo
#

Oh man, I thought I was there 🤦‍♂️

median brook
#

Hey folks. Posting this now in the correct thread.

In character.mjs's defineSchema, the example places Level in schema.attributes and your D&D stats in schema.abilities. I was wondering if there are any guidelines or rules about what kind of data goes in which - I don't know enough yet to know if the division between the two is load bearing, or if mod developers would have expectations as to how things are categorized.

In the system I'm working on, the equivalent of D&D stats are called attributes, so I'm guessing I'm going to need to rearrange things anyway to keep my own sanity while developing.

unique crane
#

My original generator back in the Foundry v9 and before times actually had an option to leave those out altogether, but I haven’t reimplemented that in the new generator script yet.

median brook
#

Roger that. Thanks!

ruby dove
#

Are you anticipating any major changes for Fonudry v12? I'm deciding whether I want to use boilerplate to spin up a system soon or wait for v12 updates.

wheat plume
#

App V2 is an obvious one

#

But you've also got the abolition of template.json for the data model version of the system

ruby dove
wheat plume
#

Two main reasons to like data models

  1. Stronger client side data validation
  2. Proper polymorphism via the system field
#

There's some field specific benefits — better handling for arrays and I like how smoothly ForeignDocumentField works — but those are fairly ancillary to the above two

ruby dove
#

Nice. If you were in my shoes, would you start using boilerplate now? Or would you wait until some of the v12 changes were implemented first? Maybe migrating to the new v12 features won't be too bad?

wheat plume
#

I figure once Test 1 comes out I'll file a MR for the v12 updates

#

The reality of how Foundry does development is a lot of really key details don't get filled in until very close to release, so you either scramble to match their Test1/Test2/Stable or just let it ride a bit

#

Basic example: ActorSheetV2 and ItemSheetV2 aren't available yet, so those key building blocks of a functional AppV2 based sheet class aren't ready yet

ruby dove
#

That's really helpful context, thank you. The main reason I'm looking to switch to boilerplate is that there's serious html/css tech debt in my current project (a fork of an abandonware system). I'll probably hammer away at some of the stuff I want to do that isn't related to the character and item sheets. And I'll switch once the App V2 updates are in.

wheat plume
#

Yeah, the Document classes aren't meaningfully changing

#

The only v12 data architecture change is moving the last bits of data from template.json into system.json for the Data Model version

#

Another piece of Boilerplate that we'll need to work through is I'm sure @unique crane wants to add support for non-hbs rendering engines, but those packages are still being written

#

Tbh the more I look at App V2 the more it's clear we won't see the full benefits for a few months until all the devs can properly build on top of it and work through stuff

ruby dove
#

Cool. Maybe I'll give it a shot soon and target v11.

unique crane
#

Other rendering engines would need to be optional variants like the current data model option of the generator script. With that said, I think the non-hbs rendering will likely be high level overview stuff initially, along with links to specific implementations as they’re created. The non-hbs setups are also more opinionated, as they’ll get into things like a compile step to compile the components used by Vue with something like vite.

ruby dove
#

I'm curious, is there a list of systems that started with this boilerplate template? I know they're out there, but it would be great to see a few examples.

unique crane
#

One of the easy to spot signs is if they take advantage of the grid CSS classes I ship with the system, like grid-2col for layout. The actor sheet’s getData() structure is also pretty particular and a good indicator of it.

#

For systems started prior to 2020, we typically either started from dnd5e or worldbuilding, though it was possible to start from scratch but not really documented.

wheat plume
#

So, up from the dev mines: It's likely that ActorSheetV2 will be much more bare bones than ActorSheet, in the name of more flexibility for systems to define their own behavior. I think that means Boilerplate should step up to provide some sensible defaults.

wheat plume
wheat plume
#

Making good progress on v12 updates!

dusty kettle
#

I want to override and customize the Active Effect's Config sheet, but I can't.
What am I doing wrong?
The code is as follows.

mysystem.mjs

import { MYSYSTEMActiveEffectConfig } from "./sheets/active-effect-config.mjs";
~
Hooks.once("init", function () {
~
  CONFIG.ActiveEffect.sheetClass = MYSYSTEMActiveEffectConfig;
  console.log(MYSYSTEMActiveEffectConfig.defaultOptions);

active-effect-config.mjs

export class MYSYSTEMActiveEffectConfig extends ActiveEffectConfig {
  static get defaultOptions() {
    return foundry.utils.mergeObject(super.defaultOptions, {
      template: "systems/mysystem/templates/effect/active-effect-config.hbs",
    });
  }
}

In the console result from console.log(MYSYSTEMActiveEffectConfig.defaultOptions);, template returns the correct path, but calls the core html file when opening the Active Effect's Config screen.
Help me.
This is a machine translation, so sorry if it's a weird sentence.

dusty kettle
wheat plume
#

Implementing my own DragDrop in the Actor and Item sheets because core software isn't doing that

distant hamlet
#

Hey folks, I am just now dipping my toes into Foundry because some of our players have asked for Foundry integration for our game. I'd like to create a character sheet and tokens, but I am having trouble figuring out just how to make a character sheet. When I click "Create Actor" as many tutorials suggest to start on the character sheet, I get a message suggesting I chose a template, but there are clearly no templates for a new game. So how do I create a template and where do I put it? Can I upload a fillable PDF, etc?

wheat plume
jovial inlet
distant hamlet
distant hamlet
wheat plume
distant hamlet
#

I'm not opposed to it, that is, having someone on my team take a look, but I need to be able to hand them the information/tutorials they need to make it as easy as possible. So far, Foundry seems not immediately intuitive, so I'm trying to do as much legwork as I can on their behalf.

distant hamlet
somber portal
#

Okay, a little rant here (and maybe someone to lend a helping hand.) Two days ago I tried to code Exalted 2nd edition into Foundry because using Discord and dice bots does not seems to vibe well with the group. So, since I am the player with the most time on his hands. I volunteered.

I have a basic grasp of HTML, CSS and a newborn in java. I checked the tutorials on the wiki and, well, I am at a loss.

Where should I actually start? Making a character sheet? Make data for skills and dice rolls?

Having someone to share their workflow would be goodsend at this point.

wheat plume
#

Foundry uses JavaScript

somber portal
wheat plume
#

And then just to check, were you using this guide? There's unfortunately a lot of other, older and out of date guides elsewhere on the wiki

somber portal
#

Yes, that's the one I am using at the moment, but I find it glosses over a lot of things. I also know it's probably my lack of knowledge, too.

I check the files of there system also to how they do things, but that just confused me more. 😛

wheat plume
#

If you could elaborate where you're getting stuck that would be helpful

#

@somber portal I also know some people have found this guide helpful

somber portal
wheat plume
#

Ah yeah the data model almost entirely replaced template.json

somber portal
#

Yeah, I was wondering how to input skills and stuff, but I need to create Schema for them before putting them in the character sheet, which was the problem I was having for the past two days.

wheat plume
#

I'll be honest the data model option is by far the more complicated version

somber portal
#

Probably, but by boucing off idea with you, I figured it out a little, thank you! 🙂

wheat plume
#

Big feature upgrade coming in the v12 branch: Full utilization of the new ActiveEffect sort field

#

including handling for the mixed case of "Active Effects on both the original actor as well as items"

coarse phoenix
#

@wheat plume was Boilerplate v12 ready?

#

Using the DataModel way?

wheat plume
coarse phoenix
#

nice

wheat plume
#

currently have a PR to upgrade its sheets to AppV2

coarse phoenix
#

what's a pr?

wheat plume
#

Pull request

coarse phoenix
#

Ah.. okay. Yes. Didn't think of git

wheat plume
#

everything is git all the time

coarse phoenix
#

now that v12 is out I try to start freshly from boilerplate.
when I fired up foundry with the my newly generated system, I got the following message for the boilerplate system, and my system

The system "boilerplate" is using "gridUnits" which is deprecated in favor of "grid.units".```

I found these inside `system.json` and changed them to the version with the dot inbetween.
But now i get
`The "Fabula Ultima TTJRPG" system's manifest contained the following unknown keys: "grid.distance", "grid.units"`
wheat plume
#
grid: {
  distance
  units
}
coarse phoenix
#

oh, I see

quick stirrup
#

Is there a good way to attach items to other items in this system?

#

I'm looking at some systems that have done it before, and I'm thinking about trying to copy over some of that, but if I'm just missing a function or something I'd love to hear about it

wheat plume
#

You're running into a core Foundry data architecture limitation

#

Dnd5e does it by having a container property that points to another item in the same collection

quick stirrup
#

Avatar Legends seems to have an attachment system that works the way I'd like it to. But it's obvious whoever wrote it is leagues ahead of me so I'm not sure I'll be able to reverse engineer it

#

Figured I'd throw out a line on if there was some basic function, looks like I'm mostly SOL lol

wheat plume
#

In theory the rendering logic isn't that hard

quick stirrup
#

I've read your rendering doc a few times, it still escapes me on how to utilize the knowledge to it's full potential

#

I'm sure after a few more weeks/months something'll click

wheat plume
#

You just wrap your item display in {{#unless item.system.container}}

quick stirrup
#

There's also the drag and drop functionality to put in place too, but I think I see what you're saying here

wheat plume
#

You also want the link doubled up on the container so that you can display there

quick stirrup
#

What's doubled up link mean?

#

I may know what it is but never heard the name

wheat plume
#

Contained item has a property pointing to its container. Contained also keeps a list of items it contains.

#

You'll need to sync your updates to maintain those together

quick stirrup
#

Hmm, alright

#

Thanks for the help! Seems like I'll need to research this from the ground up and walk before I run

wheat plume
#

It's complicated

quick stirrup
#

That does make me feel better about it haha

unique crane
#

Following up this post (#system-development message) from @trim hatch in #system-development:

Hello everyone, i am sort of new in the comunity. I was very interested in making my own system and was looking to start from https://github.com/asacolips-projects/boilerplate. my question here is, when i run "npm run generate" i ask for the version with data model but the folder src dont contain the data model folder... so did i do something wrong or am i just a little dumb dumb and i dont understand the concept at all?

This first thing I would try is cloning down a fresh copy of the Boilerplate repo and making sure you're on the main branch. Looking at it directly on Github, looks like the files are still present in src/datamodels/: https://github.com/asacolips-projects/boilerplate/tree/main/src/datamodels/module/data

#

Aside from that, if you can post a copy of your error message here, that will help me identify what's going on and debug it.

trim hatch
#

I downloaded the latest main version from GitHub, but my "problem" comes from using "npm run generate." I use it to change the filenames, but when I take the files generated in the build folder, I don't have the dataModel folder in src. It doesn't send any error, and since I'm new to using data models, I don't know if this is normal or not. In the worst case, I can just use the raw files and rename everything by hand.

wheat plume
#

My understanding is with the generator it pulls stuff down

trim hatch
#

your right, now i file like an idiot, but on i'm also happy :). well thanks for your help!

unique crane
#

Yeah, if you choose the data models option during the generate command, it will copy the files from src/datamodels/* into build/[my-system-name]/*. So you won't have a datamodels folder specifically, but they should be included where needed.

#

I believe the src/ folder itself will still be brought along, but only for the scss files in case you want to use those for your CSS rather than just writing CSS directly.

trim hatch
#

yes the src and scss are stil here. It just changed the mjs file's location.

#

once again thank you and have a nice day, you are amazing!

unique crane
#

You too, good luck and happy coding!

wheat plume
#

For those following along with my PR - @dense lake that's you - I just changed out the {{editor helper on the description and biography with the new <prose-mirror custom element

dense lake
dense lake
#
export default class BoilerplateItem extends BoilerplateItemBase

should be now called XxGear with the other changes you made (nothing is currently breaking due to it being default and renamed in _module, but still. 🙂

export default class BoilerplateGear extends BoilerplateItemBase
wheat plume
#

Thanks

dense lake
#

I'm refactoring the actor-sheet and item-sheet so "basic behavior" like drag and drop is moved into a base-sheet. (refactoring helps me better understand the code & I think its cleaner)

Any specific reason you added ActiveEffect to Features but not to Gear? And is it correct that the shown "Source" isn't fully working yet?

unique crane
#

Can you expand on the source thing? That sounds like a potential bug.

wheat plume
#

But yeah the reason for features is purely arbitrary

dense lake
#

v12 branch:

#

The effectData object in item-sheet _createEffect doesn't contain an origin parameter

#

target.dataset logs a DOMStringMap object, which doesn't contain the origin

#

btw, you also try to use target.dataset.type, which is undefined

#

Aha! I see the rootcause

wheat plume
dense lake
#

templates/item/effects.hbs is missing data-origin="{{@root.item.uuid}}" after line 22.

dense lake
unique crane
grand flax
#

I'm somewhat new to making systems and can't find where the variables are stored. I remember they used to be stored in the template.json, but I cant find them with the new data model.

wheat plume
#

Specifically by static defineSchema

grand flax
#

I found the ability vars being generated in the actor-character.mjs not sure where the others are, but now i know what im looking for. thanks

arctic harbor
#

Hello all, I've been pecking away at trying to make a simple system for a friend but I've hit a bit of a roadblock. I know I can give a line on a sheet the rollable class to make it a button that rolls, and I've modified the attributes to fit how they want it to work, but I can't figure out how to make something roll a script macro on click.

wheat plume
#

Does it need to be an arbitrary script macro?

#

Or is it just an existing function?

arctic harbor
#

Either or. I have it as a script macro right now but I could presumably turn it into a function pretty easily, yeah?

wheat plume
#

It's generally best practice to implement methods everyone is going to need directly into the code

#

Is it a long function or a short one?

#

The basic idea is in activateListeners on the sheet you use html.on('click', 'selector', callback)

arctic harbor
#

Pretty long. The macro makes a window where they enter a few numbers and then it does some math with it.

wheat plume
#

Selector is a valid css selector — the existing Boilerplate uses .rollable for example

#

Okay so you probably want to make the callback a separate function for readability reasons

#
MyActorSheet extends ActorSheet {
  activateListeners(html) {
    html.on('click', 'selector', this._callback.bind(this)
  }
  _callback(event) {
    // Do stuff
  }
}
#

The bind(this) is a JavaScript thing to make sure the context for the function remains the actor sheet rather than the event

arctic harbor
#

I'll give that a shot.

#

And I can replace selector and callback with whatever I want, right?

wheat plume
#

Yeah

#

I do recommend marking the function as protected with the leading underscore

arctic harbor
#

If I add the bind the sheet doesn't load right anymore.

#
activateListeners(html) {
    super.activateListeners(html);

    // Render the item sheet for viewing/editing prior to the editable check.
    html.on('click', '.item-edit', (ev) => {
      const li = $(ev.currentTarget).parents('.item');
      const item = this.actor.items.get(li.data('itemId'));
      item.sheet.render(true);
    });

    // -------------------------------------------------------------
    // Everything below here is only needed if the sheet is editable
    if (!this.isEditable) return;

    // Add Inventory Item
    html.on('click', '.item-create', this._onItemCreate.bind(this));

    // Delete Inventory Item
    html.on('click', '.item-delete', (ev) => {
      const li = $(ev.currentTarget).parents('.item');
      const item = this.actor.items.get(li.data('itemId'));
      item.delete();
      li.slideUp(200, () => this.render(false));
    });

    // Active Effect management
    html.on('click', '.effect-control', (ev) => {
      const row = ev.currentTarget.closest('li');
      const document =
        row.dataset.parentId === this.actor.id
          ? this.actor
          : this.actor.items.get(row.dataset.parentId);
      onManageActiveEffect(ev, document);
    });

    // Rollable abilities.
    html.on('click', '.rollable', this._onRoll.bind(this));

    // Drag events for macros.
    if (this.actor.isOwner) {
      let handler = (ev) => this._onDragStart(ev);
      html.find('li.item').each((i, li) => {
        if (li.classList.contains('inventory-header')) return;
        li.setAttribute('draggable', true);
        li.addEventListener('dragstart', handler, false);
      });
    }
    // Click event for Actor sheet's button.
    html.on('click', '.actorroll', this._pcskill.bind(this);
  }```
wheat plume
#

The short answer is there's a syntax error

#

Go to the top of the console, click on beforeDOMContentLoaded, and you'll see the error

arctic harbor
#

Should I have put it at the top instead of at the bottom in the inventory stuff?

wheat plume
#

What kind of IDE are you using?

arctic harbor
#

Kate. Basically notepad++

#

Found the missing parenthesis. The text doesn't highlight but that's a very minor issue by comparison.

wheat plume
#

Usually using an a tag provides better default styling for click listeners

#

It includes hover highlighting

wheat plume
arctic harbor
wheat plume
#

Yeah, replace div with a

arctic harbor
#

Perfect. Thank you so much!

wheat plume
#

Np

keen stone
#

I see in your branch @Chaos that your context adds

editable: this.isEditable,```
is there a reason this isn't isEditable: in the context?
wheat plume
#

Because I wanted to replace as little as possible in the templates and that's what AppV1 used

#

It's arbitrary, feel free to name it what you want

keen stone
#

my v1 used isEditable, so I guess if that was working I should leave it alone.

wheat plume
#

Final merges have been made to Boilerplate v12, it's now fully usable; however, wiki updates still need to be written

unique crane
#

To use the v12 and AppV2 version of Boilerplate, you can run the following to clone it and check out the v12 branch.

git clone https://github.com/asacolips-projects/boilerplate.git
cd boilerplate
git checkout v12
#

Wiki updates will likely be written as a new guide altogether that reorganizes the same content from the previous guide along with more material on the front half to ease getting started with Foundry. If there's anything in particular that tripped you up when you got started with the tutorial, let us know and we'll try to account for it in the new one!

keen stone
#

@wheat plume I have a system I generated from v12 to get access to the AppV2 implementation. I'm trying to convert an application I already have, can I just change:
dragDrop: [{ dragSelector: '[data-drag]', dropSelector: null }],
the dragSelector to something else?

wheat plume
#

yep

#

it was intentionally written to be easy to convert

keen stone
#

Ta

dense lake
wheat plume
#

in ActorSheet.DEFAULT_OPTIONS are you still overriding handler

#

12.328 added some more controls in DocumentSheetV2 that I implemented

dense lake
wheat plume
dense lake
#

I see I'm missing a lot more changes 😄

unique crane
# dense lake I see I'm missing a lot more changes 😄

Yeah, there were a few merged PRs, so I would just spot check those. Off the top of my head, the other things I tweaked this weekend were getting avatar changes on the sheet to work and some small tweaks to the CSS related to headlines.

#

I’ve also made some changes on a system I’m building with Boilerplate that I haven’t backported into it yet, like fixing scroll behavior if the description on an item is super long.

dense lake
#

yea I'll go through the git commit log manually

dense lake
#

Ok, I think I'm fully in sync again 😄 Nothing broke after manual edits hehe

unique crane
#

It's still pretty experimental since this is my first time using data models and AppV2 in an actual system, but it may be helpful just as a comparison. One significant difference is that I'm using an src/ directory and a build script, like with most of my other projects.

dense lake
#

Btw
What is the purpose of ActorSheet._processSubmitData ? I don't really see where this.actor.overrides is set and why it the submitData needs to be transformed.

unique crane
#

As for where overrides are set, I believe that happens earlier in the document process when effects are being applied.

wheat plume
dense lake
#

Ah I see now

#

the foundry Actor class has a overrides property

#

Hmm, if I debug a little bit, I don't think we really need to perform the for (let k of Object.keys(overrides)) delete submitData[k]?
See:

#

If I disable the effect:

#

Then the health.max is included as normal:

#

Ah I think that DocumentSheetV2._prepareSubmitData already does the necessary cleaning:

wheat plume
#

Set up an active effect that alters a number field on the sheet, then edit a different field

dense lake
#

thats what I did

#

the AE altered the health.max, and I changed the health.value

wheat plume
#

Hmm I wonder if it's because there's also the field disabling

#

That's a new addition by me not in ActorSheet

dense lake
#

Ah yes you're right

#

If I comment out, then the health.max gets send in the submitData

wheat plume
#

I think it's correct for Boilerplate to include both in this case

dense lake
#

Sure, but I added a comment in my own code to make me remember 🙂

#

in case I change #disableOverrides in the future

somber portal
#

I got a little problem, it's strange but not the end of the world, but if I do Like picture 1, I get the message in picture 2.

If I change to the appelation in picture 2 and open FoundryVTT it warns me that the names "gird.distance" and "grid.units" are not recognized by the system.

wheat plume
#

in this case, the new format is


  "grid": {
    "type": 1,
    "distance": 5,
    "units": "ft",
    "diagonals": 0
  },
somber portal
#

Oh, I guess I didn't download the right version! And I hd so much trouble setting everything up with GitHub 😛

I guess I can change the stuff in picture 1 to what you just suggested?

Or am I going to get other surprises?

wheat plume
#

Did you just get started?

#

The v12 branch totally reworks the Actor and Item sheets, and the reason it's not merged into main is the guide hasn't been updated to the reworked sheets

somber portal
#

Basicaly, I did nothing except minor changes to the system.json (like version and suff.)

wheat plume
#

ah yeah just download the v12 version

somber portal
wheat plume
#

the v11 versions still works in v12

somber portal
#

I managed to change everythin without issue. Thanks for the info ! 🙂

somber portal
#

Anyone as a good exemple of a system that use BoierPlate, I would lik to see an exemple. If anyone is willing to share 🙂

wheat plume
#

The point of Boilerplate is it's a starting point that can be molded based on the RPG system you're adapting

somber portal
#

No, not rally specific, I am mostly looking for exemple to know where to start. I amtrying to port Exated 2e to Foundry. I know there is a module for 3rd edtion, but it is not made with Boilerplate as far as I can see.

So I wanted to check out what somene else did to give a good direction to start with.

wheat plume
#

projects that start with boilerplate quickly diverge as people write their own stuff, plus we've updated a number of the internal stuff.

Usually, a good place to start is figuring out what types of actors and items you need

#

and then defining their data models/template.json entries

somber portal
dense lake
# somber portal No, not rally specific, I am mostly looking for exemple to know where to start. ...

Something important to realize: Boilerplate is a fully functional example system. 🙂

Best place to start for an MVP:

  1. Download boilerplate
  2. Use the npm generator to create your own system. It will be a copy of boilerplate with your own system name.
  3. Change the Actor/Item attributes so it has your own systems attribute schema. (important: keep it a simple attribute structure at first. Look at the simplest pdf character sheet of your system and recreate it.)
  4. Change the template html and css to prettify the actor and item templates.
  5. Change the initiative formula

Tadaaa 🙂
Important to read fully:

somber portal
dense lake
#

Just a double check, but if I look at the class structure, any Document/DataModel prepareXxxData() should always call super.prepareXxxData() correct? Shouldn't we add that to boilerplate as well, in case e.g. someone adds stuff to both actor-character.mjs and base.actor.mjs?

wheat plume
#

currently Actors and Items don't do anything in super.prepareData which is why it's left out

dense lake
#

yea I mean we use inheritence within the datamodel classes BoilerplateCharacter extends BoilerplateActorBase

but we don't call super.prepareDerivedData() within BoilerplateCharacter.prepareDerivedData()

wheat plume
#

oh yeah definitely should do that there

dense lake
wheat plume
#

yeah, good suggestions

dense lake
#

I need to put my //TODO refresh git memory at a higher priority 😅

median brook
#

Question on Handlebars as it's used in Boilerplate. In some of the hbs templates, #each is used in a format like this: {{#each system.abilities as |ability key|}} The Handlebars docs reference using @key, but don't explain using as. Is that a Handlebars thing that isn't documented, or something else?

I mostly got curious because the format has it as |value key|, and I would have expected it the other way around.

#

Somewhat related but different questions:

In actor-character-sheet.hbs, it loops through the default defined abilities to display on the sheet. The way it's doing it doesn't match the way explained in the Localizing Arrays of Labels section of https://foundryvtt.wiki/en/development/guides/SD-tutorial/SD13-Localization - it's instead using a lookup: {{localize (lookup @root.config.abilities key)}}.

I grok lookup. My questions are, can you explain what is going on with the @root usage and why we're going there instead of the system.abilities info we're iterating through?

unique crane
unique crane
#

Both the older approach in the tutorial and the lookup approach in the current version of Boilerplate will work, so it’s more of a preference thing than anything.

median brook
#

Ah! Gotcha. And you need to go to root because we're pulling the name of the localized string location, which isn't in that attributes object we're iterating on.

wheat plume
#

A lot of the old code leaned on toObject to get a clone of the system field, but with data models that doesn't work too good

hollow cave
#

@unique crane would you consider the V12 boilerplate branch with AppV2 stuff in a good enough state to use? (thinking of switching my side project over to that to to learn how it App V2 works)

wheat plume
unique crane
#

Yeah, the main thing you may run into are other parts of AppV2 that are missing and haven’t been noticed yet. One example was that actor avatars weren’t handled by default, but we pushed out an update last week to fix that. If you notice something while using it @hollow cave, feel free to submit an issue or PR.

#

The main reason it hasn’t been merged is that the accompanying tutorial needs an overhaul to make it useful, as it’s significantly different than the setup the tutorial explains.

arctic harbor
#

So I seem to be doing something wrong with custom status effects. Specifically ones using icons outside of Foundry's base set, as far as a few quick and dirty tests seem to show.

#

I can't paste the whole config.mjs but I'll paste a sample.

{
    id: "charmed",
    label: "Charmed",
    icon: "systems/dungeonpunk/icons/status/charm.svg",
    description: ""
  },
#

They appear fine as the host, but I can't join if I use a browser unless I remove all of the ones that are using icons from the system folder.

#

Or rather I can join but it just gets stuck at about 80%

wheat plume
#

You need an explicit height and width

#

So instead of style="height:512px;" you want height="512"

#

Please only ask in one spot or if you ask in multiple mention you got your problem solved

ocean tapir
#

Is V12 branch usable or there is still some stuff planned?

wheat plume
frozen fossil
#

Maybe I missed something in the chat or the wiki, but https://foundryvtt.wiki/en/development/guides/SD-tutorial/SD06-Extending-the-Actor-class refers to /module/documents/actor.js, while previous pages in the guide refer to actor.mjs.

Not really confusing when I dig through Boilerplate’s files (find . -type f -name actor.js ; grep -r 'actor\.js' * returns nothing) and determine actor.mjs is the correct reference.

Let me know if I missed something or if this is just something to correct in the wiki.

unique crane
frozen fossil
#

The wiki is only 11 confirmed, so I think I understand the inconsistency.

I was warned… 😉

wheat plume
#

Yeah we're about to do a big update of the guide for v12

frozen fossil
frozen fossil
#

I’ve been informed some of the language about development options are not options; npm is required.

unique crane
frozen fossil
#

Over in #system-development, I learned I’m hitting the brick wall at SD08 because I’m working with npm input scripts and not the actual built system.

#

So it’s technically still optional, but the wiki directions cannot be followed if it’s not used.

#

Well, I misstate that, so let me clarify. npm seems to allow for building either DataModel or template.json, but the statement “you cannot forego that” with regard to installing npm and running npm install and npm run generate is 100% accurate.

#

? Use DataModel instead of template.json? (y/N)

unique crane
#

That's a fair point and something we'll consider on the rewrite. With that said, the use DataModel step of the generate script pulls equivalent copies of files (ex: module/sheets/actor-sheet.mjs) and replaces the ones in the main directory with them. The tutorial doesn't make that clear however.

#

To be clear, this is helpful feedback and something I would like to update in the guide, so thanks for catching this!

frozen fossil
#

Just to clarify where this is all coming from:

  1. Gamer. Want to build a system to help friends run a game.
  2. Software engineer. I should not be allowed to write public-facing code documentation, because I will make assumptions based on the months I’ve spent learning and re-learning what I’ve written.
keen stone
#

I'm not sure asacolips actually wrote the tutorial, that might have been ChaosOS

#

Happy to be corrected either way

unique crane
#

If you want to use data models without using the npm run generate script, you can do this process:

  1. Clone the version of Boilerplate from Github: git@github.com:asacolips-projects/boilerplate.git
  2. Copy the folders from src/datamodels/ to the top-level of the directory and replace the original files. The src/datamodels/ directory is an exact copy of the relevant files and folders from the main repo, but using DataModel instead.
  3. Do the manual find and replace to rename "Boilerplate" per the guide.
wheat plume
unique crane
frank dome
#

Hi. I'm new with foundry and with the boilerplate system. Is there any reason why it doesn't use form input or form group helpers? I'm starting to use them in my bootstrapped system and they seem quite useful

wheat plume
#

and right now the templates are for both the template.json and data model implementations

#

if you're using data models feel free to use the helpers, they're quite nice

slate grove
#

Hello, I'm new to the boilerplate system. I have when I do npm install I have 2 high severity vulnerabilities that are displayed is this normal and I can override or I did a bad intallation. I precise I have cloned the version github.

wheat plume
#

I'm not sure if @unique crane has dependabot configured

wheat plume
#

You can run npm audit fix safely

slate grove
#

okay thanks

#

I thought it might break something thanks for the help

wheat plume
#

Let us know if it does, but I suspect this is just because Boilerplate doesn't have dependabot to update stuff

unique crane
#

Ah, yeah, I need to get dependabot in there. @slate grove I just spot checked it on my local and there's no problems with either the generator or the scss build command after updating, so you're good to update it.

slate grove
#

okay thanks

marble forge
#

Whats the difference between this and Custom System Builder?

frank dome
#

This system requires coding

unique crane
#

CSB lets you build a character sheet within Foundry’s UI using the building blocks it provides, while Boilerplate is a starting point to build a system from scratch with JavaScript, HTML, and CSS.

marble forge
#

Gotcha

#

I know a bit a JS but not HTML or CSS, I have hit some walls with CSB so wanted to see what else was available before I started fighting through them

frank dome
#

Html and css are easier than JS the boilerplate has every basic thing you need to kick off a system and learn from it

marble forge
#

Ok

frank dome
#

There is there tutorial for the system. I'm pretty new and have been following it and looking at how systems do things

marble forge
#

Thanks Void! I will go through this a bit before I decide but thinking that maybe a good way to do it. I game we run biweekly within the system to remove bug, introduce features but I am only 1 person, if this gives me a bit more flexiblity, I think it would be worth moving over.

keen stone
keen stone
unique crane
#

It's worth noting that Boilerplate includes a bunch of grid CSS classes to try and make it a bit easier to do sheet layouts. I actually wrote them to help more quickly prototype layouts on my own systems and included it in Boilerplate in case they were helpful.

A basic example for using a 3 column layout to have two nested divs, one that's 1 col wide and the other that's 2 cols wide:

<section class="grid grid-3col">
  <aside class="grid-start-1">Sidebar, one column wide</aside>
  <article class="grid-start-2 grid-span-2">Main content, two columns wide</article>
</section>
#

Getting things positioned where you want them to go is one of the trickier parts of CSS, so my hope for that feature was to help ease the process a bit.

balmy fable
#

When running the generate script is asks Use DataModel instead of template.json? I am not sure what DataModel is and all the guides I've seen so far use template.json . What is the difference and will template.json be depreciated?

#

additional question is there anywhere I can read or watch to understand DataModel

#

I see this has already been answered: but any tutorial on DataModel would be appreciated.

wheat plume
#

Yeah there's definitely a need to write a proper tutorial but neither asacolips nor I have had time

vague urchin
#

Is boilerplate verified for v12? Thinking about to start from here.

unique crane
vague urchin
#

why files are .mjs? how to use usual javacript?

unique crane
vague urchin
wheat plume
#

from Foundry's POV the actual CommonJS vs ECMAScript is decided by whether you use scripts or esmodules to link your root file in module.json

wheat plume
#

AppV1 isn't gone yet

vague urchin
#

Now I think about moving back to v11. Cause your tutorial is for v11 and World Explorer module doesn't fully work for v12. Is it even a good idea?

unique crane
#

Either is fine and just depends on your comfort level. The v12 branch will be tougher to learn since the sheets are fairly different, but that’s what this channel and the #system-development channel can help with. The v11 version is also good to use, but will require more effort to upgrade to ApplicationV2 if you ever want/need to do that. It’s for sure doable though.

vague urchin
#

Ok, I installed boilerplate through npm generation. It launched fine. I added my roller as I did in Simple Worldbuilding. And... it is not working. And doesn't throw any errors in console.
It is Year Zero systems roller. It creates dice roll chat message with "Push" button. Message is created, but "push" button do nothing.
So there is 'roll.hbs' with:

    <div class="dice-buttons">
      <button class="dice-button push" data-action="push">{{localize "YZUR.CHAT.ROLL.Push"}}</button>
    </div>

And class with 'push' method:

class YearZeroDie extends Die {
push() { }

I don't even know where to start to debug it. console.log in push() didn't work out.

#

I made correct imports - as I did in Simple Worldbuilding:

import { YearZeroRollManager } from '../lib/yzur.js';
import { YearZeroRoll } from '../lib/yzur.js';

hook init has:

  YearZeroRollManager.register('num', {
    'Roll.chatTemplate': 'systems/numenera-yze/templates/dice/roll.hbs',
    'Roll.tooltipTemplate': 'systems/numenera-yze/templates/dice/tooltip.hbs',
    'Roll.infosTemplate': 'systems/numenera-yze/templates/dice/infos.hbs',
  });

  game.numenerayze.roller = YearZeroRoll;
#

So the problem is somewhere in boilerplate system.

vague urchin
#

Solved. I needed to add event listener for a button.

vague urchin
vague urchin
#

Why is there 'actor' and 'system'? Isn't it the same entity? It is so confusing with all of re-re-re-assignments.

unique crane
wheat plume
wheat plume
vague urchin
wheat plume
#

Broadly speaking your only going to use the root actor properties like, twice — name and img. Everything else is going to be under system

#

But nobody is forcing you to remove the leading actor

vague urchin
wheat plume
#

The name value is for Foundry's form handling and is ultimately fed into an actor.update call

#

So it should always be properties of the relevant document

wheat plume
gleaming vine
wheat plume
#

other question - do you have prior programming experience

gleaming vine
#

I have a lot of experience with Frontend, but not much with Backend, so my JS is not very good.

#

I have already cloned and created the repository on my github, it is already linked there too. I am at the system.json part.

wheat plume
#

OK, it looks like you didn't use the generator

#

the main Boilerplate repository has a bunch of extra tooling that isn't relevant to your system

#

Revert changes and run npm run generate to build a copy of the system

#

that will go into the build folder

#

I strongly recommend this method

gleaming vine
#

Ok, i'll be back then

wheat plume
#

(screenshot from the README)

wheat plume
#

it's fully functional but it doesn't have a walkthrough

gleaming vine
gleaming vine
wheat plume
#

the generated copy was put in the build folder

#

you need to grab that and move it to its own folder in data/systems

gleaming vine
#

OOOH, Ok ok!

#

Done, and now?

wheat plume
#

now you can edit. However, I will note that if you want to use the v12 branch of boilerplate you will have to re-run the generation

#

also, system-cardigan isn't a good ID primarily because of course it's a system

#

you can just do cardigan

gleaming vine
jovial inlet
#

Definitely do not start on v11.

wheat plume
#

the v11 version of Boilerplate works on v12 but it hasn't implemented any of the v12 upgrades like AppV2

#

unfortunately there hasn't been the time & energy to overhaul the guide to walk through appv2

gleaming vine
wheat plume
#

yeah normal git stuff

gleaming vine
#

ok

gleaming vine
#

I don't know if this question is wrong, but would there be any system that has already used this base and could show me how it ended up? Mainly the Front, HTML and CSS part.

wheat plume
#

Quite a few

#

But honestly a lot of the HTML and CSS stuff is just general front end principles

gleaming vine
#

I would like to see a system that was made here with HTML and CSS. I made this form here in the Sandbox system, but I saw that when it comes to creating macros that connect with skills and abilities on the form, there is no way. That's why I migrated to this system construction that seems to be much superior to the one in Sandbox.

wheat plume
#

the existing ActorSheet gives you a general structure

gleaming vine
full hearth
#

I need help 😦
I have been trying to start design a system using the boilerplate repo, but I can't get past this error when I try to install the system

It seems like no matter what I do, the ID field of system.json isn't being seen (id is undefined in requestData). It has the manifest correct though
Image
I've been over and over system.json trying to figure out what the problem is, and I can't see any part of it that's configured incorrectly. I even stripped it down to the bare essentials + manifest and it still didn't read id

#

I put everything together using the manual method and my experience modifying other systems so far, so I've compared each file to two other systems (MTA and MM3) to make sure things are configured correctly

#

weirdly enough it's successfully downloading the files from the git repo too

#

but it won't register the system

bronze prairie
#

hi, new to coding in general. can someone help me figure out....
when an item is created and added to the inventory, what exactly happens when {{localize "DOCUMENT.Create" type='Item'}} / {{localize "DOCUMENT.New" type='Item'}} runs? specifically, how is system.formula and system.roll... set initially?
what happens when {{localize "DOCUMENT.Update" type='Item'}} runs?

#

i assume that localize is some handlebar helper somewhere, but i can't find it

wheat plume
#

So there's two separate things happening

  1. The actual creation is handled by a click listener
  2. What you've found is just the localize helper for the label
wheat plume
bronze prairie
wheat plume
#

Anyways the actual interactivity is in the ActorSheet subclass

#

Specifically it's attached in activateListeners

bronze prairie
#

aha

#

....this whole time i was looking at item-sheet.mjs

wheat plume
#

The v12 branch implements AppV2 which I think is actually more straightforward but unfortunately neither I nor asacolips have had time to write a proper guide to it

bronze prairie
#

hmmm. i don't know if i have v12

#

which looks to me like v11?

wheat plume
#

Yeah, so on GitHub in the top left of the page you can switch branches

bronze prairie
#

gotcha

#

still learning github

#

have learned enough to get in trouble, but not out of it 😬

wheat plume
#

Yeah there's a lot. Unfortunately, system dev is still very reliant on community contributions and I've been busy elsewhere

bronze prairie
#

do you suggest swapping to v12?

wheat plume
#

I think the v12 branch is a better framework since appV1 will be officially deprecated in v13

bronze prairie
#

ok. i'll swap over later and see if i can figure things out

#

thanks for the quick reply though

languid steppe
#

Hey all! I'm just getting started with programming in general and building a system in Foundry in particular. Does anyone here have an example of adding skills in addition to stats (abilities) for Boilerplate?

wheat plume
#

Skills vary wildly in implementation across systems you'll need to be more specific

languid steppe
#

Oh, yeah.
The same mechanic as abilities (have a value and a mod with formulas), but in another css field

wheat plume
#

Then it's just a question of defining some base value and then calculating things in prepareDerivedData

languid steppe
#

Yeah i tried this, I use the same code with another variables and and the character sheets just stopped opening.

wheat plume
#

Open the console and read the errors

languid steppe
#

f12?

wheat plume
#

yeah it's just an electron browser

#

I would strongly recommend just doing all your testing in Chrome though

#

the error reporting is better

languid steppe
#

thk a lot

languid steppe
#

Ok. Am i right, what render error is error with css or html, not with js?

languid steppe
wheat plume
#

Looks like you broke up a comment

#

And now it's failing to render

languid steppe
#

idk but i think it isnt broken

wheat plume
#

Nope wrong spot

#

Would be in the handlebar template

#

Vscode search can also be helpful

languid steppe
#

I tried to found myrpgActorSheet class, bc i have the same class in the code.

#

Or this isnt a name of class?

#

I don't have a file with that name and that's what confuses me the most.'

wheat plume
#

Should be the name of the class, but the error it's pointing to is in a file that ends in .hbs

languid steppe
#

How did you understand this?

wheat plume
#

{{!-- is the syntax for a comment in handlebars

#

The kind of error it has is saying that it's not parsing as a comment

#

And so instead is just reading as invalid

languid steppe
wheat plume
#

For better or for worse a good chunk of understanding Foundry will require understanding handlebars

languid steppe
#

OH REALLY

#

fuck

#

facepalm

wheat plume
#

Is that file configured as .hbs?

#

Syntax highlighting looks off

languid steppe
#

i found the error fixed and it works well

#

thanks very much 🙂

languid steppe
wheat plume
#

Ah yeah vscode every day for Foundry dev

quasi sequoia
#

I'm working on an implementation of Cities Without Number and am trying to implement CWN's concept of Edges. These are features that can, among other things, modify character data (like abilities or other computed data on the actor).
For example, characters have a 'Base Attack' that is calculated based on character level. An edge can override that calculation with a different formula still using the level.
I have initially implemented Edges as items with effects, but it doesn't look like I can use formulas in the 'Effect Value' of an active effect on an item.
Is there a better approach to implement something like this? Edges are similar to Feats in D&D and while I'm trying to read through the dnd5e system, its very dense.

wheat plume
#

It is possible to make effects take roll data – several systems do this – but you have to implement that yourself

#

You also need to then ensure you're happy with the order of operations that is possible

quasi sequoia
#

Gotcha, thank you.

waxen loom
#

How far along is the development of the boilerplate for v12? Is it a good starting point in it's current state?

wheat plume
#

There's a very functional v12 branch

#

It's just missing a guide

waxen loom
#

Perfect, then it's time for crafting!

#

Guides are for chumps who can ready anyways... /jk

waxen loom
#

Okay I'm going to need a few pointers if anyone is willing to give them to me

I have worked on an old system that was very bloated and not super well maintained as it was created in v9 and supported all the way to v11 so bear with me please.

  1. There are 2 system.json, one in the root folder and one in src/datamodels/ do I need both? Why are there 2? Which one should I keep
  2. I want to create a system, so can I drop the content of the modules/ directory or for what should I use it?
  3. I will probably have more questions later on 😅
wheat plume
#

Have you worked with node before?

waxen loom
#

Yeah I have, I also did that and wasn't sure which one I should work on in the end because their structure differed a bit (like a dataModel directory being missing)

wheat plume
#

Basically the way this works is you download Boilerplate into any old place, install node dependencies with npm ci, then use npm run generate to build the system. You then copy the generated files from build into your Data/systems folder and work on them there

waxen loom
#

So I basically just work directly on the System the way it would be in foundry, gotcha

Last time I had build process where I wasn't sure what was happening exactly

#

But what about the template.json lying around even though I wanted to use dataModel?

wheat plume
#

One of the kinks in the v12 branch is we never implemented a step to delete template.json

#

You can just do that

waxen loom
#

I will check it out, running systems like that helped me a lot in the past, thanks!

wheat plume
#

Note there's no release yet, still building stuff out

waxen loom
#

I just need to see how some things are done and seeing something working helps me more than most tutorials

wheat plume
#

Yeah it's got a lot implemented

dense lake
#

Any v13 boilerplate update plans? (I should continue with my own system later this month.. It's been on a half year break. 🙈)

wheat plume
dapper current
#

Playing around with this a bit on the early end. Trying to add additional actor/item types and running into this.system.toPlainObject is not a function. They get created, but attempting to open the sheet throws the error.

I have tried adding copied versions of item-item-sheet.hbs and actor-character-sheet.hbs with a renamed middle name (e.g. item-reaction-sheet.hbs) for the get template() and cant quite figure out where the wall is now.

Is there some other reference I'm missing?

hollow cave
#

You created new (for items)

  • TypeDataModel?
  • and add them to CONFIG.Item.dataModels = { in Hooks.once("init", function ()
wheat plume
#

at this point the lack of appv2 docs is going to be less of a hindrance than all of the pecularities of appv1

dapper current
wheat plume
#

The lack of walkthrough is why main hasn't been updated

dapper current
#

gotcha

wheat plume
#

Main still works on v12

#

But there's a lot of stuff in main that really is no longer best practices, and I wouldn't advise spending a bunch of time learning how AppV1 works since it will begin its deprecation process in v13

dapper current
#

right that's where i was starting at, i had only adjusted the templates and not registered anything different in init hook

#

I will check out the v12 and see if that takes me to a different wall 🙂

wheat plume
#

But yeah toPlainObject is one of those hacky things I got rid of when I worked on the v12 branch

dapper current
#

handy shibboleth

dapper current
#

It seems like dropping an item onto an actor sheet creates the item regardless of type, but only renders it if it's appropriate to that section. There is not a failover check built in to see if the item type is valid for the actor, is that correct (or did i break the check somehow)?

wheat plume
#

if you want to block item creation by actor type you'll need separate logic

dapper current
#

ok cool just making sure i wasnt breaking something i wasnt seeing anyway 🙂

wheat plume
#

it's super doable, but it happens on a separate layer from the sheet

#

this page might still be a bit foreign since you're so early

#

but it's a good reference guide for how data gets translated from the database to what you see on screen

dapper current
#

this process is super helpful, by the way. thank you

dapper current
#

So with v12 schema definitions, what if anything should go in template.json? Should it all be reduplicated or is templates formatting just superfluous/backcompat?

wheat plume
dapper current
#

sweet thanks

dapper current
#

Im trying to understand a little better making the sheet rollable.

i dont actually have derived modifiers, do i need to just register the stats values in the same way?

#

I tried to look at SR5/6 for comparison to another pool system but they are beyond my current comprehension 🙂

#

is getRollData() within actor-character.mjs just defining a method for copying the abilities data to a new object so that object can be used, because data within the sheet is otherwise just used for rendering?

wheat plume
#

if you do nothing, getRollData returns the actor's system property (what you've been defining)

dapper current
#

ok so if nothing is derived then it shoud be fine to omit?

wheat plume
#

The reason it's important is because the constructor for Roll takes a data object as its second parameter, which it interprets to parse @ values

#

It's worth noting that if you do nothing, it actually passes system by reference

#

the trick is when you want any other abbreviations that aren't simple data paths on your roll data

dapper current
#

OK so it's giving a mapping for the shorter @str etc

wheat plume
#

Yeah if you want to include anything like that, you should do that in getRollData

dapper current
#

so then a mechanically simple dice system with top-level direct attributes should be safe to drop that and prepareDerivedData() yeah?

wheat plume
#

yep

dapper current
#

awesome, thanks for walking through it with me

wheat plume
#

by contrast you've got people working on systems like 3.5 who are adding even more layers of data calculation

dapper current
#

Thankfully that's not my need at the moment 🙂

wheat plume
#

I forget if I've already shown this/you saw this explained on the wiki

#

but the client side source is available in your foundry install folder

dapper current
#

i've mostly been leaning on the API site so i dont have to find what file things are nested into if you're saying what i think you are

#

still plenty of comprehension to be had though

wheat plume
#

yeah unfortunately the API site is incomplete in a few ways

  • it doesn't show mixin internals (Foundry has... a lot of mixins)
  • it only shows function signatures, but as a system dev you often care about internals
  • there are outright errors in various places
dapper current
#

the js i can bang my head against for long enough and usually come up with at least a new problem, the CSS might kill me eventually lol

#

that is good to know

wheat plume
#

the mixins is the biggest killer

dapper current
#

very yes

wheat plume
#

ClientDocumentMixin adds a lot of important functions to documents

dapper current
#

yeah im still a little shaky on documents yet, we paused our main campaign back in v9 and ive had a lot to pick up now that we're restarting

#

thankfully most of the negatives have just been "oh thats in a different place" compared to the positives

dapper current
#

to register another sheet is it best to just call another instance of .registerSheeet()?

wheat plume
#

yep

uneven crystal
wheat plume
#

The advice about ActorSheet and ItemSheet is now outdated but the rest is good

#

Unfortunately v12 is an awkward transition version in terms of sheets, it's definitely possible to make it work (I have) but there's some really nice qol improvements coming in v13

uneven crystal
#

So it would be better to wait for 13 if I don't urgently need it?

unique crane
# uneven crystal So it would be better to wait for 13 if I don't urgently need it?

You could use the guide and the v11 version of Boilerplate in v12 now if you want to get started ASAP, but you’ll either need to do a lot of reworking when v13 is stable (probably in the next month or two if I had to guess since it’s in the testing phase now), or you’ll need to do a larger amount of asking around here and in #system-development while referencing v12-based systems like Draw Steel by @wheat plume .

#

An example of one of the pain points if you used the v12 branch of Boilerplate is that in addition to the guide not explaining it yet, we have a bunch of methods implemented in its sheets that will be obsolete and provided by Foundry core in v12.

uneven crystal
#

That sounds like a lot of unnecessary work when I can just continue using r20 and return for v13. Thank you and I guess I will see you in a month or two 💜

wheat plume
#

For what it's worth I don't think v13 is going to be a hugely breaking update but the polish is noticeable

unique crane
#

Chaos has been building Draw Steel on v12 similarly to what we’re doing in Boilerplate and my Grimwild system is outright using Boilerplate v12 as its baseline. I’d like to revisit rewriting the guide once v13 is out, as both of us have had direct experience in building a v12+ system from scratch this year.

wheat plume
#

I did use Boilerplate it's just mutated a bunch 😂

unique crane
#

Ah, repo structure was pretty different and I didn’t spot the MIT attribution so I figured it was custom. I’m not policing that (nor do I have any desire to), but it’s usually what I spot check to see when neat new stuff was based on it

wheat plume
#

Yeah I ended up changing a ton

#

Partially because I wanted more advanced handling

hollow cave
#

Another example to look at, though its pretty rough, cause I was learning as I built (will need to do some clean up when I fix things for v13). But this is based on the v12 branch of Boilerplate too (I looked at Draw Steel a lot).
https://github.com/philote/eat-the-reich

real kraken
#

Speaking of v13, is anyone working on a guide for conversion?

wheat plume
#

some systems won't need any adjustments at all

#

furthermore, because we're still in Testing, lots of stuff is changing

#

Generally speaking the in-app warnings and errors are where you should start

real kraken
#

Perfect

languid steppe
#

Hi! Anyone knows, how can I make two fields edit the same variable?
I have two character sheet tabs and both have the "flow" stat value. I need them to be synchronized - that is, so that editing one value will automatically edit the second value in the adjacent tab of the character sheet. I've already tried 3 methods and nothing worked.

wheat plume
languid steppe
steady hawk
#

Hello guys, I just found out this section exists. I have question regarding boilerplate v12

I am trying to use activate listener but it just does not work for me
So this is my actor-sheet.mjs part

activateListeners(html) {
super.activateListeners(html);

html.find('.my-button').on('click', this._onButtonClick.bind(this));

}

_onButtonClick(event) {
event.preventDefault();

console.log('Button clicked!');

}

and this is my .hbs part in the actor sheet
<button class="my-button">Click Me</button>

But for some reason the console log does not do anything.
I wanted to make sure it has nothing to do with my edits, so I tested this on the unedited version of boilerplate (V12) but I still have no idea how to make it work

Does anyone have experience here how it should be done? Maybe I need to put the activate listener in some specific place. I spent a whole day trying to figure this out but at this point I just ran out of all of my sanity 😄

wheat plume
#

ActorSheetV2 does not use activateListeners

#

it also doesn't use jquery

steady hawk
#

Thank you for quick answer 😄 ahhh this is quite embarassing

so basically I should have put this kind of interaction with button into
_onRender(context, options) {
this.#dragDrop.forEach((d) => d.bind(this.element));
this.#disableOverrides();
// You may want to add other special handling here
// Foundry comes with a large number of utility classes, e.g. SearchFilter
// That you may want to implement yourself.
}

wheat plume
#

Well, if it's a basic click listener, use actions

steady hawk
#

Thank you, you have given me hope! I will go through this and see how I can make use of it

steady hawk
wheat plume
steady hawk
#

Wow super! I will use this for referrence for sure

wheat plume
#

It does use some more advanced concepts and tricks, feel free to ask questions

steady hawk
#

Hello people, its me again.
I was rubbing my forehead about this part

// Handle item rolls.

switch (dataset.rollType) {
  case "item":
    const item = this._getEmbeddedDocument(target);
    if (item) return item.roll();
}

Is there any way I can catch the roll.total of this item.roll ? I did not change the basic formula that was there

wheat plume
steady hawk
#

Aha so if in item.mjs inside if (this.system.roll) {
there is defined formula, I can also explicitly put things like roll.tomessage and roll.total at the end of that method ?

wheat plume
#

Yep, freeform space to work and redo things

steady hawk
#

Thanks 🎉

glacial crater
#

Hello everyone, I hope you are doing well. Is there anyone that can tell me if the Boilerplate tutorial is compatible with Foundry V12? It tells me v11 Compatible, but what I mean by this is mostly: Does it use any v12 stuff?

unique crane
sharp belfry
#

@unique crane is there any plans to update it to v13?

wheat plume
#

Right now the issue is v13 keeps getting changes

#

Frankly though it's not going to be a big shift from the v12 branch

#

Main change is removing the drag drop extras from the actor sheet

unique crane
#

Yeah, the v12 branch should need minimal changes for v13. Once v13 is out, I’ll start work on a rewrite of the tutorial for it.

sharp belfry
#

If you need help, I would be happy to

wheat plume
#

The wiki is open to edits and Boilerplate is open to PRs

unique crane
#

I’ll likely put together an issue in the repo with an outline of the v13 structure for the tutorial, as I imagine it will end up a bit differently organized given how long it’s been since I originally put it together. That’ll be a good place to weigh in on it in addition to the more targeted edits.

hybrid vessel
#

I posted this message in system-development before the pinned post led me here:
I am trying to use npm run generate to create a new system and get the following error:

*file:///home/greville/Documents/Roleplaying/Utilities/Foundry%20VTT/In%20Dev/boilerplate-main/src/generate-boilerplate-system.mjs:23
this.dataModel = answers.dataModel ?? false;
^

SyntaxError: Unexpected token '?'*

I am running Pop!_OS 22.04 LTS with fresh installs of nodejs v12.22.9 and npm v8.5.1 . It didn't ask me any of the questions from the script, just failed with the error straight away. I've tried the standard download, using git clone, the v12 branch, and I get the same error every time.

unique crane
#

If you have trouble updating your system version of node or can’t update it due to other projects, I would recommend using a node version manager like nvm (https://github.com/nvm-sh/nvm) to install additional versions. Once you have it, you can run nvm install to install inside the Boilerplate directory to install node 20.

hybrid vessel
# unique crane That node version is waaaay out of date, so I would start there. Boilerplate use...

That worked for updating node to 20.11, thank you. Unfortunately I'm still getting an error:

`boilerplate@2.0.0 generate
node src/generate-boilerplate-system.mjs

node:internal/modules/esm/resolve:853
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'inquirer' imported from /home/greville/Downloads/boilerplate-2.0.1/src/generate-boilerplate-system.mjs`

I re-downloaded the source file and tried it several times, but to no avail.

hybrid vessel
hybrid vessel
#

I ran npm run generate on my old macbook and it worked fine

unique crane
#

Hmm. And there were no errors in your npm install command?

hybrid vessel
sharp belfry
#

I don't know if someone is doing this, but I just forked and I will try to check some of the warnings/deprecations for v13

unique crane
sharp belfry
#

Yeap, from v12 branch 🙂

sharp belfry
#

@unique crane do you have the permission to copy the latest Wiki Tutorial? I wanna to start to update it with the things I am doing here.
I will not be able to clean/document everything because I need to start to work on the system. But I want to help a little at least! 🙂
I will probably spend today and tomorrow on that.

unique crane
#

The wiki is open, so anyone can edit any page. I’ve been debating with myself on whether I want to rewrite the existing articles or write it as a new section since it’s going to be so different.

sharp belfry
#

Do you have any preference?

unique crane
#

I can’t recall what the wiki has in terms of draft states/workflows. My main worry with editing the existing one is getting it into an unusable state for X period of time while the revisions are being made. So that has me leaning towards throwing it in a new section.

However, it might also work to do something like putting a clear indicator (horizontal rule, warning info bubble, etc) at the bottom of the original article(s) and then throw the new content below those warnings.

sharp belfry
#

I was planning to duplicate the current content and start to modify the things with what I am doing. Of course that there is a "strange period" that the wiki would not be up-to-date until we merge that

#

I wanted to at least create/update the docs while I am doing the changes. If I left to do later, I will forget to do that 😅

unique crane
#

Gotcha. The plan from my side has been to just start from scratch after v13 stable since the tutorial’s whole structure is still based on what made sense to me back in 2020 or whenever. There will be a lot of copy paste as a ton of the text is still relevant, but it’s the overall structure that I want to revisit.

#

That’s obviously going to take longer to do though, so it’ll be a bit before I can get to it. If you’re tackling them more piecemeal, that should help a lot in the interim for sure.

sharp belfry
#

In that case, I will move forward with the changes and try to add descriptive commit messages that can give you an idea of what I was planning to do. And we can check these things during the PR review 🙂
Does it make sense?

unique crane
#

Sounds good to me. Thanks a ton for this!

wheat plume
#
  • adjust the prose-mirror to use data-documenf-uuid instead of data-document-u-u-i-d. This change technically could've happened in v12, it just got fixed after I made my updates (it was like 12.328 or something)
#

@unique crane what do you think about maybe moving to pure css

#

The v13 electron client now supports normal css nesting

unique crane
#

That works for me 👍

wheat plume
#

I think it would simplify a lot. The only hitch is I've struggled a bit with hot reload

tribal comet
#

Hi! I accidentally started development of a custom system in V11, but with datamodels. Are most of the V12 changes in actor-sheet.mjs and item-sheet.mjs? Trying to figure out if it's worth trying to rework what I have, or start from scratch in V12 fully.

wheat plume
#

For example, AppV2 has a better basis for context prep, which means I got rid of the silly toPlainObject method

unique crane
#

The handlebars templates are also different for the AppV2 version since it can use parts

tribal comet
#

Oh, cool. I'll poke around then and see if I can switch over. Thanks for all your work - boilerplate has been a lifesaver for me in terms of learning foundry tools!

forest locust
#

Hello folks. Just wandering in and trying to get started with the current version of Foundry development.

#

On Boilerplate's "Getting Started" page, the instructions say to search for "boilerplate" (case sensitive) and "Boilerplate" (case sensitive), but not "BOILERPLATE". I found twenty-some of those.

#

Was that intentional?

unique crane
#

Nope, that was a mistake. The intent there is that there are a lot of references to the word boilerplate in various contexts, and you should replace that with the equivalent for your system name.

#

So BoilerplateActor might become FabulaUltimaActor and BOILERPLATE might become FABULA_ULTIMA on a system like Fabula Ultima for example.

#

Ideally there won’t be any references to Boilerplate in any capital casing once you’ve caught them all.

wheat plume
#

Did we ever fix the globalThis case

#

I don't think that got handled

forest locust
#

I think I've caught them all. There's something especially weird about gridDistance and gridUnits, though, or next, depending. As it's Saturday, this doesn't seem like a good time for a documentation review.

wheat plume
#

They moved to a nested structure in v12

forest locust
#

I've observed from the warnings on many other systems, but when I change them...:
The "Stewpot" system's manifest contained the following unknown keys: "grid.distance", "grid.units"
Will keep hammering at it.

wheat plume
#

Yeah, so it wants a nested object

wheat plume
forest locust
#

Separately, I almost got there. And with some minor changes to versioning, it loads up in Foundry 12 with no errors. It's all downhill from here.

#

And now I'm not sure if I'm supposed to rewrite template.json or do something in the "System Data Model."
It's kind of scary that I'm not actually up to the programming part yet.

marsh snow
#

Use system data models, not template.json

forest locust
#

Okay, found that page, and the documentTypes get defined in the pile with the system.json stuff?

marsh snow
#

Yes, you need to define the document types in system.json and then provide the data model classes for your documents in the init hook

forest locust
#

And again, sorry to stink up with the place with n00b questions.

jovial inlet
forest locust
#

Thanks, but I still feel like I'm abusing the privilege.

wheat plume
#

"I am using a resource therefore that's abusing the resource" is the kind of maladaptive thinking that therapy can help with

sharp belfry
#

Question, do we want to maintain compatibility with the non-data model actor sheet?
I am just thinking if it worth to have to handle two actor sheets

wheat plume
forest locust
#

Oof.

wheat plume
#

It would simplify the repository a lot

sharp belfry
#

yeap, I was getting quite confused here beacuse of the two actor sheets 😄

#

If people have nothing against, I can do that on my current fork for the v13 and send that together no the PR

sharp belfry
sharp belfry
#

I was looking to that one. Ok, it seems that it is so many things that I thought I was missing some connection 😄

forest locust
#

So... this looks like a decent start on the thing I'm doing:
"documentTypes": { "Actor": { "character": { "arrayFields": ["adventurerJob", "townJob"], "stringFields": ["name", "weapon", "armor", "quirk"], "filePathFields": ["portrait"] }, "tavern": { "arrayFields": ["locationDetails", "advancementDetails"], "stringFields": ["look", "name"], "numberFields": ["cuisine", "atmosphere", "service"], "filePathFields": ["landscape"] }, "minigame": {} } }

wheat plume
#

the reason is those need server-side cleaning

#

the rest of those aren't going to do anything

#

also, do you really need system.portrait/system.landscape as additional image fields?

#

Actors already have a native image field

forest locust
#

Fair enough. Pulling stuff out...

#

And now...
"documentTypes": { "Actor": { "character": {}, "tavern": {}, "minigame": {} } }
...looks a little sparse.

wheat plume
#

That's not unusual if you don't have any html fields

#

usually you want some kind of description/biography field

#
// also triple tick (`) lets you do a code block
sharp belfry
#

Question: given that we cannot have items inside items, does it make sense to have a drag-drop on item sheet?

#

Previous versions of the Boilerplate had that, but did basically nothing.

#

And checking here, the foundry implementation, it does not create the dragDrop handles for the item sheet

#

so, if we want to have that, it will require the full implementation for it

wheat plume
#

Maybe those aren't worth it since they can't go in the sidebar and you leave it out entirely

sharp belfry
#

let me check it here 🙂

#

It would lose the reorder of active effects.

#

I don't remember if the ordering of them makes some difference, but just thinking, if they are applied via the order, it could

#

which means that having this on the document could be interesting

unique crane
#

Even if it doesn’t affect the application order, I would still keep it so that users can order them however makes sense to them.

sharp belfry
#

Ok. Let me work on that.

wheat plume
sharp belfry
#

So, if I understood correct, we would need the DragDrop implementation, but we can leave it only for the AE. Can I remove the Actor, Folder, Item? Because they are just polluting the code, as they don't do nothing today.

wheat plume
#

I mean, part of the function of Boilerplate is it's going to have no-op functions that end users can leverage if they need them

unique crane
#

Yeah, I would lean towards expanding the comments on them with context about how they’re not used by default but could potentially be used.

wheat plume
#

This is also what Core does for the ActorSheet functions

sharp belfry
#

Ok. I will leave them in this case and add some comments.

#

adjust the prose-mirror to use data-documenf-uuid instead of data-document-u-u-i-d. This change technically could've happened in v12, it just got fixed after I made my updates (it was like 12.328 or something)
@wheat plume does just need the replacement? I did that and everything is working. Just wanna confirm if there is something more

wheat plume
#

yeah basically what happened is foundry was checking dataset.documentUUID and forgot that meant the html would have all those hyphens

#

now it also supports dataset.documentUuid which looks much better in the html

#

[also hopefully you didn't copy over my typo]

sharp belfry
#

I didn't 😄

sharp belfry
#

Ok, I will open a PR to the branch v12, but I believe that it should probably create a v13 branch (or maybe consider going back to main).

My idea is to get some review on the code to see if there is any problem.

To make the scrollable work, I set the max-height on the tab, and start to use the scrollable class on the tabs. I am open to suggestion, although this works for a base project.

wheat plume
#

I think that makes sense to me

sharp belfry
#

Here we are! 🙂

#

As this is right now working on the v13, I will probably start on the new system, but I am open to hear feedback and put more time on it to make it better for the community 🙂

wheat plume
#

If you're going to add symlink support should also have jsconfig.json

sharp belfry
#

I just saw that this was on the gitignore. I will remove it

#

Pushed 🙂

forest locust
#

Getting back to it after a period of nothingness... in which file do I put the DataModel definitions?

sharp belfry
#

modules/data

wheat plume
forest locust
#

So in my case that'd be data/system/stewpot/module/stewpot.mjs?

wheat plume
#

Sure, although naming a data model after your system isn't usually all that helpeufl

#

also, just set your system's folder as your root for vscode

forest locust
#

<-- Toldja I was new.

tribal comet
#

Hi again! Trying to define a button to Take A Rest. Previously, I did this with activateListeners. Now, I'm trying to use data-action and wondering if I missed a step.

  1. In my sheet template, I have <button type="button" data-action="takeRest">Take a Rest</button>
  2. In actor-sheet.mjs, I have a function async _takeRest(event, target)
  3. In actor-sheet.mjs I have added takeRest: this._takeRest to the set of options.

But it's not correctly calling the function (testing with console.log(...)). Is there anything else I need to get the button to register correctly?

sharp belfry
#

Is your function static async?

tribal comet
#

It wasn't, but that fixes it! Thank you! Why does it need to be static? I learned java back in high school, so I'm pretty rusty

sharp belfry
#

I think it is because how Foundry handles this execution. But maybe somebody else can bring more light to this

wheat plume
# tribal comet It wasn't, but that fixes it! Thank you! Why does it need to be static? I learne...

Foundry does some funny things with actions. So, you define them in static DEFAULT_OPTIONS, which means they can't be instance methods; static methods is certainly the easiest, but you could define an action externally and assign it.

Then, when you actually click the element, foundry uses call and specifically provides the instance for this

MDN Web Docs

The call() method of Function instances calls this function with a given this value and arguments provided individually.

#

If you want this to work in intellisense, make sure you annotate @this. The existing Boilerplate actions should be examples there

sharp belfry
#

One issue I found yesterday (and I remember that someone was having a similar issue): during the generate, we are transforming the boilerplate to my-system. However, there is a globalThis.boilerplate being converted to globalThis.my-system which causes an issue Invalid left-hand side in assignment.

I will try to check if I can fix that inside my v13 branch.
PR updated with the fix for this case (it was simpler because there was already something similar there)

faint oxide
wheat plume
#

Yeah this is the type of thing that an updated Boilerplate guide should address

sharp belfry
#

As maybe some people will be getting here from the recent talks in the #system-development ...

There is a v13 PR that I opened, but I am still finding some issues as I am developing a system and using that.
But I will need to check that on the source when I get things done for that.

There are not so much differences from v12 to tell the truth, so it could still be used with the current tutorial.
Of course that there are things that are not in the tutorial, but it can be worked out.

tribal comet
#

Hiya! I noticed there were some styles in the css sheet referencing "tox", but unsure what that is. It doesn't seem to show up anywhere in my HTML classes, does anyone know? E.g:

.boilerplate .tox .tox-editor-container

wheat plume
#

Honestly I think those are legacy

#

Probably from the old tinymce editor

orchid ether
#

What does all this stuff in the v12 actor-sheet.mjs do? Some of these tab cases have that context.tabs[] call, and some don't, and I'm not really sure which to apply to my own tabs.

orchid ether
#

I would check the API, but the _preparePartContext section just gives me an error 404 page. Most of the site does, actually.

wheat plume
#

OK, going to recommend you get comfortable reading the source

#

Uh, what's your background on Inheritance and Object Oriented Programming?

orchid ether
#

I have no clue what that means, so I'm gonna go with 'none'?

wheat plume
#

OK, so basically whenever you see ClassA extends ClassB, that means ClassA "inherits" all of the properties from ClassB

#

the classic example is something like "Dog extends Mammal"

#

we might define a Mammal with properties like "hasFur: true" or methods like "warmBlood()"

#

Even with just an empty class definition, class Dog extends Mammal {}, Dog would have all of that

#

The slightly more advanced idea is "multiple inheritance", where you inherit the properties of multiple parents

#

Some languages support multiple inheritance out of the box, but javascript is not one of them

#

That's where Mixins enter the picture

#

in this case, HandlebarsApplicationMixin

#

unfortunately the current typedoc generation that Foundry uses does not support mixins

#

Now, you can read all this source code for yourself

#

If you have an electron based install, go into resources/app, otherwise this is the root folder

  • client and common are the primary code of Foundry broken up into a general 1 file == 1 class setup.
    • client is code that's only for end users, such as applications and the canvas. It was fully migrated to use ESM in version 13.338. The actual root file that imports everything is client/client.mjs, where stuff is assigned to a spot in the foundry namespace.
    • common is code that's shared with the server, and is also available under the foundry namespace.
  • dist and node_modules are for the server and shouldn't be touched
  • public is the actual files that are served up to clients. All of the stuff that's in client and common gets rolled up into scripts/foundry.mjs. There's also a ton of other stuff here, like the core icons and css. I'll also call out lang/en.json as particularly useful.
  • templates is all the hbs templates used by core.
orchid ether
orchid ether
wheat plume
#

Well, for one you can look at the Foundry-defined sheets to see what they're doing

#

like, SceneConfig isn't fundamentally that different

wheat plume
orchid ether
wheat plume
#

by looking at one of the foundry-defined apps with tabs, like SceneConfig

#

basically you define static TABS

orchid ether
orchid ether
wheat plume
orchid ether
#

I'm struggling to figure out what could be causing this error. It says that preloadHandlebarsTemplates() is undefined, but where was it meant to be defined in the first place? I can't find anything except this return in module/boilerplate.mjs 🤔

wheat plume
#

Basically in AppV1 you have to preload every partial you use in any app

#

But AppV2 solves that with the templates array for each part

orchid ether
wheat plume
#

Yeah

dusky rampart
#

is there a quicker way to create a build rather than npm run generate all the variables are already in place so i don't always want to mention them again

wheat plume
#

Well, you should only use the build once

#

Then copy the build into a fresh repo

#

And directly edit that

dusky rampart
#

Ohhh I see. My bad used to have some kind of src and distribution folder when working on systems and modules

dusky rampart
#

can someone tell me how to pass a value from config to hbs template to iterate over it?

#

got it. It's predefined in config = CONFIG.<yoursystem>

dusky rampart
#

So I managed to add different groups in the hbs template for each feature subtype:

In my case:

  • Physical
  • Knowledge
  • Social

I also added the subtype in my config and added groups for each in my hbs file.

How can I filter the items in order that they are only shown in those categories?

my feature has system.set = phy

And I want to allocate those items to the coloumn of phyiscal features see screen

wheat plume
#

you'll then need to sort it by the item's sort value

dusky rampart
#

The itemtype is feature and each feature has system.set which stores it's group (phy, kno. or soc)

the itemTypes array does list all items. (features, spells, items)

wheat plume
dusky rampart
#

Ok i got it working but still a minor bug:

I used the following in actor-sheet.mjs

const skillSets = Object
    .entries(context.config.skillSets)
    .map(([key, rr]) => ({
        ...rr,
        key,
        skills: skills.filter(i => i.system.set === key) // Filter skills by set
    }));

    // Assign and return
    context.skillSets = skillSets;

This works as key and skills are part of the Object

However somehow each key also contains each letter of the value for each key

Like

0
: 
{0: 'H', 1: 'T', 2: 'B', 3: 'A', 4: 'H', 5: '.', 6: 'S', 7: 'k', 8: 'i', 9: 'l', 10: 'l', 11: 'S', 12: 'e', 13: 't', 14: '.', 15: 'P', 16: 'h', 17: 'y', 18: '.', 19: 'l', 20: 'a', 21: 'b', 22: 'e', 23: 'l', key: 'phy', skills: Array(1)}
1
: 
{0: 'H', 1: 'T', 2: 'B', 3: 'A', 4: 'H', 5: '.', 6: 'S', 7: 'k', 8: 'i', 9: 'l', 10: 'l', 11: 'S', 12: 'e', 13: 't', 14: '.', 15: 'K', 16: 'n', 17: 'o', 18: '.', 19: 'l', 20: 'a', 21: 'b', 22: 'e', 23: 'l', key: 'kno', skills: Array(0)}
2
: 
{0: 'H', 1: 'T', 2: 'B', 3: 'A', 4: 'H', 5: '.', 6: 'S', 7: 'k', 8: 'i', 9: 'l', 10: 'l', 11: 'S', 12: 'e', 13: 't', 14: '.', 15: 'S', 16: 'o', 17: 'c', 18: '.', 19: 'l', 20: 'a', 21: 'b', 22: 'e', 23: 'l', key: 'soc', skills: Array(0)}
length
: 
3
[[Prototype]]
: 
Array(0)
#

This is my config object

HTBAH.skillSets = {
phy: 'HTBAH.SkillSet.Phy.label',
kno: 'HTBAH.SkillSet.Kno.label',
soc: 'HTBAH.SkillSet.Soc.label',
};

#

fixed it. ...rr was incorrect

dusky rampart
#

Making good progress but facing another problem

I fetch the items per skill set and want to update the item directly from actor sheet and not inside the item itself

I managed to retrieve the correct ranks of skills. but am unable to update them. I presume i have an incorrect path in the "name" attribut of the input form.

wheat plume
#

Because you explicitly don't want the default change handling

dusky rampart
wheat plume
dusky rampart
#

I'm not yet on appv2 tried today but struggle was real xD

wheat plume
dusky rampart
#

the guide didn't help me much, still to many open questions

dusky rampart
#

Is there an example of an already transitions boilerplate system? i can use as a reference?

hardy egret
#

I'm trying to customize the img of a new type of item. I don't want the default "bag" when I click "New Occupation" on top of the list container. Can anyone point me to where I might find the file/line for that?

dusky rampart
# wheat plume The v12 branch

Transition worked pretty good I'd say thank you for the advice.

I only got one problem:

  1. I renamed the feature item type to skill and replaced all occurences accordingly (case sensitive)
  2. on my actor, I can add skills using item-controls in hbs.
  3. deleting and editing however don't work. and raise the following error:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'dataset')
    at HtbahActorSheet._getEmbeddedDocument (actor-sheet.mjs:450:16)
    at HtbahActorSheet._deleteDoc (actor-sheet.mjs:358:22)
    at #onClickAction (foundry-esm.js:45095:58)
    at #onClick (foundry-esm.js:45056:53) 

Note: all other item types work in terms of create, update, delete. (e.g. spells and gear)

This is my hbs. item-controls

<div class='item-controls'>
  <a
    class='item-control item-edit'
    title='{{localize "DOCUMENT.Update" type='skill'}}'
    data-action='viewDoc'
  >
  <i class='fas fa-edit'></i>
  </a>
  {{#if @root.editable}}
    <a
      class='item-control item-delete'
      title='{{localize "DOCUMENT.Delete" type='skill'}}'
      data-action='deleteDoc'
    >
    <i class='fas fa-trash'></i>
    </a>
  {{/if}}
</div>

See screen attached for my layout on actor.

Ignore the bad formats.

sharp belfry
#

Abore this div, you have to have a tag with the document id on the dataset

#

the error Cannot read properties of null (reading 'dataset') says it is trying to get the dataset from a null object, which means that somewhere around the actor-sheet.mjs:450:16 you are trying to get the tag that contains the dataset, but it is returning null

#

How is the HBS for each item you have?

dusky rampart
#

 {{#each this.skills as |item id|}}
          <li class='item flexrow' data-item-id='{{item._id}}'>
            <div class='item-name skill-name'>
              <h4>{{item.name}}</h4>
            </div>
            <div class="flexrow skill-modifiers">
              <input
                class="skill-ranks"
                type="number"
                value="{{system.ranks}}"
              />
              /<span class="skill-dc rollable" data-roll="d100" data-label="{{item.name}}">{{system.total}}</span>
            </div>
            <div class='item-controls'>
              <a
                class='item-control item-edit'
                title='{{localize "DOCUMENT.Update" type='skill'}}'
                data-action='viewDoc'
              >
                <i class='fas fa-edit'></i>
              </a>
              {{#if @root.editable}}
                <a
                  class='item-control item-delete'
                  title='{{localize "DOCUMENT.Delete" type='skill'}}'
                  data-action='deleteDoc'
                >
                  <i class='fas fa-trash'></i>
                </a>
              {{/if}}
            </div>
          </li>
        {{/each}}
sharp belfry
#

And how is the code for the delete and the getEmbeddedDocument?

dusky rampart
#
/** Helper Functions */

  /**
   * Fetches the embedded document representing the containing HTML element
   *
   * @param {HTMLElement} target    The element subject to search
   * @returns {Item | ActiveEffect} The embedded Item or ActiveEffect
   */
  _getEmbeddedDocument(target) {
    const docRow = target.closest('li[data-document-class]');
    if (docRow.dataset.documentClass === 'Item') {
      return this.actor.items.get(docRow.dataset.itemId);
    } else if (docRow.dataset.documentClass === 'ActiveEffect') {
      const parent =
        docRow.dataset.parentId === this.actor.id
          ? this.actor
          : this.actor.items.get(docRow?.dataset.parentId);
      return parent.effects.get(docRow?.dataset.effectId);
    } else return console.warn('Could not find document class');
  }
#
static async _deleteDoc(event, target) {
    const doc = this._getEmbeddedDocument(target);
    await doc.delete();
  }```
sharp belfry
#

So, this line:

const docRow = target.closest('li[data-document-class]');

It is trying to get an li tag with the data-document-class.
But your HBS only has the data-item-id:

#

Change it to something like this and it should work:

<li class='item flexrow' data-document-class="Item" data-item-id='{{item._id}}'>
dusky rampart
#

will try thank you

dusky rampart
dusky rampart
#

Okay strange. It seems like that the items can only be edited, when I drag them around on the sheet once...
Could this be some kind of missing initialisiation or something, that at least 1 action needs to happen?

The _getEmbeddedDoc function is called correctly and the ID is passed to the doc.sheet.render() function in _viewDoc

#

and i can only use the edit button once xD

#

after that it stops functioning again

sharp belfry
#

Sorry, I don't understand what you are trying to achieve and what is the issue. Can you share more information?
Or maybe share the repo to look a little bit more

dusky rampart
#
  1. I transitioned the appv1 to appv2 in that branch
  2. create a new actor and open the skillstab
  3. the item controls (create, edit, delete) buttons worked before
  4. create and delete are already fixed and work again thanks to you help
  5. However the edit item (skill) does not work still.
  6. I tried debugging, an the _getEmbeddedDocument from actor-sheet.mjs works
  7. Problem seems to occur somewhere in static async _viewDoc(event, target) { (line 346)
  8. The corresponding hbs is templates\actor\skills.hbs
#

you can recreate the error by creating a new actor and using one of the + icons to create a new skill and after that try to edit it via provided item-control button

sharp belfry
#

is there any error on the console when you try to do the operation?

#

I don't know the system, so sorry if I am saying something wrong... but should the skills be items? Most games have a predefined set of skills, which mean that they are not items, but fixed set of data on the actor.

Besides it, I believe that maybe you are facing issues not exactly related to the boilerplate itself, but for general system development. Based on that, I would recommend you move this question to #system-development as you get more help from there too.

This channel is more about the state/improvement of the Boilerplate itself than implementations that used that

dusky rampart
#

yeah the system is very low rules and people just write down the skills they want

#

so they are items

#

like fishing, Running, Diplomacy

#

In it's current state it's still 95% Boilderplate I'd say 😄

#

thank you anyway

item-sheet.mjs:104 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fields')
    at HtbahItemSheet._prepareContext (item-sheet.mjs:104:49)
    at #render (foundry-esm.js:44317:34)
    at Semaphore._try (foundry-esm.js:6645:25)
    at foundry-esm.js:6617:21
    at new Promise (<anonymous>)
    at Semaphore.add (foundry-esm.js:6615:14)
    at HtbahItemSheet.render (foundry-esm.js:44289:30)
    at HtbahActorSheet._viewDoc (actor-sheet.mjs:346:15)
    at #onClickAction (foundry-esm.js:45095:58)
    at #onClick (foundry-esm.js:45056:53)
sharp belfry
#

Does your skill follows the new data model style?
Because the line it is complaining, it is trying to get the fields from the schema, but schema is undefined

systemFields: this.document.system.schema.fields,
dusky rampart
#

when i create a skill from items tab i can open it just fine

#
import HtbahItemBase from './base-item.mjs';

export default class HtbahSkill extends HtbahItemBase {
    static LOCALIZATION_PREFIXES = [
      'HTBAH.Item.base',
      'HTBAH.Item.Skill',
    ];
    static defineSchema() {
        const fields = foundry.data.fields;
        const schema = {
            set: new fields.StringField({ initial: "phy"}),
            ranks: new fields.NumberField({ initial: 0 })
        }
    return schema;
    }
}

``` this is the datamodell
sharp belfry
#

I don't think that what I will say now is the problem.. but you should probably check
If your "skill" is inheriting the HtbahItemBase, your define schema probably should call the super.defineSchema.
Again, this is not the reason for the issue, but is a programming point that you should check.

I am not seeing any issue that would explain what you are seeing.
Let me try to install your system to see if I can see something when running

#

Is this for which Foundry version? 12 or 13?

dusky rampart
#

12

sharp belfry
#

ok

dusky rampart
#

did not checkc 13 yet

sharp belfry
#

Question: did you create a new actor after all those changes?

#

because I tested here and I am not able to reproduce the issue you are saying

#

I can edit the skill all the times I click the edit button

dusky rampart
#

yes i recreated the actor just now.

So you add the skill on the actor and than edit it just fine?

sharp belfry
#

Yeap

dusky rampart
#

12.343?

#

using the desktop app or browser?

#

will create new world i guess

sharp belfry
#

I am on 12.331 (didn't get the latest version yet)
browser (chrome)
new world

dusky rampart
#

will try

dusky rampart
#

Chrome with new world on 12.343 does not work either.

But comparing gear item type and skill item type.

Gear has this.document.system.schema defined while skill has not...

#

updated skill model to

import HtbahItemBase from './base-item.mjs';

export default class HtbahSkill extends HtbahItemBase {
    static LOCALIZATION_PREFIXES = [
        'HTBAH.Item.base',
        'HTBAH.Item.Skill',
    ];
    
    static defineSchema() {
        const fields = foundry.data.fields;
        const requiredInteger = { required: true, nullable: false, integer: true };
        const schema = super.defineSchema();
        
        schema.set = new fields.StringField({ initial: "phy"}),
        schema.ranks = new fields.NumberField({ ...requiredInteger, initial: 0 })

    return schema;
    }
}
#

will change to system dev channel once this is solved

#

This is the skills content in document.system at runtime

#

while this is gear

sharp belfry
#

For some reason, your item seems to be created correctly, as it is coming as an object... 🤔

dusky rampart
sharp belfry
#

Oh my... there is a big chance I was on main.. let me test it again with the right branch

sharp belfry
#

Found the issue:

for (const skill of filteredSkills) {
  const ranks = skill.system.ranks || 0;
  skill.system = {
    ...skill.system,
    total: ranks + mod
  };
}

You are replacing the system property from HtbahSkill to a simple object. This is causing the issue

#

You should probably do something like this:

for (const skill of filteredSkills) {
  const ranks = skill.system.ranks || 0;
  skill.system.total = ranks + mod;
}
dusky rampart
#

believe it or not I suspected that to be the culprit just 5 mins before I saw that you answered here

dusky rampart
forest locust
#

And once again, the curse of the casual developer kicks in: I return to trying to shoehorn a system into Foundry, only to forget what I was doing before and need directions to find my way back to Square forking One.

#

I don't even remember if I'm set up to do this development in v13.

sharp belfry
#

There is a PR opened for the v13

forest locust
#

PR? I don't come in here nearly often enough, and I felt guilty doing so, like I was wasting everyone's time.

sharp belfry
#

Pull Request

#

On the Boilerplate repository

forest locust
#

Is this a bad time to try to develop a system?

sharp belfry
#

My only recommendation is that if you are starting now, I would recommend developing that pointing to v13 directly

forest locust
#

As I do intend to use v13 fully (once it's got enough games running in it), that's what I'm going to do.

#

Wait. Is the version fo Boilerplate I have in here for the new system even up to date?

#

Or with the pull request in should I reload from scratch (won't lose much work, I'll say that much.)

sharp belfry
#

So, the PR is not merged yet on the Boilerplate repository. So, if you want to use that, I would recommend getting the repo/branch from the PR and running the commands again

forest locust
#

It sounds like my time would be better spent getting to know the game I intend to implement a little better. The setting has a more involve character sheet than the characters do. And there are some recipes in the back.

dusky rampart
#

@sharp belfry turns out someone else was already implementing the system i tried to set up using the boilerplate as well. And now I can help by contributing my insights to the system from here. 2 devs is better than 1 I guess

hardy egret
#

My checkboxes are taking three clicks to check and only 1 box can be checked at a time. What am I doing wrong?

sharp belfry
#

I am not sure your checked condition is correct. It is trying to get a "key" inside traits, not the value of the variable key

hardy egret
hardy egret
hardy egret
#

rollingLabel += game.i18n.localize("PIONEERS.trait." + String(trait)) + ' '

This localize function is failing and returning the input string and I've checked that the stringID is correct. I can get handlebars localize to work but not js.

wheat plume
#

structurally this looks like you should be using the game.i18n.format helper?

hardy egret
#

I tried that one too same problem.

sharp belfry
#

if you do a console.log(String(trait)), what is the value?

hardy egret
sharp belfry
#

Can you share/confirm that this key is on the en.json file?

hardy egret
# sharp belfry Can you share/confirm that this key is on the en.json file?

"PIONEERS": {
"Trait": {
"Cha": { "long": "Charisma", "abbr": "cha" },
"Dat": { "long": "Data Collection", "abbr": "dat" },
"Hrd": { "long": "Hard Science", "abbr": "hrd" },
"Sft": { "long": "Soft Science", "abbr": "sft" },
"Fin": { "long": "Finesse", "abbr": "fin" },
"Con": { "long": "Constitution", "abbr": "con" },
"Bra": { "long": "Brawn", "abbr": "bra" }
},

#

It's the capital "T" in traits, isn't it?

sharp belfry
#

it is

#

it is case sensitive

#

not only in the T, but if your values are fin, it will not find as the file has it as Fin

hardy egret
#

I tried capitalize both the "Trait" and "Fin" and that didn't work.

#

I tried hard coding: rollingLabel += game.i18n.localize("PIONEERS.trait.fin") + ' '

Still didn't work.

sharp belfry
#

do you want to open a quick call so I can try to help you?

hardy egret
#

Sure. Thanks!

sharp belfry
#

Sent you a PM

hardy egret
hardy egret
#

I've got another one. Sorry. I'm trying to adjust the rollMode on this toMessage(). When rolled the message is always as set on my chat ui.

sharp belfry
#

the rollMode is part of the second parameter

roll.toMessage({
  speaker: ChatMessage.getSpeaker({actor: this.actor}), 
  flavor: label
}, {rollMode: CONST.DICE_ROLL_MODES.SELF});
forest locust
#

Where is the current documentation on getting started with Boilerplate?

real kraken
hardy egret
#

I'm trying to track the carrying load of actors. I've got a value in the template but not sure how to change the value as I add items to a character sheet. I'm thinking it is best done by Active Effects but I not sure how to setup a default effect that takes the item sheet input "weight" and adds it to the character sheet's "currentLoad". Any suggestions?

sharp belfry
#

Do this calculation in the prepareDerivedData

#

Because current load is a derived value based on the items' weight

hardy egret
#

I tried that but had trouble accessing the items' stats. I'll give it another shot.

hardy egret
#

Yeah, so in my "actor.mjs" file I have this: actorData = this

But actorData isn't giving me a way to the actors owned items.

sharp belfry
#

Is that valid for all actors or just some type of actors?

Depending you should be doing that in a different file.

But you should be able to access all items via this.items

Which method are you doing that?

hardy egret
#

I am doing it just for "character" types, right now.

I was able to find the weight stat through "_source" in actorData. I hadn't looked there before because I don't know what it is. Is there any problem with accessing the data that way?

sharp belfry
#

I don't think that's the proper way. I can take a look later today. Can you share your repo?

hardy egret
sharp belfry
#

Can you share your repository for the system code?

bronze glen
#

I apologize if i sound dumb but i am new to developing a system. I seem to be stuck in a loop trying to update my system to version 12 of foundry.

wheat plume
#

What do you have?

bronze glen
wheat plume
#

Screenshots?

bronze glen
wheat plume
#

Not to my DMs

#

That way if I'm busy someone else can help

bronze glen
supple kelp
#

Is this compatible with Version 13 or has it not been updated for it?

sharp belfry
#

We have a v13 PR that was not merged. But you can get from the PR branch

supple kelp
#

Does it have a tutorial, or is the Version 11 tutorial still accurate?

sharp belfry
#

There are some things that are changed in the code, but not in the tutorial. If this is your first time coding, it can be complicated that the tutorial is not up to date. But it should not be totally off.

The main difference is that the v13 branch uses the data model approach, and some other small changes for the new Foundry API. But I believe that it can still work quite similar with the tutorial

supple kelp
#

Thank you. This isn't my first time coding, but they made Foundry so damn weird and arcane that I absolutely cannot wrap my head around it, so I'm trying to simplify the process for myself as much as I can XD

sharp belfry
#

I still think that you can spot the differences and use that. And if you have any issue, I am sure that the people in the #system-development channel are open to talk. And if you would be kind to create a list of what is "missing" or changed in the tutorial, I can try to check that later to update it too

steady hawk
#

Hello everyone. I have issues understanding how setting an initiative works.
I have reached a point where just formula declaration is not enough for my system and I want to implement some conditionals there:
this is my current initiative

CONFIG.Combat.initiative = {
formula:
"1d12 + @secondaryAttributes.ini.total + @secondaryAttributes.spd.total",
decimals: 0,
};

But in my ruleset, the player can get a feat that will give them advantage on the D12 roll.

Also NPCs in my system shouldnt use spd.total for their initiative roll so I wanted them to have a different formula.

Problem is I have no idea how to implement it inside the Hooks.once("init", function () {

Any idea what would be the correct way to implement these ?

wheat plume
steady hawk
wheat plume
#

Similar situation as Actor and Item, these deserve their own files

#

Extending these classes is not covered in Boilerplate specifically because it's a more advanced topic

chrome stirrup
#

Hey folks, is there any boilerplate v13 branch that includes anything on customizing a dark/light theme?

wheat plume
#

Fortunately that's basically just a bunch of css

#

@chrome stirrup heres what we use in Draw Steel

:root, .application.draw-steel.themed.theme-light {
  --draw-steel-c-dark: #191813;
  --draw-steel-c-faint: #c9c7b8;
  --draw-steel-c-beige: #b5b3a4;
  --draw-steel-c-tan: #444444;
  --draw-steel-c-white: #ffffff;
  --draw-steel-c-black: #000000;
  --draw-steel-c-groove: #eeede0;
  --draw-steel-c-success: green;
  --draw-steel-c-failure: red;
  --draw-steel-c-item-header-bg: #bebbab;
  --draw-steel-c-item-alternating-bg: rgba(0, 0, 0, .05);
}

.theme-dark, .application.draw-steel.themed.theme-dark {
  --draw-steel-c-dark: #c9c7b8;
  --draw-steel-c-faint: #191813;
  --draw-steel-c-beige: #444444;
  --draw-steel-c-tan: #b5b3a4;
  --draw-steel-c-white: #000000;
  --draw-steel-c-black: #ffffff;
  --draw-steel-c-groove: #11121f;
  --draw-steel-c-item-header-bg: #28232f;
  --draw-steel-c-item-alternating-bg: rgba(255, 255, 255, .05);
}
sharp belfry
#

We have a V13 PR opened, and it has some small customisation regarding themes, if I recall correctly

wheat plume
#

The basic idea is you set your css variables based on the theme then just use var for the themes

chrome stirrup
#

thank you folks, this should get me started!

gleaming vine
#

Hi, I'm not sure if this is the right channel to ask this question, but how do I create a compendium with folders and items within them?

In this case, I created a compendium, but I'm not able to divide the items into folders; in fact, it doesn't even look like folders. I created it directly from the code of the system I'm using, but I'm not sure if I'm doing it right. I need help just figuring out how to create the JSON structure (if applicable) to place the items within the folders.

wheat plume
gleaming vine
# wheat plume Did you define the compendium in your system.json or did you use the in-world cr...

I defined the compendium in my system.json because I wanted to do it like the D&D or Old Dragon 2e system (which are the two I'm trying to base this on), where when you open the board or create a board and then open the compendiums, they're already downloaded, without needing to be created.

Do you think it's better if I post my question in this channel then https://discord.com/channels/170995199584108546/670336275496042502 ?

wheat plume
#

This channel is much more for stuff like "how does the generate function work"

storm night
#

I'm using the boilerplate system to port to foundry. However I am encountering a slight snag. I've looked through a few files and the walkthrough. And I can't seem to find where I would define the value for character attributes in terms of the modifier applied to rolls.

wheat plume
#

e.g. if you've got system.foo.bar, then 2d6 + @foo.bar will reference that stat

storm night
#

so that would be in the mjs file?

wheat plume
storm night
#

Do I need to plug in my my own config for that? Like how they have CONFIG.Combat.initiative

wheat plume
fresh reef
#

I'm attempting to learn foundry development using boilerplate. I'm trying to start simple by just adding a field called 'test' to my character sheet. The field appears in the sheet, but when I enter data into it, it doesn't save to the sheet. The other existing fields still save appropriately. What am I missing?

actor-character.mjs snippet

schema.test = new fields.StringField({required: true, blank: true});

actor-character-sheet.hbs snippet

<div class="resource flex-group-center">
  <label for="system.test.value" class="resource-label">Test</label>
  <div class="resource-content flexrow flex-center flex-between">
  <input type="text" name="system.test.value" value="{{system.test.value}}" data-dtype="String"/>
  </div>
</div>
wheat plume
fresh reef
#

I've removed the for. Is the for a foundry or handlebars thing?

I added the {{log system}}. It was helpful as it revealedtest is coming through as test: "[object Object]" instead of a string, which I'm guessing is the root of my issue

I'm guessing it is v1. This is using the latest release of boilerplate (2.0.1). All references to ActorSheet in the code don't mention ActorSheetV2.

wheat plume
wheat plume
wheat plume
fresh reef
#

Ah, should have figured it was just HTML. Been a long while since I've done any input forms.

That was my problem! I was using test.value. I had wrongly assumed the string was an object and not a plain string. Thanks for assisting in uncovering that!

Should I look into that or would it be better to use that v13 branch I've seen kicked around?