manuelVo / foundryvtt-drag-ruler

A Foundry VTT module that shows a ruler when dragging tokens so you can see how far you've dragged them
MIT License
40 stars 55 forks source link

Emit a warning/error when a module registers with an invalid id #220

Open Deyzeria opened 2 years ago

Deyzeria commented 2 years ago

Making a custom system in Sandbox, I understood that I would like to have Drag Ruler. However, just linking the attribute didn't seem to work, so I came to making a custom module, following both the guide and several examples, however after quite a number of tries, none of them seem to work- the installed module's version doesn't even appear as a valid speed provider system in Drag Ruler. No errors also seem to be happening in the console on launch.

Link to the exact speed provider code, and the module as a whole

Will appreciate any help. Thanks.

manuelVo commented 2 years ago

Are there any errors or warnings in the javascript console?

Deyzeria commented 2 years ago

There are, but I believe both are connected in some way to other problems, not Drag Ruler. image

manuelVo commented 2 years ago

Just to be sure, did you check the console after trying to drag a token? Some extension module related errore/warnings may only come up once a toke is being dragged

Deyzeria commented 2 years ago

Sorry for not answering for some time. No, there are none.

manuelVo commented 2 years ago

Looking at your code, I can see that ranges returns color ID walk, which hasn't been declared in colors. This should cause Drag Ruler to emit a warning or error. Since it doesn't do that, I suspect that your extension module isn't activated for some reason. Please verify that your custom Speed Provider is selected in Drag Ruler's Game System Integration Settings

Deyzeria commented 2 years ago

I did mention it in the opening post- the problem is that it doesn't even have any custom speed providers, only a generic one.

However that point about color is correct, I believe I edited it at some point, and forgot to edit it in both places. In 9 hours will check and write.

manuelVo commented 2 years ago

Sorrry, I must have missed that while reading the original post. Does your module appear in Foundries Module list? If so, is it enabled (it must be enabled there before it can be detected by Drag Ruler)

Deyzeria commented 2 years ago

So, yeah. If needed can provide in video format. Everything is made still in v9.

изображение Both modules(and socketlib) are enabled. No others.

изображение Drag Ruler only lists generic speed provider.

изображение Console only lists some yellow warning, and the JavaScript console I already sent before.

I'm using ForgeVTT server hosting(wouldn't think it being important, but before I already encountered one module which just completely didn't work on Forge). This is also using 1.0.7 of my integration, where I fixed incorrect color.

Upd even before I posted- decided to add a few console.logs. Three of them, the first one being literally before "Hooks.once". None of them displayed in the console. I have a feeling I made a mistake somewhere with the code for the module itself, not the integration with Drag Ruler

manuelVo commented 2 years ago

It appears that the name field in your module.json has an extra space at the beginning. That could possibly be the cause of the issue.

Deyzeria commented 2 years ago

Yeah. Yeah it was the space. Thanks, sorry for bothering with a mistake that was in no way a part of the module, and thanks a lot <3

manuelVo commented 2 years ago

I'll investigate if Drag Ruler could emit a warning for such cases in the future and will leave the issue open to track that feature.