misthero / dnd5e-spellpoints

FoundryVTT module for spellpoints magic system 5e
MIT License
8 stars 16 forks source link

Spellpoints Item Not affecting Actor on equip #82

Closed notaWizard11 closed 3 months ago

notaWizard11 commented 4 months ago

Since I updated this morning, it seems that when I create a new actor and then add the Spell Points item to the character sheet, it does not add the spell points bar, or interact as expected at all.

Here is the data from the console when I add the item to the actor's sheet:

Foundry VTT | Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem' foundry.js:733

call @ foundry.js:733

callAll @ foundry.js:687 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:961 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:919 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1113 _onDrop @ foundry.js:71199 🎁call_wrapped @ libWrapper-wrapper.js:507 _lw_ActorSheet_prototype__onDrop @ Bundle.js:126179 await in _lw_ActorSheet_prototype__onDrop (async) 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁ActorSheet.prototype._onDrop#0 @ libWrapper-wrapper.js:189 _onDrop @ base-sheet.mjs:894 _onDrop @ character-sheet-2.mjs:1095 callback @ foundry.js:65650 🎁call_wrapped @ libWrapper-wrapper.js:507 🎁DragDrop.prototype.callback#item-piles @ libwrapper.js:58 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁DragDrop.prototype.callback#0 @ libWrapper-wrapper.js:189 _handleDrop @ foundry.js:65701

Foundry.js:753 Error: Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'. Unresolved StringTerm 2x1 requested for evaluation [Detected 1 package: dnd5e-spellpoints] at StringTerm.evaluate (foundry.js:12750:11) at Roll._evaluateSync (foundry.js:10325:36) at Roll.evaluate (foundry.js:10250:64) at SpellPoints.withActorData (spellpoints.js:129:7) at SpellPoints._calculateSpellPointsCustom (spellpoints.js:503:38) at SpellPoints.updateSpellPointsMax (spellpoints.js:677:68) at SpellPoints.processFirstDrop (spellpoints.js:769:19) at Object.calculateSpellPointsCreate [as fn] (spellpoints.js:643:19) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at ClientDatabaseBackend.callback (foundry.js:13604:13) at foundry.js:13576:43 at Array.map () at #handleCreateDocuments (foundry.js:13576:33) at async Item5e.createDocuments (commons.js:7958:23) 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 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:961 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:919 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1113 _onDrop @ foundry.js:71199 🎁call_wrapped @ libWrapper-wrapper.js:507 _lw_ActorSheet_prototype__onDrop @ Bundle.js:126179 await in _lw_ActorSheet_prototype__onDrop (async) 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁ActorSheet.prototype._onDrop#0 @ libWrapper-wrapper.js:189 _onDrop @ base-sheet.mjs:894 _onDrop @ character-sheet-2.mjs:1095 callback @ foundry.js:65650 🎁call_wrapped @ libWrapper-wrapper.js:507 🎁DragDrop.prototype.callback#item-piles @ libwrapper.js:58 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁DragDrop.prototype.callback#0 @ libWrapper-wrapper.js:189 _handleDrop @ foundry.js:65701

Let me know if there are any screenshots or other details I can provide.

Spell points still work as expected on actors I had equipped with the item prior to the update.

misthero commented 4 months ago

can you send a screenshot of your formula?

notaWizard11 commented 4 months ago

image

I have not checked the box in the item for overriding settings.

misthero commented 4 months ago

I think that's wrong, "x" doesn't mean anything for foundry, if you want the formula to be the double of @details.level you should write: 2*@details.level

notaWizard11 commented 4 months ago

image image All right, so changing the formula does seem to have stopped the error.

However, I created a test wizard and added a spell and the spell points item, and its not working. This is what it showed.

I did however get a chat message: image

This is what comes up on the console when I try to Import the Spell Points item from the compendium:

undry.js:733 Foundry VTT | Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'

call @ foundry.js:733

callAll @ foundry.js:687 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 create @ commons.js:8081 importFromCompendium @ foundry.js:15684 await in importFromCompendium (async) importFromCompendium @ items-collection.mjs:16 callback @ foundry.js:83385

