JohanFalt / Foundry_WoD20

World of Darkness 20th ed for Foundry VTT
GNU General Public License v3.0
28 stars 23 forks source link

[Feature Request] Attach Macro to Item Roll Event #541

Open Grandsome opened 1 year ago

Grandsome commented 1 year ago

Allow the user to attach a macro to an "item" roll, to allow for sounds, animation and other stuff to happen. The feature doesn't have to read the roll result necessarily. A first implementation could just run the macro blindly after/at the same time as the roll event. This would open all sorts of possible integration with other modules.

Thank you for your work!

Grandsome commented 1 year ago

I've been looking around to see how to implement some animations in my games, and I've found the tutorial of Automated Animations on adding system support: https://github.com/otigon/automated-jb2a-animations/wiki/Adding-System-Support

It seems fairly simple to implement (even tough I have zero skills with js), so I'd like to try to do it and test it. I just have a hard time finding the necessary variables, so I'm asking if these exist in the system:

Required Data: Item: The Item instance that is being used Source Token: The Token that is using the Item Target(s): The current targets when the Item is used/rolled

(more details in the link at the top)

What's great about automated animation is that it also supports macros, so two birds one stone. Official support would also be great if it's simpler that way. Thanks!