1000nettles / hey-wait

“Hey, Wait!” is a FoundryVTT module allowing a GM to place “event triggers” on a scene.
https://foundryvtt.com/packages/hey-wait/
MIT License
9 stars 2 forks source link

Tiles not triggering in 0.8.9 #26

Closed saw-lau closed 2 years ago

saw-lau commented 3 years ago

(Hey, Wait! version 0.6.1)

Following an upgrade to Foundry 0.8.9, the Hey, Wait! tiles no longer trigger.

I'm no JavaScript programmer, but attempted to dig around and was wondering it this was related to the following issue: https://gitlab.com/foundrynet/foundryvtt/-/issues/5651.

Looking at the TokenUpdateCoordinator.coordinateUpdate method, this.tokenInitPos.get(tokenDoc.id) is always returning null (or whatever - as I said, I'm no JS dev!), so the method calls _cleanQueuedTokenInitPos and then exits.

The only place I saw TokenUpdateCoordinator.tokenInitPos being set was in registerTokenInitPos, and the only reference I found to that was during the module setup:

Hooks.on('preUpdateToken', async document => {
  tokenUpdateCoordinator.registerTokenInitPos(document.toObject());
});

Given that the issue referenced above talks about pre-updates on tokens, I thought this might be a cause?

Additionally, from within Foundry's debugging tools I searched for 'preUpdateToken' and found _preUpdateTokenActor in the Foundry files, so maybe the name had been changed?

1000nettles commented 3 years ago

Hey! Thank you so much for the in-depth analysis here. I just got back from vacation so I can take a look today. I'll post an update later...

1000nettles commented 3 years ago

So I took a peek, and I'm unable to reproduce on v0.8.9 of FoundryVTT. Just want to check before digging further, are you sure that you don't have "Token Disposition Types Allowed" set to something restricting the token you're testing with, or "Restrict GM From Triggering Tiles" set to checked (and testing with a GM user?)

saw-lau commented 3 years ago

Just want to check before digging further, are you sure that you don't have "Token Disposition Types Allowed" set to something restricting the token you're testing with, or "Restrict GM From Triggering Tiles" set to checked (and testing with a GM user?)

No, I'm pretty-sure they're both set correctly. It's more than likely some bizarre interaction with other modules. Let me do some testing and get back to you.

saw-lau commented 3 years ago

OK, I've got what the problem is now. Nothing to do with other modules or tiles not triggering...

It turns out that I'd placed the Hey, Wait! tiles in the foreground tile layer, and not the background one.

However, I did this because the system wouldn't allow me to place them in the background layer... I'm playing D&D and have used kakaroto's R20Converter, which seems to place the background map graphic as a tile with a z-order of 0 (as opposed to have a background image for the scene), so maybe that explains why I can't place background tiles over the top?

saw-lau commented 2 years ago

OK, I've got what the problem is now. Nothing to do with other modules or tiles not triggering...

It turns out that I'd placed the Hey, Wait! tiles in the foreground tile layer, and not the background one.

However, I did this because the system wouldn't allow me to place them in the background layer... I'm playing D&D and have used kakaroto's R20Converter, which seems to place the background map graphic as a tile with a z-order of 0 (as opposed to have a background image for the scene), so maybe that explains why I can't place background tiles over the top?

OK - found a workaround to the R20Converter 'thing' of using tiles for the background map. It's trivially easy to just point the background image to that tile and then delete the tile. Hey, Wait! then works perfectly!!!