Item Macro Compendium Workflow
Okay, here's a long one that's a bit of a doozy. I'm looking at setting up some sort of tooling/workflow that would allow me to store macros outside of Foundry in a way that I don't have to copy paste them over. This is further complicated by the fact that I really want to use the Item Macro module to attach these macros to specific items that then get interpreted for active effects. I've been inspired by the work of the 5e system for compendia and ghost's efforts for their own system to think that this is at least possible, but I have no id where to even begin. Any suggestions?
5 Replies
I see two approaches:
- A Foundry module which updates the contents of all script macros using
Filepicker.browse
on ready
- Something more similar to the script 5e uses where it parses your macro db files and updates the content fields with JS.
Obviously the first option is better practice, since it uses the official API
You could perhaps have a folder with JS files named by the associated Foundry DocumentId, in order to have something for the module to use to link the two
This would definitely be more accessible as a module
I don't know how Item Macro works. Where are the macros used stored? Does it just store the ID of the macro to run on the item or the entire macro?So Item Macro seems to store the entire macro data inside of the item via
flags.item-macro.macro
.
My problem with the 1st approach is how to tie in the specific macros to specific names/ids or whatever. Would I just have to maintain everything by like a name basis? Wait, that could easily be done with file names... 1 macro per file or something of the like.Yeah
That doesn't sound like best practice to store the entire macro. It should just be ID.
It would make this easier lol
Well so the entire point of Item Macro is that the macro doesn't exist in the Macro Directory, so you can have hundreds of macros attached to items for use in active effects and not have to sort through them all in the Macro Directory.
Hmm, okay. It's not really very different, except now your accessing and setting that flag instead of the contents property. Either method described above should still work.
I don't see the advantage of method #2 though