#M&M Macros #2: Refresh Heroes
1 messages · Page 1 of 1 (latest)
//Refresh Heroes by Gazkhan - Jules and honeybadger with minor tinkering by DeviousHearts
//Required: Sequencer Module.
//Ensure you have all the file paths updated in order for this to run properly for the files the macro calls for.
// Get all selected tokens
let selectedTokens = canvas.tokens.controlled;
// Loop through each selected token
selectedTokens.forEach( tok => {
// Delete all active effects on the token's actor
tok.actor.deleteEmbeddedDocuments('ActiveEffect', tok.actor.effects.map(ef => ef.id));
// Set system.blessure to 0
tok.actor.update({"system.blessure": 0});
const rfstyle = {
"fill": [
"#ffc480",
"#8e80ff"
],
"fontFamily": "Impact, Charcoal, sans-serif",
"fontVariant": "small-caps",
"lineJoin": "round",
"strokeThickness": 4,
"wordWrap": true
}
new Sequence()
.effect()
.atLocation(tok)
.text("REFRESH!",rfstyle)
.scaleIn(0, 500)
.fadeOut(6000)
.play()
new Sequence()
.sound()
.file("/Audio/Music-Stings/213095__soundsexciting__dramatic-musical-sting.ogg")
.endTime(600)
.volume(.05)
.fadeOutAudio(150)
.play()
});```
The sound file is only meant to notify the players of an action done. It is a short note. I got it from Freesound - https://freesound.org/browse/tags/sound-effects/ and converted it to an .ogg file to optimize storage. You can easily find it there and it is free to have an account to download many different sounds. 🙂
Icon for you "Refresh Heroes" Macro
For replacing the ".file("/Audio/Music-Stings/213095__soundsexciting__dramatic-musical-sting.ogg")", where would the base section start from in the foundry data folder path? e.g. From the Root folder /Sounds?
If that is where you have your sounds at, yes. (Sorry, I JUST saw this and if you still have questions, I am more than happy to answer.)
So I think I found a bug with this macro. Whenever you use it on a hero where they have an effect variant Active Effect, it gets rid of that effect. From then on, if you activate it in the menu, it no longer works till you replace the token
Help me understand a bit. What do you mean by "Effect Variant Active Effect"?
This part of the power. The part under Modifiers that says "Effect Variants". When I activate it, it brings up a little tag on the token, which I think is for ActiveEffects
@tiny salmon and @zinc wasp Have you guys ever seen something like this? Is this part of a module interacting with the M&M system?
What is that? I didn’t even know it existed lol
I don’t know what it is but I want it lol
What part do you not know what it is?
Don’t take me seriously; it’s have never seen that screen before; and have no idea what it does
The Modifier's page?
Wow... That is either something new @tiny salmon added or I have been onblivious to it all this time. I have no idea even what it does. 🙂
Looks like it was a 1.3 Update thing
It lets powers and advantages affect stats
Amazing. Update went right past me. 🙂 I have never used them. Help me learn! What do they do? 🙂
Basically, you can click on the activate button to make the stat modifiers you put in your variant effects section become active
This allows for things like enhance strength to be easily togglable
The problem is that the way it does this is with an Active Effect, and this macro deletes all active effects on the character
Nice!
See, you can see in the log for the character object that it lists the variant effects as Active Effects
So the macro completely breaks the system
If that is used apparently, yep. Since I never used Power Mods, it never affected me.
Fair. They were only added 3 Weeks ago
Also, how do you get the conditions to do all those animations?
They don't do that for me
Token Variant Art Module, I believe.
I just install the module and then the effects happen?
No, you do have to program them but it is really east.
One sec. I think there is a Youtube on it.
Release: https://github.com/Aedif/TokenVariants/releases/tag/4.46.0
GitHub: https://github.com/Aedif/TokenVariants
Package Page: https://foundryvtt.com/packages/token...
Patreon: https://www.patreon.com/Aedif
== Timestamps ==
Effect Mappings 00:35
- Effect has been renamed to Expression 00:35
- New field: Label 00:35
-- The module will no lon...
here ya go.
Here's a pic of mine. Once you setup th module, you click Shift + G to get started
Is there a way to export the config for Tia? If so wants pass,your cop y @acoustic obsidian ?
Right, but I'm not sure what settings to do for the overlay to make them look like yours did
But anyways, I think a way to possibly fix this is to modify the code so that it only removes effects which do not have a null origin value. Since all power based active effects have an object as their origin, it would be an easy way to single them out
@acoustic obsidian I made my own fix using the origin value idea. Here is the code for it
//Refresh Heroes by Gazkhan - Jules and honeybadger with minor tinkering by DeviousHearts
//Required: Sequencer Module.
//Ensure you have all the file paths updated in order for this to run properly for the files the macro calls for.
// Get all selected tokens
let selectedTokens = canvas.tokens.controlled;
// Loop through each selected token
selectedTokens.forEach( tok => {
// Delete all active effects on the token's actor
tok.actor.deleteEmbeddedDocuments('ActiveEffect', tok.actor.effects.filter(ef => ef.origin == null).map(ef => ef.id));
// Set system.blessure to 0
tok.actor.update({"system.blessure": 0});
const rfstyle = {
"fill": [
"#ffc480",
"#8e80ff"
],
"fontFamily": "Impact, Charcoal, sans-serif",
"fontVariant": "small-caps",
"lineJoin": "round",
"strokeThickness": 4,
"wordWrap": true
}
new Sequence()
.effect()
.atLocation(tok)
.text("REFRESH!",rfstyle)
.scaleIn(0, 500)
.fadeOut(6000)
.play()
new Sequence()
.sound()
.file("https://assets.forge-vtt.com/65fb7c65683015b1cd32fd6f/Music/Sound%20Effects/Heal%20Sound%20Observation%20Haki.mp3")
.endTime(600)
.volume(.1)
.fadeOutAudio(150)
.play()
});
Thanks! BTW, JB2a has many animations you can add to your Condition effects when you have Token Variant art but just using Token Variant Art, you can add a lot. I wish there was a way to save my settings for you.
Export Button on the top right