vtt-lair / simbuls-cover-calculator

A Foundry VTT module that calculates cover for DnD 5e
MIT License
6 stars 4 forks source link

PF2E - No Chat Card & Not Applying Automatically. #57

Open SoilentBrad opened 11 months ago

SoilentBrad commented 11 months ago

As I mentioned on discord, I'm not getting the chat card and it's not applying automatically, so I'm not sure what I'm doing wrong. You said all of the settings looked right, so there might be something else. Here are the screenshots from Settings. simbuls-settings-1 simbuls-settings-2 simbuls-settings-3 simbuls-settings-4 simbuls-settings-5

You also asked me about errors. These are all of the things that popped up.

logger.js:4 simbuls-cover-calculator  |  Initializing Module
foundry.js:753  TypeError: Error thrown in hooked function '' for hook 'setup'. Cannot set properties of undefined (setting 'helpersIgnoreCover')
[Detected 1 package: simbuls-cover-calculator]
    at CoverCalculator.settings (CoverCalculator.js:164:80)
    at CoverCalculator.register (CoverCalculator.js:15:25)
    at cover-calculator.js:27:49
    at Array.forEach (<anonymous>)
    at Object.fn (cover-calculator.js:27:32)
    at #call (foundry.js:730:20)
    at Hooks.callAll (foundry.js:687:17)
    at Game.setupGame (foundry.js:8712:11)
    at async Game._initializeGameView (foundry.js:9990:5)
onError @   foundry.js:753
🎁call_wrapped   @   libWrapper-wrapper.js:507
🎁Hooks.onError#lib-wrapper  @   listeners.js:138
🎁Hooks.onError#0    @   libWrapper-wrapper.js:187
#call       @   foundry.js:734
callAll @   foundry.js:687
setupGame   @   foundry.js:8712
await in setupGame (async)      
_initializeGameView @   foundry.js:9990
_initializeView     @   foundry.js:9966
initialize      @   foundry.js:8650
await in initialize (async)     
🎁call_wrapped   @   libWrapper-wrapper.js:507
🎁libWrapperInit @   libWrapper-api.js:805
await in 🎁libWrapperInit (async)        
🎁Game.prototype.initialize#0    @   libWrapper-wrapper.js:187
window.addEventListener.once    @   foundry.js:91833

foundry.js line 753:

    if ( log ) console[log]?.(error);
foundry.js:7682 Foundry VTT | Retrieved and compiled template /modules/simbuls-cover-calculator/templates/partials/ModularSettingsCoverData.hbs
foundry.js:7682 Foundry VTT | Retrieved and compiled template /modules/simbuls-cover-calculator/templates/partials/TokenSizeDefaults.hbs

Not sure if there was anything else you needed that would help. There are errors for Dorako UI and PF2E system, and they're the same regardless of whether I target a creature that should have cover. I tried deactivating Dorako in case there was a conflict, but the only change was that the errors didn't trigger on an attack. The chat card still didn't pop up.

vtt-lair commented 11 months ago

@SoilentBrad thanks, the console points me to where the issue could be.

vtt-lair commented 11 months ago

@SoilentBrad this should now work on version 2.0.2, I had to disable some functionality that is more specific to 5e system (not the rule set but the actual 5e Foundry system). I will investigate if it's possible to somehow use it in the PF2e system. Please have a look at the new version and let me know

SoilentBrad commented 11 months ago

Looking good, @vtt-lair! The chat card is coming up.

Unfortunately, the AC bonus doesn't appear to be applying, whether I have it set to automatic or manual and select the type of cover. I had an AC 12 creature with standard cover (+2 AC), but was still able to hit it with a total 12 roll. Is there something I'm missing or that I need to do to apply it? Or is that the part you had to disable?

vtt-lair commented 11 months ago

@SoilentBrad I'll have to have a look at it. Unfortunately I don't play PF2e myself and the code for this system agnostic version wasn't all done by me. It's working on DnD5e, but is obviously a different system. So I will have to take a look and hopefully isn't too much separate work in order for it to work on PF2e, otherwise it might have to be scrapped. Cross your fingers

vtt-lair commented 11 months ago

I've flagged the module for DnD 5e again, as PF2e doesn't look like it uses effects the same way (or at all?) I'll play around a bit during the next week or so to see if anything can be done so that the effects also works for PF2e.

I'm sorry for the half-hope that this release caused, but will keep you updated.

SoilentBrad commented 11 months ago

No worries. I couldn't even begin to understand the work that goes into supporting multiple systems. It was difficult enough trying to figure out some minor data entry - Foundry's coding is a little beyond me.

Thanks for trying, and keep me posted if you manage to get it working.

SoilentBrad commented 10 months ago

Curious @vtt-lair. Did you ask about this in the PF2E discord server? They have a foundry mod development help channel that might help you find the necessary things to connect to. Or does this only use effects to apply the cover?