geoidesic / foundryvtt-actor-studio

A FoundryVTT module for creating Actors
MIT License
3 stars 1 forks source link

Preemptive end of character creation. #52

Closed ChobitsCrazy closed 3 weeks ago

ChobitsCrazy commented 3 weeks ago

Foundry - v11.315 D&D5e - 3.1.2 AS - 1.0 Modules - Only modules enabled is AS

After selecting race/background/class and going through the advancement. Once the Background advancement is competed it ends the character creation and preemptively creates the character. https://github.com/geoidesic/foundryvtt-actor-studio/assets/21301107/d12114f9-842d-42c9-a5e6-36bc8a190baf

geoidesic commented 3 weeks ago

To debug this I'd either need any errors from the console or I'd need access to the data that you are using... class, subclass, background, race

ChobitsCrazy commented 3 weeks ago

Let me know if this helps: fvtt-Item-path-of-the-ancestral-guardian-0YmLPWfKyg4prYaP.json fvtt-Item-barbarian-QULNqco0htSeBV3e.json fvtt-Item-acolyte-ku8oxsYVnmwlfdPF.json fvtt-Item-aasimar-csET1gq2IcH8sCwX.json

geoidesic commented 3 weeks ago

Thanks yes, that does help. It looks like those items are misconfigured. I haven't done a full analysis of all those items yet but e.g. the Acolyte that you provided definitely has misconfigured advancements, which is strange because Acolyte background is an SRD item, and the SRD version works correctly... so it begs the questions;

  1. Where did you get the version of Acolyte background that you are using? Perhaps suggest to the authors that they update their assets to be compatible with the latest 5e.
  2. Why not use the SRD version?
geoidesic commented 3 weeks ago

Further analysis of the Acolyte export you provided...

Here is a side-by-side comparison of the SRC Acolyte, with the version you provided: Screenshot 2024-06-27 at 11 29 02

As you can see, the version you provided (left) has misconfigured advancements.

Most likely this is the case for the other samples you provided too.

ChobitsCrazy commented 3 weeks ago

So I'll admit that there was a grant items that didn't have any advancement on it, however I fixed those but still have an issue. Here is the advancements for each of these items (most are references to other compendiums): image image image

Would it not be best to detect malformed advancements and just chose to skip over them and continue the process as normal?

geoidesic commented 3 weeks ago

Send me the updated .json files please and I'll see what's possible. I've really just integrated with the 5e advancements system. All Actor Studio does is drops the item on the Actor sheet and then collects the Advancement windows as they popup. If there's one that doesn't pop up, that likely means that the 5e sheet is experiencing an error and stops the chain. So there's nothing I can do about that. You would have to take that up with the dnd5e team.

But what I can do is help you understand where it's breaking and help you work towards understanding how to produce content that is compatible with the dnd5e system.

ChobitsCrazy commented 3 weeks ago

fvtt-Item-path-of-the-ancestral-guardian-KYB8KhSmf89IEXeI.json fvtt-Item-barbarian-yrS4wWNTdnwkyHIr.json fvtt-Item-acolyte-Wtvb5gdyEtaYVB0e.json fvtt-Item-aasimar-Tq8mJErlb3U8UHq2.json

ChobitsCrazy commented 3 weeks ago

I'm packing some assets into a test module for better review of the items.

ChobitsCrazy commented 3 weeks ago

as-test.zip

geoidesic commented 3 weeks ago

FYI I tested your new acolyte .json. That worked fine for me. I used it in between SRD choices for the rest and the advancements chained correctly, even though the Item Grants couldn't be processed.

ChobitsCrazy commented 3 weeks ago

So it's failing on the step after the background?

ChobitsCrazy commented 3 weeks ago

Trying each combination of my class/race/etc with the SRD and so far my Half-Elf Race is causing the issue.

ChobitsCrazy commented 3 weeks ago

Created a brand new race with nothing else. Changed the advancement to this and it causes it to end: image image

geoidesic commented 3 weeks ago

Analysed your Aasimar race...

Some good news. I found some errors in Actor Studio logic for processing Advancements. The way it knows whether to continue or stop is it looks at the level property of the advancement. My assumption was that it should match the character level, or stop.

There were two reasons for your Aasimar race to cause a problem:

  1. It contains an advancement that has a level value of undefined (for Celestial Revelation), which is wrong.
  2. It contains no advancements marked for level 1 (which is why the advancements stopped). However, a level value of 0 is also valid (which it did contain) and should be processed by Actor Studio for Level 1, so that's a bug I can fix. The fact that it worked for all the SRD classes is because all of them have advancements for Level 1.

I'm not sure how you ended up with an undefined level? The system probably shouldn't allow that. However what I'll do is make Actor Studio treat undefined as equivalent to zero, which should act as a bridge for such cases.

Presumably this is the same reason that the custom class and subclass is skipping their advancements – i.e. they have no level 1 advancements defined. I haven't analysed them yet but that's my guess.

Screenshot 2024-06-27 at 18 14 25

geoidesic commented 3 weeks ago

Incidentally I'm a bit confused by why the 5e system allows "Any Level" (i.e. 0) as an option. It's not clear what the intent there is:

  1. If it's intended for level 1, then why not make it Level 1?
  2. If it's intended "any level" then what does that mean? Should it be imported each level? That makes no sense.
ChobitsCrazy commented 3 weeks ago

While the system doesn't inherently allow it, many people will play at level 0 in campaigns (myself included) Since only classes are linked to levels, backgrounds and races aren't a part of the leveling system by default.

NPCs can also have backgrounds and races but never have a class therefore are level 0.

geoidesic commented 3 weeks ago

In that case treating 0 and undefined as a proxy for 1 should work. I'll implement that and we'll see.

geoidesic commented 3 weeks ago

Btw FYI Actor Studio drops items in the following order (not in the order they were selected):

  1. background
  2. race
  3. class
  4. subclass

So that will always be the order in which the advancements execute.

geoidesic commented 3 weeks ago

Update: the (unreleased) fix I applied worked for the supplied custom class but not for the subclass. Will analyse that next.

geoidesic commented 3 weeks ago

as-test.zip

FYI some of the item images didn't port Screenshot 2024-06-27 at 21 20 25

geoidesic commented 3 weeks ago

Fixed in https://github.com/geoidesic/foundryvtt-actor-studio/releases/tag/1.0.2