wintersleepAI / foundry-swnr

Stars Without Number: Revised for Foundry VTT
GNU Affero General Public License v3.0
31 stars 21 forks source link

Error: "Actors is not a valid embedded Document within the Token Document" #53

Closed SWNGM-Tenshu closed 11 months ago

SWNGM-Tenshu commented 1 year ago

Hey guys,

Thanks for making this system for Foundry. It's been my primary focus to get my roll20 campaign fully realised in Foundry due to this System :)

All in all, it works great but with the latest v11 Foundry version I have noticed an uptick in an error that I was getting far less frequently in the latest v10 patch.

Error: Error: "Actors is not a valid embedded Document within the Token Document."

freebootersofnewbendigo.forge-vtt.com-1686889833371.log

Full disclosure: I have been building this campaign in Foundry for almost a year on and off so there has been a lot updates and changes to Foundry since then. Lately with v11 this error is happening all the time for tokens that are not explicitly linked to Actor data. This is a big problem for NPCs in battle situations. The main trigger in my use case is when I roll an attack with damage and try to apply the damage to the selected NPC token from within the damage roll. (The little +, - buttons under the damage number) Trying to do this will always display the error UNLESS I connect the NPC token to the NPC actor sheet.

I'm not much of a JSON person, so a lot of how Foundry works under the hood is lost on me, so apologies if this is more towards the App and not the System.

driesco95 commented 1 year ago

I wanted to second this issue, I'm having the exact same one. Only happens when the token is Linked. image

ExiledPrince113 commented 1 year ago

I am getting the same error as listed above whenever I try to change the character's health on a Token via right click and entering -X into the resource field on the bottom of the menu. It should be noted that my players do not have this issue, they can edit their own health no problem, and I can edit PCs and NPC HP from their character sheet (opened via the Actors menu on the sidebar), the issue seems to be entirely with attempting to edit the health on the token or attempting to do so on the character sheet opened by double clicking the token.

wintersleepAI commented 12 months ago

This might be fixed now with the following test release. Thanks for your help IDing the problem which made it easier to test. Stas (burning wheel dev) gave me the fix. Let me know if you can test this out.

https://github.com/wintersleepAI/foundry-swnr/releases/download/v1.0.4/system.json

Repede commented 12 months ago

image Getting this trying to update

Repede commented 12 months ago

The json also still says version 1.0.3 inside it, and links to 1.0.3 zips and such

Repede commented 12 months ago

Doing more testing/trying to fix by uploading a updated system.json with 1.0.4 set for the zips and version number. Trying to install it is getting the error "id: may not be undefined"

wintersleepAI commented 12 months ago

Sorry not sure what happened there. Can you uninstall your system and install via the system URL https://github.com/wintersleepAI/foundry-swnr/releases/download/v1.0.4/system.json .

DO NOT TEST with any game you care about!!

Repede commented 12 months ago

Managed to install it, the issue with updating health on unlinked tokens seems to work now on the latest v11

wintersleepAI commented 11 months ago

going to close the issue. will be fixed in the next release