onClickItem @ foundry.js:64986

dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 foundry.js:753 TypeError: Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'. Cannot read properties of null (reading 'update') [Detected 1 package: dnd5e-spellpoints] at SpellPoints.processFirstDrop (spellpoints.js:755:11) at Object.calculateSpellPointsCreate [as fn] (spellpoints.js:643:19) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at ClientDatabaseBackend.callback (foundry.js:13604:13) at foundry.js:13576:43 at Array.map () at #handleCreateDocuments (foundry.js:13576:33) 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 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 create @ commons.js:8081 importFromCompendium @ foundry.js:15684 await in importFromCompendium (async) importFromCompendium @ items-collection.mjs:16 callback @ foundry.js:83385

onClickItem @ foundry.js:64986

dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 commons.js:8807 Foundry VTT | Created Item with id [RVgGu4wNe71J4zYo] logger.js:5 Item Macro | Adding Context Menu Items. foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/feat.hbs ale.png:1 GET http://localhost:30000/Jellyverse/Items/Drinks/ale.png 404 (Not Found) Image (async) _onLazyLoadImage @ foundry.js:69113 foundry.js:7682 Foundry VTT | Retrieved and compiled template modules/walledtemplates/templates/walled-templates-dnd5e-spell-template-config.html foundry.js:7682 Foundry VTT | Retrieved and compiled template modules/dnd5e-spellpoints/templates/spell-points-item.hbs foundry.js:5802 Foundry VTT | Rendering ModuleManagement foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/setup/parts/package-tags.hbs foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/apps/module-management.html

misthero commented 4 months ago

I tried but cannot replicate your issue:

https://github.com/misthero/dnd5e-spellpoints/assets/3662610/a6ff050a-f326-429e-9146-9caf229a6db0

what you did different?

notaWizard11 commented 4 months ago

No, you're doing everything the same as me, except when the spell points item is dropped the character sheet doesnt update.

I was wondering if it was a module conflict, as I have a fair bit of automation set up, so I created a new world, activated only your module, and created a new actor in the same way. It works in the new world as expected.

I was playing around with different settings and random things back in my main game world, and then I tried dragging the Spell Points item from an actor that it is working on, onto the Test wizard actor. When I do this, it immediately works. It throws this in the console though:

Foundry.js:733 Foundry VTT | Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'

call @ foundry.js:733

callAll @ foundry.js:687 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:961 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:919 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1113 _onDrop @ foundry.js:71199 🎁call_wrapped @ libWrapper-wrapper.js:507 _lw_ActorSheet_prototype__onDrop @ Bundle.js:127870 await in _lw_ActorSheet_prototype__onDrop (async) 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁ActorSheet.prototype._onDrop#0 @ libWrapper-wrapper.js:189 _onDrop @ base-sheet.mjs:894 _onDrop @ character-sheet-2.mjs:1095 callback @ foundry.js:65650 🎁call_wrapped @ libWrapper-wrapper.js:507 🎁DragDrop.prototype.callback#item-piles @ libwrapper.js:58 🎁call_wrapper @ libWrapper-wrapper.js:616 🎁DragDrop.prototype.callback#0 @ libWrapper-wrapper.js:189 _handleDrop @ foundry.js:65701 foundry.js:753 Error: Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'. Roll.safeEval produced a non-numeric result from expression "" [Detected 1 package: dnd5e-spellpoints] at Roll.safeEval (foundry.js:10437:13) at Roll._evaluateTotal (foundry.js:10342:36) at Roll._evaluateSync (foundry.js:10329:24) at Roll.evaluate (foundry.js:10250:64) at SpellPoints.withActorData (spellpoints.js:129:7) at SpellPoints._calculateSpellPointsCustom (spellpoints.js:529:58) at SpellPoints.updateSpellPointsMax (spellpoints.js:677:68) at SpellPoints.processFirstDrop (spellpoints.js:769:19) at Object.calculateSpellPointsCreate [as fn] (spellpoints.js:643:19) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at ClientDatabaseBackend.callback (foundry.js:13604:13) at foundry.js:13576:43 at Array.map () at #handleCreateDocuments (foundry.js:13576:33) at async Item5e.createDocuments (commons.js:7958:23) o

