Forien / foundryvtt-forien-quest-log

This module provides comprehensive Quest Log system for players and Game Masters to use with Foundry Virtual Tabletop
MIT License
21 stars 34 forks source link

[BUG] Syntax Error with Questlog Macros #126

Closed RoperSeiler closed 3 years ago

RoperSeiler commented 3 years ago

Module Version: v0.7.3

Describe the bug Sorry if this technically isn't an issue with the module. Since the latest update to Forien's Questlog the Macro listings no longer seem to be correct.

I followed the steps on this github (https://github.com/Forien/foundryvtt-forien-quest-log/wiki/Macros#open-quest-log) to utilise the macros to open the quest log, which is inbuilt to my overall splash page for convenience. However, since the latest update the macros simply states there is an error with the syntax.

When checking the console it states:

Macros.js:212 ReferenceError: QuestLog is not defined at Macro.eval (eval at callScriptMacroFunction (Macros.js:167), :5:5) at Macro.callScriptMacroFunction [as callScriptFunction] (Macros.js:170) at Macro.renderMacro [as renderContent] (Macros.js:188) at Macro.executeMacro (Macros.js:209) at Hotbar._onClickMacro (foundry.js:28059) at HTMLLIElement.dispatch (jquery.min.js:2) at HTMLLIElement.v.handle (jquery.min.js:2)

To Reproduce Steps to reproduce the behavior:

  1. Create Macro using code from this github (https://github.com/Forien/foundryvtt-forien-quest-log/wiki/Macros#open-quest-log)
  2. Execute Macro
  3. See error

Expected behavior Clicking the macro used to open the quest log on screen. It allowed me to combine it with trigger happy for an interactive menu, but with the macro failing it prevents me from opening the quest log through a click function.

Foundry Version: 0.8.8

Game System: DnD5e 1.3.6

bobziemerman commented 3 years ago

You're on Forien's original repo for this module; since they've been inactive, it's been forked to the LoFD branch, which is who released 0.7.3. But I was having this problem as well, since whatever change they made doesn't seem to be documented yet. The new code to use macros is documented here a little bit, and what you're looking for is: Hooks.call('ForienQuestLog.Open.QuestLog');

RoperSeiler commented 3 years ago

Hooks.call('ForienQuestLog.Open.QuestLog');

This worked! Thank you so much! I wasn't aware it was inactive, thank you for taking the time to explain. I really appreciate it!