Open Merudo opened 3 years ago
I did some tests - it seems the spell loses it's actor
property along the way. With no actor field, item.isOwned
returns false
, and therefore the ownership test fails.
Thanks to @tposney, I figured out how to do:
let macroActor = game.actors.get(args[0].actor._id); let macroItem = macroActor.items.get(args[0].item._id);
Summoner.placeAndSummonFromSpell(macroActor,macroItem, "Flaming Sphere");
However, I get the prompt for the spell slots twice. I wonder if there is a way to only show it once?
Ok I managed to make it work using this code:
let macroActor = game.actors.get(args[0].actor._id);
let macroLevel = args[0].spellLevel;
Summoner.placeAndSummon(
macroActor,
"Flaming Sphere",
{
actorData: { data: {
attributes: {spellLevel: macroLevel}
} }
},
{ setSpellBonuses: true }
);
Interesting. So it looks like it worked once you passed in the actor, but for some reason the item.options.actor
wasn't working? I've never pulled out the actor that way.
Thanks for debugging and putting your findings here.
I'm not sure about the double spell dialog. I notice you have a args[0].spellLevel
. Do you have any other mods that affect how item macros are invoked? My testing showed that having an item macro totally replaces the spell invocation, including the spell dialog. Maybe itemMacro was updated and I need to update my instructions to handle that.
In my case I disabled the Item Macro hooks, and instead use the On Macro Use
option in Midi-QoL.
That resulted in a duplicated spell dialog, until I changed placeAndSummonFromSpell
to placeAndSummon
.
Also item.options.actor
is an Item Macro function; it's not usable if the Item Macro is launched through Midi-QoL.
I'm trying to launch my Flaming Sphere macro from Dynamical Active Effects.
I have the following macro in Item Macro of the Flaming Sphere spell:
The macro works fine when launched manually. However, when I use it through Dynamic Active Effect, nothing gets summoned and I get the message:
What is going on?