Item Macro
Closed this issue · 5 comments
It's likely that we'll need to use Item Macro at some point. Macros, by virtue of accessing Foundry/module API directly, likely have a higher maintenance cost than using a helper module managed by someone more dedicated than us 😏
Basically, how quickly should we reach for Item Macro when needed? Keep a log of instances where it's necessary below and check if it's possible to avoid using it.
Tangentially: minify macros for data saving, or keep macros formatted (with comments) so users can see how they work within Foundry?
I'd vote for no minification. There really isn't going to be that much data to load.
Can Item Macro macros reference macros in compendiums, or do they have to be available in the game proper? This is a 5 Minute Job:tm: if the former is true, as I already have a nice macro compendium build system I use for all my other modules
I'm not quite sure what you mean. Item Macro macros are normal macros, just stored someplace other than the Macros directory or a compendium. They can reference (call) any other macro using Foundry's API as normal
The Item Macro macros themselves are all held in <itemData>.flags.itemacro.macro.data.command
, as you can see here:
So it's in neither the Macro directory or a compendium, but tacked onto the item's data itself (which is why it's useful for us). The macro itself is called by Midi QoL using the macro.ItemMacro | CUSTOM | <list of arguments>
AE. You can also call an Item Macro arbitrarily using some API command I can't remember.
Also, I remember now (after looking deeper to write the above) that the macro is actually stored as a plain string, which means it necessarily won't be beautified! Keeping the \n
s and sensible variable names would definitely still be useful for easy conversion back to human-readable code, but if Giddy can also minify things on build then I don't see the problem with having the best of both worlds. Not fussed if not, though
I vote to include ItemMacro(s) and minimize their use when possible.
an ItemMacro CAN trigger a World Macro (even marked as execute as a GM). My turn Undead does this.