shemetz / roll-from-compendium

FoundryVTT module that adds easy buttons to post things to chat.
MIT License
5 stars 2 forks source link

Cannot read properties of undefined (reading 'type') with DnD5e system. #25

Closed Littlepanda115 closed 8 months ago

Littlepanda115 commented 8 months ago

I can't see the creation of a dummy actor, nor a means to create the dummy actor myself. Unfortunately, the lack of creation for this might be the cause of this error. There doesn't seem to be a way to manually trigger the creation of this actor, or do it myself.

When trying to send a feature, item, spell, etc, to the chat, nothing appears.

This issue persists with all modules deactivated except this one. Interestingly, the 'Send Image to Chat' button for characters does work, however. I'm unsure if this is somehow an issue only happening to myself, but with the issue persisting with no other modules active, it might be due to recent versions of the DnD5e System or Foundry itself, as I am using the most recent version of both as of the creation of this issue.

Here is a screenshot of the error:

image

shemetz commented 8 months ago

Thank you! Apparently this was broken for almost 4 months... -_-

shemetz commented 8 months ago

Should be fixed in v1.7.2, I didn't even test this fix because it was so obvious from looking at the code but I'd appreciate if you can verify that it works now.

Littlepanda115 commented 8 months ago

Looks to be fixed, mate. Admittedly, doesn't do what I'd like, it just pops it out as if you'd rolled it, and doesn't show the description. Still, given they removed the original 'info' button themselves, I'm guessing that's because the multi-layered descriptions they added to the DnD5e system are just too difficult to sort.

It's still useful for popping out images and stuff, so I'm keeping it, and it seems to work well. Thanks for the fix!

shemetz commented 8 months ago

You can also hold Shift to make it output a link to the item, if that helps.

I agree that it's annoying that the dnd5e "item.roll()" function doesn't show description, but I don't know how this module could be changed to reasonable support both choices. it's easy for the code to switch to the other one (show item name, image, and description) so the problem is just an interface design issue.

I could add a 2nd button to the header, but that's quite cumbersome.

I could make it happen when you hold Ctrl or alt, but that would prevent certain key-holding responsiveness from the system or other modules (e.g. Ready Set Roll's advantage and disadvantage...)

I could make it a settings toggle but that's cumbersome too.

I guess maybe the best solution is... to manually check all dnd5e sheet types, write down a list of all the ones which have a description that doesn't show up, and then have the button post two messages for those items - one via calling roll and one via calling the internal simple description function.

Would that be good enough, in your opinion? It would probably be limited just to a few items (like weapons), and it would make this module stop being useful for people who want to e.g. attack with its buttons rather than through the character sheet or a macro, but I think that has to be a minority of users.

Littlepanda115 commented 8 months ago

Personally, with the removal of the 'info' button from base sheets, I would find a module that posts the description into the chat (something you can no longer do) more helpful than one that just rolls the feature/weapon (something you can just click the dice icon for, rather than opening the item/feature and using the module's button), but that's my use-case.

You needn't change the module just for my use-case, but I do know a fair few DMs who would get this in a heartbeat, since the removal of that 'info' button to post spell, item, and feature descriptions into the chat has led to weeks of, "What does that spell do again?" and, "Yeah, it says here it pois- Oh, it's not showing it. Uhh, where's that info button..." lmao. Especially things like announcing a monster's multiattack, only for it to just say 'Multiattack' with no description in the chat of how many, or what attacks.

I'd be grateful for the ability for it to do that, but it may well be alternative functionality to your intention, so don't feel any pressure to change your project to fit that need, I appreciate upkeeping these things is tough enough without taking requests xD

Thanks for the fix so far. If you'd prefer to stick to the original usage of acting as an alternative roll method, I may look into restoring the info button with a module of my own, if I can figure it out...

shemetz commented 8 months ago

Actually, can you show me a screenshot of what happens to you right now when you use the module to post a few spells, weapons, and features, for PCs and/or NPCs, one of each?

Because I do see descriptions now that I'm trying to do it:

image

Am I using an old version somehow?

Littlepanda115 commented 8 months ago

Oh, ermmm, huh. Okay, it's possible that a core dependency module we all share might be making this change, then, in which case, I am going to send a strongly-worded Email to whomever is responsible...

Sorry for the delay and format, I am having to screenshot a Parsec connection to my server laptop from my phone as I'm out at the gym, lol.

Screenshot_20240130_073956

Mine pops out like that, you can see that feature has a description, but the chat does not show it. Perhaps the tri-description layout is part of a library module that enables our other modules, do you have those three types of description?

Also, do you have an info button in your features and spells, etc, at the bottom? That button going missing is what prompted all of this, and if a core module dependency has done that, it would be a real pain.

I'll troubleshoot when I get a chance, though will, be at work soon so may be slow to respond if it's a heavier day.

Thanks for your help thus far!

Edit: I indeed disabled all other modules when getting it working to begin with. Once it was fixed, I hadn't tried it alone, as the lack of a description had seemed to be a Foundry/DnD5e System update change, not a fault with the module. Will test more soon!

shemetz commented 8 months ago

Sorry for the delay and format, I am having to screenshot a Parsec connection to my server laptop from my phone as I'm out at the gym, lol.

Wow, please don't feel obligated to respond so quickly :D I'll be happy even if you wait multiple days before responding, so no hurry (but thank you for the good responses).

It does seem like there's some bug in your setup that prevents those descriptions from showing up, but, it could be a bug with my own module too, making it somehow fail to work in some cases.

I can confirm that I do not have an "info" button like that in any feature or spell; I remember it existing in the past, so I think it was removed, indeed.

Once you have the time, I would appreciate one or more of the following troubleshooting steps:

  1. Disable all modules and then try the in-sheet button again
  2. Disable all other modules except this one and then try its button again
  3. Check the console (F12) to see if any big error messages pop up; may need to sift through them if there are many, and search for one that mentions this module or mentions descriptions
  4. Give me a link to your world and login details as a temporary account, to directly test in my own browser (if you're okay with that)

I would definitely expect some bug to be happening, from that screenshot, because I can see that there's a small empty space between two horizontal lines within the "Hateful Eyes" chat message. That space is exactly where the description is expected to appear.

Littlepanda115 commented 8 months ago

That sounds like a perfect plan, yeah. I'll get on it asap, though I don't think I have all my logins at work for GitHub and stuff, so it might be later. Thanks for the prompt responses on your end, too, lol.

I'll letcha know how it goes! I reckon if it is a bug with another module, I might delve into restoring the dedicated info button myself, since it's nice to discuss and display a feature without needing to activate it, lol, and this module can remain very helpful for rolling things from compendiums and popping images into the chat, etc.

Yeah, I'll letcha know soon! Thanks!

Littlepanda115 commented 8 months ago

Alrighty. Yeah, I just disabled all but your module, and it pops out just fine. Moreover, it looks like they all do when being activated/rolled normally, too, and the triple-stacked description isn't present. Whatever the Hell is adding that is likely the culprit, dearie me. I'll take a delve and see if I can find the module doing that, and edit this to say (just for curiosities' sake, lmao).

Thank you so much for your help and whatnot, hah.

EDIT:

It was Midi-QoL (MiDi Quality of Life)

image

That was set to 'none' by default, I had to change it...

Unbelievable...