I'm tempted to uninstall then reinstall the module... but I'm concerned that it may corrupt the version of the item that is working for me. Do you have any suggestions on how I can protect the existing item when I uninstall, or any other ideas?

misthero commented 4 months ago

the error Roll.safeEval produced a non-numeric result from expression "" means there is an empty formula somewhere in the settings, try to put 0 instead

notaWizard11 commented 4 months ago

Hm. You were right, the "Slot Modifier" field in settings was blank. I remember as part of my troubleshooting I had changed it from a zero to blank (in my ignorance) to see if somehow the 0 was being multiplied against spell slots and resulting in an error or 0 result.

I changed it back to zero, reloaded, and the error is no longer thrown, but the item in the module's compendium just doesn't work.

However, the copy of the Spell Points item from before (that I copied off an existing and functioning actor) works as normal when I use it from my imported items and drag it on to any actor.

Honestly, I'm able to use it and I'm happy, so if we leave it here that's fine. Thank you very much for all the time you've spent helping me troubleshoot!

If I uninstall the module, I assume that won't remove the copy of the Spell points item that's been imported? I'm weighing how risky it is to try a fresh install of the module.

misthero commented 4 months ago

I wonder why the item in the compendium doesn't work, I will keep this thicket open in case someone have the same issue and I can get more details about this issue.

dkspence952 commented 4 months ago

I'm having the same issue. I have both a preexisting world and an entirely new world. Dragging the item from the compendium does not change anything and the character is still trying to cast using slots. Unfortunately the logs don't reveal much:

The very last line is the only thing that appears in the console when equipping the spell points item. This is in a preexisting world with no modules other than spell points enabled.


commons.js:15473 Foundry VTT | Foundry Commons Framework Loaded foundry.js:91804 Foundry VTT | Before DOMContentLoaded foundry.js:91813 ___


| / | | | | \ | | | \ \ / / \ \ / | | | | | | | | | | | | | | | | | |) \ V / \ \ / / | | | |
| || || | || | |\ | || | < | | \ V / | | | |
|
| _
/ _/|| \|__/|| _|| _/ || ||

foundry.js:91823 Foundry VTT | Reestablishing existing session 58ca22b7c972a3239e44a085 foundry.js:8536 Foundry VTT | Connected to server socket using session 58ca22b7c972a3239e44a085 foundry.js:8632 Foundry VTT | Initializing Foundry Virtual Tabletop Game dnd5e.mjs:49 D&D 5e | Initializing the D&D Fifth Game System - Version 3.1.2



