geoidesic / foundryvtt-actor-studio

A FoundryVTT module for creating Actors
MIT License
7 stars 4 forks source link

### Bug Report: Compatibility Issue with "Actor Studio" (D&D 5e Character Creator for Foundry VTT) #85

Closed Zarhog closed 1 month ago

Zarhog commented 2 months ago

Title: Compatibility Warning and Import Failure for Class and Race Data

Description: The "Actor Studio" mod for Foundry VTT is encountering multiple issues related to compatibility warnings and import failures. The error logs indicate that the mod is facing problems due to deprecated features and missing identifiers in data updates. Specifically, the errors pertain to the deprecation of advancement hints and issues with providing identifiers for document updates, which is causing failures in importing class and race data.

Error Messages:

  1. Compatibility Warning:

    commons.js:2070  Error: Advancement hints are now part of the base data model.
    Deprecated since Version DnD5e 3.3
    Backwards-compatible support will be removed in Version DnD5e 4.1
       at Object.logCompatibilityWarning (commons.js:2059:19)
       at get hint (trait.mjs:44:19)
       at Object.p (Class.svelte:195:1649)
       at Object.p (Class.svelte:195:1507)
       ...
  2. Import Failure:

    foundry.js:13637  Uncaught (in promise) Error: You must provide an _id for every object in the update data Array.
       at #preUpdateDocumentArray (foundry.js:13637:32)
       at ClientDatabaseBackend._updateDocuments (foundry.js:13449:73)
       at ClientDatabaseBackend.update (commons.js:8677:19)
       at async Actor5e.updateDocuments (commons.js:8001:23)
       at async Actor5e.update (commons.js:8098:23)
       ...

Expected Behavior:

Actual Behavior:

Steps to Reproduce:

  1. Attempt to import class and race data using the "Actor Studio" mod.
  2. Observe the error messages related to deprecated features and missing identifiers.
  3. Note that the import process fails to complete.

Impact: These issues prevent users from successfully importing class and race data, impacting character creation and potentially causing disruptions in gameplay.

Suggested Fixes:

System Information:

Zarhog commented 2 months ago

example class fvtt-Item-ranger-Yyq7puWIjBebqQ2o.json

Zarhog commented 2 months ago

im unsure if i did somthing wrong :) but i did build the Class from scratch, but the race is from SRD. so at the very least the race should not have failed. checking the code of the class against other such classes i dont see any issue with what ive done on my end.

geoidesic commented 2 months ago

So, I think there's a fundamental misunderstanding baked into your question about what it is that Actor Studio is doing...

Actor Studio doesn't in any way manipulate the data stored in a Race, Background, Class or Sub-class. All it does is read what's in the compendium you provide and present it for your perusal.

When you make your selection it creates an Actor and then it just drops the items onto the Actor Sheet. You'd get precisely the same result if you created a Character without it, found the item in the compendium yourself and dragged it onto the Actor Sheet manually.

It creates the illusion that it's managing the Advancements within Actor Studio – but it's just an illusion; it's capturing the dialogs produced by the D&D system from the drop and just reframing them within Actor studio.

So you can kind of think of Actor Studio as a skin for the dnd foundry system. It simplifies character creation but it's just a go-between, not a producer of data. The only place where it does directly add data to the sheet is from the Attributes tab (e.g. Str, Dex, etc.)

So there's really nothing for me to do here. If you're getting reports about data-structure deprecations, that's down to the data, as stored in the compendium that you're pointing Actor Studio at.

Hopefully that helps but let me know if you think I've missed something. Having said that, I haven't tried it with D&D 3.3 yet. I will give that a go and see what I can see.

The first error you posted is just a deprecation, so that's nothing to worry about. Probably their compendium data hasn't caught up with their intentions yet, I would guess.

The second one, I'll have a look at, I do update the Actor data with name and attributes and maybe there's an issue there.

geoidesic commented 2 months ago

I've fixed 1, the deprecation warnings. for 2. I couldn't get it to break. I tried the ranger you attached. Works fine for me. The errors trace that you included doesn't show the full trace – perhaps you could include the full trace.

geoidesic commented 2 months ago

nvm, I found that issue, it occurs if you're in a broken state where you get the update button instead of the create button and then you click that.

geoidesic commented 2 months ago

Actually not all the deprecation warnings could be fixed. Unfortunately that fix will not be backwards compatible with Foundry v11 (as making it backwards compatibility will break reactivity mechanisms), so it's best if we put that off till D&D 4 comes out.

Zarhog commented 2 months ago

Wait im confused, is my server at fault or is it a bug with actor studios?????:

geoidesic commented 2 months ago

Well you've put two issues in one ticket which is why it's getting confusing to discuss

geoidesic commented 2 months ago

@Zarhog is this now resolved? If so, please close the ticket.

geoidesic commented 1 month ago

I'm assuming this is resolved, you can request it be re-opened if not.