periodic / foundryvtt-summoner

A module to help with summoning tokens in the Foundry Virtual Tabletop
MIT License
4 stars 1 forks source link

Syntax error? #9

Closed chrishoule closed 3 years ago

chrishoule commented 3 years ago

I've installed the module, created the folder named Summons, added the monsters. Gave the player the correct permissions, but I get the following:

"There was an error in your macro syntax"

If I look at the console, I get the following:

ReferenceError: summonerActor is not defined anonymous https://assets.forge-vtt.com/bazaar/modules/furnace/2.6.0/Macros/Macros.js line 176 > Function:6 callScriptMacroFunction https://assets.forge-vtt.com/bazaar/modules/furnace/2.6.0/Macros/Macros.js:179 renderMacro https://assets.forge-vtt.com/bazaar/modules/furnace/2.6.0/Macros/Macros.js:197 executeMacro https://assets.forge-vtt.com/bazaar/modules/furnace/2.6.0/Macros/Macros.js:221 _onClickMacro https://netfrost-merronna.forge-vtt.com/scripts/foundry.js:20566 jQuery 2 Macros.js:224:25

periodic commented 3 years ago

Thanks for reporting an issue!

Most likely it's because you copied from some of my examples that use the summonerActor as a placeholder for however you get your own actor.

If you are using Furnace with advanced macros and an item macro then you can just use actor (thanks, furnace). Otherwise you can get them by name like

await Summoner.placeAndSummon(
  game.actors.getName("My Character"),
  "Companion",
);