mclemente / about-face

FoundryVTT Module to rotate tokens on move
Other
7 stars 8 forks source link

TypeError I get every time I load into Foundry. #63

Closed GambetTV closed 1 year ago

GambetTV commented 1 year ago

It seems to have to do with the Multilevel Tokens module, but I couldn't tell you why.

TypeError: Cannot read properties of null (reading 'document') at drawAboutFaceIndicator (logic.js:125:20) at Object.fn (about-face.js:47:70) at #call (foundry.js:724:20) at Hooks.callAll (foundry.js:681:17) at ClientDatabaseBackend.callback (foundry.js:12781:13) at foundry.js:12761:43 at Array.map (<anonymous>) at ClientDatabaseBackend._handleUpdateEmbeddedDocuments (foundry.js:12761:33) at ClientDatabaseBackend._updateEmbeddedDocuments (foundry.js:12635:17) at async TokenDocument5e.updateDocuments (commons.js:6146:23)

mclemente commented 1 year ago

Do you have some steps to replicate this? The indicator can't be rendered because the token doesn't have a document and I'm wondering how that's even possible.

GambetTV commented 1 year ago

There's not really steps to follow, as I literally just load in and I get the errors, without interacting with Foundry at all. That said, upon further review, it seems to be a strange error in combination with your module, Multilevel Tokens, and Fog Manager. If I disable any one of them, the errors go away. I call the error out to you because the error mentions your module specifically.

mclemente commented 1 year ago

That error isn't caused by About Face, though. Something else created a token that has no document and About Face assumes every token has one and there's nothing it can do without that data. With that said, I still want to figure out what is causing this behavior. Could you zip your world and upload it here? I'm not familiar with Fog Manager and I couldn't reproduce this behavior, so that would be faster to solve this issue.

GambetTV commented 1 year ago

It does seem like every module that creates a token on its own for some reason has bad interactions with About Face. I use Drag Upload, and whenever I use that to create an Actorless Token I get errors. I just downloaded the very cool "Drop My Torch" mod which will create a token with a light source on it and drop it on the map, and I'll get several errors and the directional indicator won't disable even if you disable it in the token itself.

mclemente commented 1 year ago

whenever I use that to create an Actorless Token I get errors

For that I had a fix ready that should be out now, but I was waiting on more info about the document-less tokens. At least now you can tell which token is causing the error in the first message.

GambetTV commented 1 year ago

Yeah, sorry. I disabled Fog Manager and the original problem went away, so I largely forgot about it because Fog Manager isn't really a vital module for me. The new error I've found is that with "Drop My Torch" whenever I have a macro create a token I get this error:

TypeError: Cannot read properties of null (reading 'hasPlayerOwner') at drawAboutFaceIndicator (logic.js:162:39) at Object.fn (about-face.js:46:61) at #call (foundry.js:724:20) at Hooks.callAll (foundry.js:681:17) at ClientDatabaseBackend.callback (foundry.js:12613:13) at foundry.js:12594:43 at Array.map (<anonymous>) at ClientDatabaseBackend._handleCreateEmbeddedDocuments (foundry.js:12594:33) at ClientDatabaseBackend._createEmbeddedDocuments (foundry.js:12499:17) at async TokenDocument5e.createDocuments (commons.js:6110:23)

and the token has a direction indicator that can't be turned off. I don't know if it would be possible, but it'd be cool if there were a way to just never have the indicators show up if they were set to "Never Show" in the main settings. Like some kind of master disabler for anyone who never intends to use them. I have no need of the indicators because I use top-down tokens, rather than the portrait-coin looking tokens, so their facing is already obvious.

mclemente commented 1 year ago

Are you on version 3.22.6? That error should've been fixed.

it'd be cool if there were a way to just never have the indicators show up if they were set to "Never Show" in the main settings.

Have you set (NPCs) Enable Token Indicators setting to Never Show?

GambetTV commented 1 year ago

Nice! Yeah, sorry, I don't think 3.22.6 was out when I made my latest post, but 3.22.6 fixed it. And yeah, I have that setting set correctly, but the problem went away for both modules with the latest version. I tried reactivating Fog Manager, and I still get the errors from my original post there, but TBH Fog Manager causes multiple issues and slowdowns for me, so it's not really worthwhile to use even if you were to fix the errors on your end. So at this point I'm pretty good with just closing this!