| _ _ | \ | | | | | ( ) | | | | | | | | | / \/\ | | | \ \ | | |/ / (> < |/ //_/ / | |/ ___/\/_/ __/____/


main.js:50 SpellPoints init foundry.js:3687 Foundry VTT | Synchronized official game time in 5ms 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/shared/active-effects.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/shared/inventory.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/shared/inventory2.hbs foundry.js:7533 Foundry VTT | Loaded localization file lang/en.json 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/shared/active-effects2.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/apps/parts/trait-list.hbs foundry.js:7533 Foundry VTT | Loaded localization file systems/dnd5e/lang/en.json foundry.js:7533 Foundry VTT | Loaded localization file modules/dnd5e-spellpoints/lang/en.json 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/parts/actor-traits.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/parts/actor-inventory.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/parts/actor-features.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/parts/actor-spellbook.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/parts/actor-warnings.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/tabs/character-details.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/tabs/character-features.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/tabs/character-spells.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/tabs/character-biography.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/tabs/group-members.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-action.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-activation.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-advancement.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-description.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-mountable.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-spellcasting.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-source.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-summary.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/parts/item-tooltip.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/journal/parts/journal-table.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/advancement/parts/advancement-ability-score-control.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/advancement/parts/advancement-controls.hbs 2foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/advancement/parts/advancement-spell-config.hbs foundry.js:5802 Foundry VTT | Rendering SceneNavigation foundry.js:5802 Foundry VTT | Rendering Notifications foundry.js:5802 Foundry VTT | Rendering Sidebar foundry.js:5802 Foundry VTT | Rendering PlayerList foundry.js:5802 Foundry VTT | Rendering Hotbar foundry.js:5802 Foundry VTT | Rendering Pause foundry.js:5802 Foundry VTT | Rendering SceneControls foundry.js:73077 Font family "Amiri" failed to load. loadFont @ foundry.js:73077 foundry.js:73077 Font family "Bruno Ace" failed to load. loadFont @ foundry.js:73077 foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/toolclip.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/navigation.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/sidebar.html foundry.js:5802 Foundry VTT | Rendering ChatLog foundry.js:5802 Foundry VTT | Rendering CombatTracker5e foundry.js:5802 Foundry VTT | Rendering Settings foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/user/players.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/hotbar.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/pause.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/controls.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/document-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering ActorDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/document-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering CardsDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/pack-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering CompendiumDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/document-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering ItemDirectory5e foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/document-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering JournalDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/playlist-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering PlaylistDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/scene-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering SceneDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/document-partial.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/folder-partial.html foundry.js:5802 Foundry VTT | Rendering RollTableDirectory foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/chat-log.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/combat-tracker.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/settings.html 2foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/document-directory.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/compendium-directory.html 2foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/document-directory.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/playlists-directory.html 2foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/document-directory.html foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/chat/roll-breakdown.hbs foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/dice/roll.html foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/chat-message.html foundry.js:73104 Foundry VTT | Fonts loaded and ready. foundry.js:23746 Foundry VTT | Viewing Scene Gwynneth foundry.js:26632 Foundry VTT | Drawing game canvas for scene Gwynneth foundry.js:29359 Foundry VTT | Loading 52 Assets foundry.js:34911 Foundry VTT | Drawing the WeatherEffects canvas layer foundry.js:34911 Foundry VTT | Drawing the CanvasBackgroundAlterationEffects canvas layer foundry.js:34911 Foundry VTT | Drawing the CanvasIlluminationEffects canvas layer foundry.js:34911 Foundry VTT | Drawing the CanvasColorationEffects canvas layer foundry.js:34911 Foundry VTT | Drawing the CanvasVisibility canvas layer foundry.js:34911 Foundry VTT | Drawing the GridLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the DrawingsLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the TemplateLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the TilesLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the WallsLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the TokenLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the SoundsLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the LightingLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the NotesLayer canvas layer foundry.js:34911 Foundry VTT | Drawing the ControlsLayer canvas layer foundry.js:5802 Foundry VTT | Rendering HeadsUpDisplay foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/hud.html worker.js:73 Worker Compressor | Initialized Worker foundry.js:5802 Foundry VTT | Rendering ActorSheet5eCharacter2 foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/actors/character-sheet-2.hbs foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/app-window.html Atlas%20of%20Endless%20Horizons.png:1 Failed to load resource: the server responded with a status of 404 () Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 Failed to load resource: the server responded with a status of 404 () foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/journal/page-rule-tooltip.hbs foundry.js:5802 Foundry VTT | Rendering Dialog foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/hud/dialog.html commons.js:8807 Foundry VTT | Deleted Item with id [wQdX0pbaG3AQNRkI] in parent Actor [as2Ehlwt5l9dVkoY] Atlas%20of%20Endless%20Horizons.png:1 Failed to load resource: the server responded with a status of 404 () Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 Failed to load resource: the server responded with a status of 404 () foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/partials/compendium-index-partial.html foundry.js:5802 Foundry VTT | Rendering ItemCompendium5e foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/apps/compendium.html foundry.js:16235 Foundry VTT | Constructed index of dnd5e-spellpoints.module-items Compendium containing 1 entries commons.js:8807 Foundry VTT | Created Item with id [6DBIcTUSgcrZBYVt] in parent Actor [as2Ehlwt5l9dVkoY] Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 Failed to load resource: the server responded with a status of 404 () Atlas%20of%20Endless%20Horizons.png:1 Failed to load resource: the server responded with a status of 404 () foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/apps/ability-use.hbs foundry.js:5802 Foundry VTT | Rendering AbilityUseDialog Atlas%20of%20Endless%20Horizons.png:1 Failed to load resource: the server responded with a status of 404 () Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 Failed to load resource: the server responded with a status of 404 () foundry.js:5802 Foundry VTT | Rendering ItemSheet5e foundry.js:7682 Foundry VTT | Retrieved and compiled template systems/dnd5e/templates/items/feat.hbs foundry.js:7682 Foundry VTT | Retrieved and compiled template modules/dnd5e-spellpoints/templates/spell-points-item.hbs foundry.js:5802 Foundry VTT | Rendering Dialog commons.js:8807 Foundry VTT | Deleted Item with id [6DBIcTUSgcrZBYVt] in parent Actor [as2Ehlwt5l9dVkoY] Atlas%20of%20Endless%20Horizons.png:1 GET https://5etools-mirror-1.github.io/img/items/TCE/Atlas%20of%20Endless%20Horizons.png 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onDeleteDescendantDocuments @ foundry.js:14515 _onDeleteDescendantDocuments @ foundry.js:19181 _onDeleteDescendantDocuments @ actor.mjs:3306 await in _onDeleteDescendantDocuments (async) _dispatchDescendantDocumentEvents @ foundry.js:14405

handleDeleteDocuments @ foundry.js:13816

await in #handleDeleteDocuments (async) _deleteDocuments @ foundry.js:13481 await in _deleteDocuments (async) delete @ commons.js:8726 await in delete (async) deleteDocuments @ commons.js:8046 delete @ commons.js:8113 callback @ foundry.js:65275 callback @ foundry.js:65328 submit @ foundry.js:65213 _onClickButton @ foundry.js:65141 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 GET https://5etools-mirror-1.github.io/img/items/DMG/Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onDeleteDescendantDocuments @ foundry.js:14515 _onDeleteDescendantDocuments @ foundry.js:19181 _onDeleteDescendantDocuments @ actor.mjs:3306 await in _onDeleteDescendantDocuments (async) _dispatchDescendantDocumentEvents @ foundry.js:14405

handleDeleteDocuments @ foundry.js:13816

await in #handleDeleteDocuments (async) _deleteDocuments @ foundry.js:13481 await in _deleteDocuments (async) delete @ commons.js:8726 await in delete (async) deleteDocuments @ commons.js:8046 delete @ commons.js:8113 callback @ foundry.js:65275 callback @ foundry.js:65328 submit @ foundry.js:65213 _onClickButton @ foundry.js:65141 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 Atlas%20of%20Endless%20Horizons.png:1 GET https://5etools-mirror-1.github.io/img/items/TCE/Atlas%20of%20Endless%20Horizons.png 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onUpdate @ foundry.js:14363 _onUpdate @ foundry.js:19131 _onUpdate @ document.mjs:102 _onUpdate @ actor.mjs:3246 callback @ foundry.js:13737 (anonymous) @ foundry.js:13711

handleUpdateDocuments @ foundry.js:13711

await in #handleUpdateDocuments (async) _updateDocuments @ foundry.js:13458 await in _updateDocuments (async) update @ commons.js:8677 await in update (async) updateDocuments @ commons.js:8001 update @ commons.js:8098 removeItemFlag @ spellpoints.js:702

call @ foundry.js:730

call @ foundry.js:712

preDeleteDocumentArray @ foundry.js:13776

await in #preDeleteDocumentArray (async) _deleteDocuments @ foundry.js:13472 delete @ commons.js:8726 await in delete (async) deleteDocuments @ commons.js:8046 delete @ commons.js:8113 callback @ foundry.js:65275 callback @ foundry.js:65328 submit @ foundry.js:65213 _onClickButton @ foundry.js:65141 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 GET https://5etools-mirror-1.github.io/img/items/DMG/Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onUpdate @ foundry.js:14363 _onUpdate @ foundry.js:19131 _onUpdate @ document.mjs:102 _onUpdate @ actor.mjs:3246 callback @ foundry.js:13737 (anonymous) @ foundry.js:13711

handleUpdateDocuments @ foundry.js:13711

await in #handleUpdateDocuments (async) _updateDocuments @ foundry.js:13458 await in _updateDocuments (async) update @ commons.js:8677 await in update (async) updateDocuments @ commons.js:8001 update @ commons.js:8098 removeItemFlag @ spellpoints.js:702

call @ foundry.js:730

call @ foundry.js:712

preDeleteDocumentArray @ foundry.js:13776

await in #preDeleteDocumentArray (async) _deleteDocuments @ foundry.js:13472 delete @ commons.js:8726 await in delete (async) deleteDocuments @ commons.js:8046 delete @ commons.js:8113 callback @ foundry.js:65275 callback @ foundry.js:65328 submit @ foundry.js:65213 _onClickButton @ foundry.js:65141 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 commons.js:8807 Foundry VTT | Created Item with id [sOEYIIHJtHN2JADS] in parent Actor [as2Ehlwt5l9dVkoY] Atlas%20of%20Endless%20Horizons.png:1 GET https://5etools-mirror-1.github.io/img/items/TCE/Atlas%20of%20Endless%20Horizons.png 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onCreateDescendantDocuments @ foundry.js:14455 _onCreateDescendantDocuments @ foundry.js:19159 _onCreateDescendantDocuments @ actor.mjs:3287 await in _onCreateDescendantDocuments (async) _dispatchDescendantDocumentEvents @ foundry.js:14405

handleCreateDocuments @ foundry.js:13580

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:962 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:920 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1114 _onDrop @ foundry.js:71199 _onDrop @ base-sheet.mjs:895 _onDrop @ character-sheet-2.mjs:1096 callback @ foundry.js:65650 _handleDrop @ foundry.js:65701 Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 GET https://5etools-mirror-1.github.io/img/items/DMG/Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onCreateDescendantDocuments @ foundry.js:14455 _onCreateDescendantDocuments @ foundry.js:19159 _onCreateDescendantDocuments @ actor.mjs:3287 await in _onCreateDescendantDocuments (async) _dispatchDescendantDocumentEvents @ foundry.js:14405

handleCreateDocuments @ foundry.js:13580

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:962 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:920 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1114 _onDrop @ foundry.js:71199 _onDrop @ base-sheet.mjs:895 _onDrop @ character-sheet-2.mjs:1096 callback @ foundry.js:65650 _handleDrop @ foundry.js:65701 Atlas%20of%20Endless%20Horizons.png:1 GET https://5etools-mirror-1.github.io/img/items/TCE/Atlas%20of%20Endless%20Horizons.png 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onUpdate @ foundry.js:14363 _onUpdate @ foundry.js:19131 _onUpdate @ document.mjs:102 _onUpdate @ actor.mjs:3246 callback @ foundry.js:13737 (anonymous) @ foundry.js:13711

handleUpdateDocuments @ foundry.js:13711

await in #handleUpdateDocuments (async) _updateDocuments @ foundry.js:13458 await in _updateDocuments (async) update @ commons.js:8677 await in update (async) updateDocuments @ commons.js:8001 update @ commons.js:8098 processFirstDrop @ spellpoints.js:755 calculateSpellPointsCreate @ spellpoints.js:643

call @ foundry.js:730

callAll @ foundry.js:687 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:962 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:920 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1114 _onDrop @ foundry.js:71199 _onDrop @ base-sheet.mjs:895 _onDrop @ character-sheet-2.mjs:1096 callback @ foundry.js:65650 _handleDrop @ foundry.js:65701 Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg:1 GET https://5etools-mirror-1.github.io/img/items/DMG/Instrument%20of%20the%20Bards,%20Doss%20Lute.jpg 404 Image (async) xe @ jquery.min.js:2 S.parseHTML @ jquery.min.js:2 S.fn.init @ jquery.min.js:2 S @ jquery.min.js:2 _renderInner @ foundry.js:5975 await in _renderInner (async) _renderInner @ foundry.js:6543 _render @ foundry.js:5818 await in _render (async) _render @ foundry.js:6532 _render @ character-sheet-2.mjs:184 render @ foundry.js:5769 render @ foundry.js:7111 render @ foundry.js:14259 _onUpdate @ foundry.js:14363 _onUpdate @ foundry.js:19131 _onUpdate @ document.mjs:102 _onUpdate @ actor.mjs:3246 callback @ foundry.js:13737 (anonymous) @ foundry.js:13711

handleUpdateDocuments @ foundry.js:13711

await in #handleUpdateDocuments (async) _updateDocuments @ foundry.js:13458 await in _updateDocuments (async) update @ commons.js:8677 await in update (async) updateDocuments @ commons.js:8001 update @ commons.js:8098 processFirstDrop @ spellpoints.js:755 calculateSpellPointsCreate @ spellpoints.js:643

call @ foundry.js:730

callAll @ foundry.js:687 callback @ foundry.js:13604 (anonymous) @ foundry.js:13576

handleCreateDocuments @ foundry.js:13576

await in #handleCreateDocuments (async) _createDocuments @ foundry.js:13437 await in _createDocuments (async) create @ commons.js:8629 await in create (async) createDocuments @ commons.js:7958 _onDropItemCreate @ base-sheet.mjs:962 await in _onDropItemCreate (async) _onDropItem @ base-sheet.mjs:920 await in _onDropItem (async) _onDropItem @ character-sheet-2.mjs:1114 _onDrop @ foundry.js:71199 _onDrop @ base-sheet.mjs:895 _onDrop @ character-sheet-2.mjs:1096 callback @ foundry.js:65650 _handleDrop @ foundry.js:65701 foundry.js:7682 Foundry VTT | Retrieved and compiled template templates/sidebar/document-create.html foundry.js:5802 Foundry VTT | Rendering Dialog game:1 Autofocus processing was blocked because a document already has a focused element. foundry.js:5802 Foundry VTT | Rendering ActorSheet5eCharacter2 commons.js:8807 Foundry VTT | Created Actor with id [Nz8JEc5QqbdfAURp] Needle%20Blight.png:1 GET https://5etools-mirror-1.github.io/img/bestiary/MM/Needle%20Blight.png 404 Image (async) _onLazyLoadImage @ foundry.js:69113 commons.js:8807 Foundry VTT | Created Item with id [oIBMGu3Pjdmo2mZe] in parent Actor [Nz8JEc5QqbdfAURp]

misthero commented 4 months ago

hello @dkspence952 the relevant error is the following:

Error thrown in hooked function 'calculateSpellPointsCreate' for hook 'createItem'. Unresolved StringTerm 2x1 requested for evaluation

like before, Foundry roll formulas have specific rules and syntax:

immagine

in your case 2x i guess should be 2* as you see in the screenshot the "x" doesn't mean anything for Foundry (or any programming language), to do multiplications you should use *

try changing your formulas.

notaWizard11 commented 4 months ago

I'm not sure if you thought DKSpence's comment was me, or if you were taking more time and reviewing my issue still. For clarity, here's what my settings are now: image

I used the same settings in the test world that worked as expected and in my main world where the issue is. I have zero coding knowledge or experience, but I'm perplexed at how this could be the core issue, since the previously imported Spell Points Item works while the item from the module compendium doesn't.

Thanks again for your time, both looking into this and for the module itself, it really makes a big difference for my game.

misthero commented 4 months ago

I have released a little bugfix, can you test if something changed?

misthero commented 4 months ago

you are right @notaWizard11 I was replying to @dkspence952, sorry :)

jakekingsly commented 4 months ago

I have released a little bugfix, can you test if something changed? image

The issue is that the setting tag isn't updating to the on item card, in the item custom tag spot. Once I manually changed the spell points in the item to Mana, it worked without issue.

misthero commented 4 months ago

The issue is that the setting tag isn't updating to the on item card, in the item custom tag spot. Once I manually changed the spell points in the item to Mana, it worked without issue.

Yes, good catch, that's intendend but not well explained.

dkspence952 commented 3 months ago

@misthero Sorry for the delayed response. After the update as well as the "mana" fix (I also changed this), it is working as intended.