#MidiQOL
1 messages Β· Page 43 of 1
Right, the side actor is missing the Radiant Mace - Healing (Defender Only) feature 
Hold up, I'll add that and test it.
it could be the name and the part for the error maybe
either that or theres another issue
cause it doesn't do the error twice for the same thing
Okay, here we go.
No, AM caused that problem months ago
I think its flipped upside down in v10, cause I had a macro that threw an error cause I defined actor, and when I installed advanced macros it worked
we can't troublleshoot it till we see the actor Janner its a comparison problem
oh shit sorry missed the message
I'll have to test, but I'm pretty sure that stock macros don't care, because of scoping rules
aren't there two actors?
I can give you a macro that causses it if you wanna see hehe
Other execution methods, like midi, might
I thought the macro modified the existing Celestial Spirit into either an Avenger or Defender
Folder macro, change tokenActor to actor
const tokenActor = token?.actor ?? game.user.character;
const effects = tokenActor.effects.filter(i => i.isTemporary).reduce((acc, e) => acc += `
<div class="form-group">
<label for="${e.id}">${e.label}</label>
<div class="form-fields"><input type="checkbox" id="${e.id}" /></div>
</div><hr>`, ``);
const content = `<form>${effects}</form>`;
const title = "Delete effects";
const buttons = {del: {
icon: `<i class="fas fa-check"></i>`,
label: "Delete!",
callback: async (html) => {
const selected = html[0].querySelectorAll("input[type=checkbox]:checked");
const deleteIds = [];
for(let s of selected) deleteIds.push(s.id);
await tokenActor.deleteEmbeddedDocuments("ActiveEffect", deleteIds);
}
}};
new Dialog({content, title, buttons, default: "del"}).render(true);
Eww, just: const actor = "foo"
Zhell originall wrote it, but I believe bugbear helped v10ify it
Anyway, not able to touch foundry right now. If that is broken, I'll report a bug in a few days
it works fine with advanced macros enabled with the first and 4th to last lines using "actor"
no no no its not broken, its only broken if you don't have advanced macros installed, and change the two tokenActor to actor
yes, but this is a folder macro isn't it?
I don't know what a folder macro is
no its a macro to delete effects on tokens, zhell would NEVEr make a midi macro hehe
And it's not core
hotbar macro
I had asked him like 8 months ago to make a macro that lets me select a token and it reads out all the temp effects and lets me checkbox and delete em
its just a weird example of v10 and defining actor
I will not allow AM to be a "fix" for anything, lolol
me either, so bugbear told me to change it to tokenActor
as the macro stands right now as I pasted it, it works no matter what
its only when you change it
I have no access to foundry rn. It will be a couple of days before I do.
This is a conversation I remembered
Nothing in that post or code should be stopping this
the script I shared to you is what bugbear edited and fixed for me, the original had tokenActor defined as actor instead
you had asked for an example of const actor = causing an error, if you take my script and put actor in tokenActors spot you will see the error
or I misunderstood what you asked
No I got the example and it must be a bug. I'll figure out why and log it
I will never lose this image cause its so fitting bud π
The easiest thing is just wrapping the code in brackets to create a new scope
In the short term
Zhell writes so many macros it was like 8 months ago before v10 was even a thing so he didn't know to do it
I just came to the discord with the problem and bugbear caught it
after my v10 update it was when it started hitting
So thats why I chimed in here when I saw him defining actor in the first line
but he is using advanced macros so it will work, but if he ever doesn't use it anymore, that macro will throw the v10 thing
Yeah, in v10 you can't re-declare actor, scene, or token. At least not in the top-level macro scope.
Anybody know whether it's possible to do any of the following?
- Have a weapon's damage reduce the target's max hp
- Have a weapon use a different AC calculation to determine hits
- Have a weapon do additional damage to certain creature types
do you think Jannors macro should have that first line changed then? Oddly advanced macros defies that rule somehow right now.
Yeah. I still can't get the thing to work π
Wrap it in brackets
theres two actors in the macro Janner, you showed us one actor
Fixed
Can't hurt to rename all actors to steve lol
STEVE!
To the rescue. π
Yes to 1 and 3, for 1 I have something I can share, for 3 look at the mace of disruption in midi sample items or divine smite
I grabbed it from the Warpgate wiki. It's the Spiritual Badger example, wich only comes with one sample actor.
Also babini for (3)
but you have two celestials in it don't you?
Celestial Avenger and Celestial Defender
https://github.com/trioderegion/warpgate/wiki/Summon-Spiritual-Badger
Aye, and this sample has "Bacon Badger" and "Snake Eater Badger"
It uses a template Spiritual Badger and modifies it upon summoning it, it looks like.
Janner, you name 2 actors in it, is there a Celestial Defender and Avenger in the side bar?
No, just a Celestial Spirit
isn't that a problem then?
What do you have for 1?
I dunnno the error is a mismatch between the actor in the sidebar and the things you are trying to change on it, it could be as subtle as a missing space
I'll make an Avenger and Defender alongside the regular Celestial Spirit--see if that works any
No2 could be made with an AE created in an on Use macro which would change the target's AC, before check hits
This drains charisma, you can change the key
anyone curious where its from, its the Maurezhi's bite attack
Thanks!
in midi its kinda ok to mod max hp, but it might be wiser to use temp max hp
Same issue
are there spaces between Radiant BowX(Avenger Only)? is there a space where X is or not?
Yup
Same with the spaces around the dash in radiant mace - healing
Yup!
Janner, I did it again btw, they should be called Celestial Spirit
I told ye
The macro changes the original Celestial Spirit template to be either an Avenger or Defender
man I still think its actually wrong lol
I should just pay someone to automate this spell 
someone has to look at it again, in the mutates hes calling the actor Celestial Defender and Celestial Avenger, and then its summoning Celestial Spirit
are you absolutely sure that the token is unlinked
Yup
Good lord what is that token config
π΅Too many modsπ΅ (too many mods)
https://www.youtube.com/watch?v=QrGrOK8oZG8
Looks like Token Z, Patrol, Lasers, Swarm(s), Health Estimate. I think that's all?
janner you defined actor in line one, and then you are trying to change actor in the mutation
Still a lot
so its trying to change whatever line 1 is defined as in the data
Does the sidebar actor have any weapons currently on them?
Tagger as well
he has images above of the actor disregard the names on the actors
MTB as well? Amazing
and then trying to change "actor"
With proper types?
Alright alright, post the current version?
I feel like I'm so right right now, just sayin
I'll just post the item and actor jsons here π
eh I don't feel like importing stuff but I got vscode open
Wont help me at all. On the phone. Are the weapons and the multiattack correctly set up?
its not changing multiattack its just changing the token name, actor name, and deleting items
but its using the term 'actor' in line 1 and then the mutation uses it
and line 1 is defining actor as the source actor, as in the casters name
This is a specific error. Type is missing
Here's the current code:
const item = actor.items.getName("Summon Celestial");
const [{spellLevel: level}] = args;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;
/* Prompt the user for which type of celestial to summon */
const buttonData = {
buttons: [{
label: 'Celestial Avenger',
value: {
token: { name: "Celestial Avenger" },
actor: { name: "Celestial Avenger" },
embedded: {
Item: {
"Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
"Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
}
}
}
}, {
label: 'Celestial Defender',
value: {
actor: { name: "Celestial Defender" },
token: { name: "Celestial Defender" },
embedded: {
Item: {
"Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
}
}
}
}
],
title: 'Which Celestial?'
};
const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);
async function myEffectFunction(tokenDoc) {
//prep summoning area
new Sequence()
.sound()
.file("/Sounds/Combat/Ghostly_Swells*.ogg")
.volume(0.5)
.sound()
.file("/Sounds/Creatures/Zombie/MON_northrendskeleton_birth_*.ogg")
.volume(0.5)
.effect()
.file('jb2a.magic_signs.circle.02.necromancy.intro.blue')
.atLocation(tokenDoc)
.center()
.scaleToObject(2)
.belowTokens()
.fadeIn(500)
.fadeOut(500)
.randomizeMirrorX()
.randomizeMirrorY()
.randomRotation()
.effect()
.file('animated-spell-effects-cartoon.earth.debris.03')
.atLocation(tokenDoc)
.center()
.scaleToObject(4)
.belowTokens()
.fadeIn(500)
.fadeOut(500)
.randomizeMirrorX()
.randomizeMirrorY()
.randomRotation()
.play();
}
const callbacks = {
post: async (location, tokenDoc, updates, iteration) => {
await myEffectFunction(tokenDoc);
}
}
/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
actor: {
'system.attributes.ac.flat': 11 + level,
'system.attributes.hp': { value: hp, max: hp },
},
embedded: {
Item: {
"Multiattack": {
name: `Multiattack (${Math.floor(level / 2)} attacks)`
},
"Radiant Bow (Avenger Only)": {
'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
},
"Healing Touch": {
'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
}
}
}
}, celestial);
await warpgate.spawn("Celestial Spirit", updates);```
It's an OnUse Item Macro.
Here's the details of the items.
missing dmg type and other stuff
does it need the full entry on the damage parts?
Yes
Well....
... that solved that problem. 
const item = actor.items.getName("Summon Celestial");
const level = item.system.level;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;
/* Prompt the user for which type of celestial to summon */
const buttonData = {
buttons: [{
label: 'Celestial Avenger',
value: {
token: { name: "Celestial Avenger" },
actor: { name: "Celestial Avenger" },
embedded: {
Item: {
"Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
"Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
}
}
}
}, {
label: 'Celestial Defender',
value: {
actor: { name: "Celestial Defender" },
token: { name: "Celestial Defender" },
embedded: {
Item: {
"Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
}
}
}
}
],
title: 'Which Celestial?'
};
const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);
/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
actor: {
'system.attributes.ac.flat': 11 + level,
'system.attributes.hp': { value: hp, max: hp },
},
embedded: {
Item: {
"Multiattack": {
name: `Multiattack (${Math.floor(level / 2)} attacks)`
},
"Radiant Bow (Avenger Only)": {
'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
},
"Healing Touch (1/Day)": {
'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
}
}
}
}, celestial);
await warpgate.spawn("Celestial Spirit", updates);
untested, etc etc
Why a
Avenger only 2 times?
healing touch is healing not radiant but also he needs to change the name of healing touch
that might be an error in badgers wiki example
How on earth did you put (1/Day) in, is that from spiritual badger?
Now there's te issue of it trying to prompt me infinitely to cast the spell after I've already cast it.
Ah
Oh, that wasn't him. That was me copy/pasting it from D&D beyond π
Item Macro in Midi, good times. π
Serves me right
There
what did you set the on use to for the drop down
That warpgate.dnd5e is a no no probably
It rolls the item, yes
Just replaced it with system.level, you can figure it out from here
π
const [{spellLevel: level}] = args;
π
if its in an item macro isn't spellLevel already defined?
No
or something like that
I normally get it from castData to account for upcasting
A regular non-midi Item Macro is in fact just a complete replacer of the item's usage
You guys are lifesavers. I don't know what I'd do without this server and this channel 
Please forgive my ignorance
The item itself is never used unless you explicitly add item.use() in the Item Macro.
For non-midi users anyway
badgers gonna return here and watch us all slowly catch the typo and face palm
Eeeeeeyup 
So if I say, wanted to use sequencer for some fancy effects, is this how I'd do it?
for full automation, is there any kind of protection against players spamming rolls (either by mistake/lag or intentional)?
didn't someone just do that for you though?
i swear fotoply might have, it was for another summon animation?
you could steal that out of that item
Aye, it was for an Animate Dead macro. Lemmee find it
Yup! #macro-polo message
Doesn't seem to play the sequence though. Maybe I've put it in the wrong place.
I don't think that will be easy to convert let me give you danse macabre its very simple
const imgs = await game.actors.getName("Zombie").getTokenImages()
await Promise.all(imgs.map(i => loadTexture(i)));
for(let i = 0; i < 5; i++){
const [spawn] = await warpgate.spawn("Zombie");
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
}
take the await warpgate command at the bottom of yours and put it in a defintion like line 4, and then use a new sequence
ignore line 3 and 6 of mine its for summoning more than 1 of the zombies, not important here
ETC. ETC. MORE MACRO ABOVE
const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);
/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
actor: {
'system.attributes.ac.flat': 11 + level,
'system.attributes.hp': { value: hp, max: hp },
},
embedded: {
Item: {
"Multiattack": {
name: `Multiattack (${Math.floor(level / 2)} attacks)`
},
"Radiant Bow (Avenger Only)": {
'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
},
"Healing Touch": {
'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
}
}
}
}, celestial);
const [spawn] = await warpgate.spawn("Celestial Spirit", updates);
new Sequence().effect().file("jb2a.bless.200px.intro.blue").atLocation(spawn).center().scaleToObject(2).belowTokens().fadeIn(500).fadeOut(500).play().sound().file("/Sounds/Combat/Holy/FX_Holy_Magic_Cast_Large_*.ogg").volume(0.5)```
Something like that?
no remove the for(yada shit and the final bracket
thats part of danse macabres weird summoning of multiples
I think the final bracket is from that for line
so it also needs to go
I think the promse line that I had, is only necessary if you use wildcards
badger made me put that in
cause my zombies all have wildcards and I was getting 404 errors
also you can change the animation to whatever you want
and theres othereffects you can do in the sequence
wait did you use my warpgate line?
you were suppose to use whatever yours was
await warpgate.spawn("Celestial Spirit", updates);
Oh. Wait. Replace which line?
you can remove the await promise all images line, third to last
and the one above it
the only two lines you wanted from my sample was the bottom two
the const imgs is useless can remove it
const [spawn] = await warpgate.spawn("Celestial Spirit", updates);
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
wait wrong
I edited my example
but something tells me Fotoply is about to drop a better one
Aye, perhaps π
try that one out though, I think its good
as long as you didn't define spawn above in the unseen macro
async function preSpawn(location, updates, iteration) {
await new Sequence()
.effect()
.file("jb2a.cure_wounds.400px.blue")
.atLocation(location)
.waitUntilFinished(-500)
.fadeIn(100)
.effect()
.file("jb2a.misty_step.01.blue")
.atLocation(location)
.fadeOut(400)
.play()
}
await warpgate.spawn("Celestial Spirit", {}, {pre:preSpawn});
This looks pretty fancy
Would I slot this at the end of this macro?
#1010273821401555087 message
Might want to add a .scaleToToken on them depending on how big your token is
Should just be replacing the last line
await warpgate.spawn("Celestial Spirit", updates);
With what I sent
All righty!
I noticed this doesn't seem to be spawning the Celestial Avenger nor the Celestial Defender, just the base template Celestial Spirit. Before I added your code it seemed to spawn them just fine
const item = actor.items.getName("Summon Celestial");
const [{spellLevel: level}] = args;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;
/* Prompt the user for which type of celestial to summon */
const buttonData = {
buttons: [{
label: 'Celestial Avenger',
value: {
token: { name: "Celestial Avenger" },
actor: { name: "Celestial Avenger" },
embedded: {
Item: {
"Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
"Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
}
}
}
}, {
label: 'Celestial Defender',
value: {
actor: { name: "Celestial Defender" },
token: { name: "Celestial Defender" },
embedded: {
Item: {
"Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
}
}
}
}
],
title: 'Which Celestial?'
};
const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);
const callbacks = {
post: async (location, tokenDoc, updates, iteration) => {
await myEffectFunction(tokenDoc);
}
}
/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
actor: {
'system.attributes.ac.flat': 11 + level,
'system.attributes.hp': { value: hp, max: hp },
},
embedded: {
Item: {
"Multiattack": {
name: `Multiattack (${Math.floor(level / 2)} attacks)`
},
"Radiant Bow (Avenger Only)": {
'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
},
"Healing Touch": {
'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
}
}
}
}, celestial);
async function preSpawn(location, updates, iteration) {
await new Sequence()
.sound()
.file("/Sounds/Combat/Holy/Holy_Swell.ogg")
.volume(0.5)
.effect()
.file("jb2a.divine_smite.caster.blueyellow")
.atLocation(location)
.scaleToObject(3)
.waitUntilFinished(-500)
.fadeIn(100)
.sound()
.file("/Sounds/Combat/Holy/FX_Holy_Magic_Cast_Large_*.ogg")
.volume(0.5)
.effect()
.file("jb2a.explosion.blueyellow.0")
.atLocation(location)
.scaleToObject(4)
.play()
}
await warpgate.spawn("Celestial Spirit", {}, {pre:preSpawn});```
Wee question. I noticed that the Celestial Defender has an additional +2 bonus to its AC. Is there a way to integrate that into the Defender transformation?
Yep, same as any change on an actor.
Where the flat ac value is(btw that should not be flat they can't get bonuses if you set to flat) remove it properly, and then seeing as how its in the actor, find the actor entries of the two and define the ac on both of them there
you could probably xcopy it into the one who doesn't have the bonus to ac
All righty. I think I've fixed the AC issue
Just need to fix this issue now π
actor: { name: "Celestial Avenger", 'system.attributes.ac.flat': 11 + level }
I think, but I think you should use natural armor but I dunno how that looks in macros
Aye, I'll use Natural armor
maybe fotoply typoed the last line? why does it say pre:preSpawn?
why is there a empty {} at the last line too
That's what I was thinking, but I'm unsure where to put it
Change {} to updates
Ah-HAH!
That fixed it. Awesome. π
Thank you so much
dynamic effects - custom duration -
Is there a way of making an effect last until the actor is healed at all? Unfortunately the custom durations cover all damage types, but doesn't include the healing type
Whoops, yeah I typoed the spawn line and then went right to sleep π
I think I had asked for this at one time but It was before i knew how to put in issues to tposney. Its funny too cause I think he automated the very weapon that needs it in midi sample items. Sword of wounding.
Heya! Got this error after updating to latest version of Foundry:
Would anyone know what is causing the issue?
Midi qol is incompatible with:
GM Paranoiia
Ready Set Roll
Roll Groups
Fast rolls by default
Fast Rolls
Dice tooltips
WIRE
Better Rolls for 5e
Retroactve Advantage
Minimal Roll Enhancements
Effective Transferral
Don't have either of those
disable all modules except for socketlib and libwrapper and repeat the steps to reproduce the error I guess
I may have forgotten a roller
Socketlib, libwrapper, and midiqol
is this via installing the module?
were you installing manually?
I am using Forge, so installing directly from the bazaar
what version of foundry do you have installed
and what version of midiqol
aaand what version of dnd5e
Latest version of all of that
version numbers please
MIDI: 10.0.23
DnD: 2.0.3
Foundry: V. 10, Patch 6, build 291
and the error is outside the game o rinside the game?
Inside the game
Whenever I try to for example cast a spell on a create I've set to auto-save
ok, so you will ned to find the culprit, but I really think you should revisit my list above cause it sounds like one of those are installed
if you have find the culprit module run it with socketlib and libwrapper turned on from the start
and midiqol
Aye, will try that! Thanks for the help
I am getting this error with my push feature:
const attacker = canvas.tokens.get(args[0].tokenId);
const target = fromUuidSync(args[0].hitTargetUuids[0]).object;
const knockBackFt = 5;
const knockBackFactor = knockBackFt / canvas.dimensions.distance;
const ray = new Ray(attacker.center, target.center);
const knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle))); //for 5/5/5 grids.
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
const isAllowedLocation = canvas.effects.visibility.testVisibility({x: newCenter.x, y: newCenter.y}, {object: target}); //might have an issue with going through walls based on some vision settings...
if(!isAllowedLocation) return ChatMessage.create({content: `${targetToken.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
const mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
is there a way to grant advantage only to a specific actor using active effect flags?
vow of enmity?
yes xD
I'm curious if the new evaluation in the effect value makes vow of enmity alot simpler
something like an effect macro that edits the dae effect value with the targets name
might even be simpler than that. could be as simple as args = @target.actor.name or something
or work it backwards, use a grant advantage and have the effect value be attack=paladins name
so are you implying that the value of the flag can be something other than "1"?
the effect value in the midi flags can be an evaluation that equals true or false
0 and 1 are just the simplest ways to do it
theres no documentation on what you can put in there but bugbear says its basically the same as the documentation on activation conditions in midi's readme
if no token is defined, in an activation condition target is assumed, you can also set them with target/source
for various ideas for evaluations you can look at midisrd and midi sample items for activation conditions, usually in weapons
ah! I feel this is a very important thing that should be written somewhere xD
I think it might be simpler to do the grant flag on the bad guy, and then have it use the paladins name to check in the evaluation since the pally's name is simpler to define
yes I agree
if you are really lucky, a couple experts might catch these comments and decide to flex some code on us
I was trying to do caltrops myself
Could click on the grey lettering that says VM15369:6 and screenshot the source tab that it opens?
give me a second to reproduce
When I redid it I got this error instead, and clicked the link:
Did you hit any targets when that error was thrown?
no its a saving throw ability and on failure the creature is pushed 5ft
I'm deploying the push in an active effect with the key macro.itemmacro
Did you have any targets selected?
its not running as a GM
As usual, log out the args and double check
slap a console.log(args) at the top and run again
hang on this was all done in macro polo
Pretty sure your hitTargetUuids is empty
I'll do a fresh args here though
yeah zhell and freeze thought that dae or item macro don't use that or something
If it's a save ability, you should just be using targetUuids if that exists
That's why
they told me to change args to 1 instead of 0 and then there were more issues
You can have the macro check if the save failed
if (args[0].failedSaves.length != 1) return;
Assuming this is a single target ability
yes single target, but do I add that to the original or do I have to do more editing?
I'll look it over
do I still keep the args 1 change?
one moment
I really appreciate the help
Yeah strength
fwiw its the Martial Arts Adept feature
every unarmed strike by the creature rolls a d4 and depending on the result applies something. I have it all setup in advantage reminder but I just couldn't convert the push macro I had for it
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle)));
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
let isAllowedLocation = canvas.effects.visibility.testVisibility({x: newCenter.x, y: newCenter.y}, {object: target});
if(!isAllowedLocation) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
My testing doesn't have the wall checking part working for me
It just gets moved through the wall anyways
Β―_(γ)_/Β―
But I don't know how canvas.effects.visibility.testVisibility is supposed to work.
It does due to visibility
Do you have 0 vision?
Or a sense that goes through walls?
Vison enabled with 0 as the vision range
the map I was testing has global illumination on
So it might just be that
Either way, try the above macro @vast bane
Run as an item macro
Does Foundry have a function to check if a ray collides with a wall?
Just found canvas.walls.checkCollision as a function.
the monster its being connected to has no vision setting
Testing some native Foundry functions to see if I can find one that works better then checking the vison of the destination
the macro as it stands works great for me, cool if you can find wall detection though
@vast bane
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle)));
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
This one uses Foundry's wall detection, should work better.
Thats good
its working
however, its spoiling the name I think which I dunno if you can fix that
It's actually not working for me in a spot it should be
let me do more testing lol
The chat message can just be removed
yeah just moved around and its not working
That was there in the original macro
I think its detecting the wall to the side
I get the feeling the original one didn't work going downward
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(2);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if (hitsWall) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
This seems to be working better
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(2);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if (hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
If you don't want it to have a chat message.
actually
I need to change one thing it seems
It works as long as they're within 5 feet
I was just gonna suggest also labeling the macros outside the code for future generations of midi users who search for a push or martial arts adept feature
That actually works for the monster I'm using since they only have 5ft reach
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(1 + (canvas.dimensions.size / ray.distance));
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
Now I think this should work correctly.
Even if the target is more than 5 ft away
This will move it 1 grid, not bothering with checking if it's 5 feet
I don't think checking the grid size will change anything, since it's snapping to the grid anyway
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(1 + ((canvas.dimensions.size * knockBackFactor) / ray.distance));
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
This would take into account the grid size. But I don't think it'll do anything differently unless you're on gridless.
I really appreciate the help, I thought for sure I was just a few typos away from having it lol guess I was way off!
Ehh
I totally reworked it
The original macro was checking visibility, actually checking for walls makes more sense imo
That last one is actually useful now that I think about it. You can change knockBackFt to the desired feet to be moved away instead of a set 1 grid. I'm sure there are other features that can move stuff more than 5 feet.
Roll Other Damage: [10] 20 on the Attack Roll, Not Construct or Undead
Is this it? This seems to deal extra damage when the attack roll is a 20. Is there a way for this to check the target's AC, and roll extra damage when the attack roll is +10 higher than the target's AC?
Also, is there a midi flag for limiting Dexterity modifier to AC? I know medium armor has it as a setting, but some shields I have in my brew have a similar dex limit
the sword of lifestealing should have an activation condition field filled in with code, it is probably set something like Something===a d20 rolled as 20. You can change that to the math you want.
I forget the exact reference but the ac modifier for medium armor is like @attributes.dex.ac or something, so you could probably add that as a ac bonus key to your shields?
cole's post in dnd5e's channel will tell you the exact syntax for that
lol now I get why you sound so lost lol
midi sample items, Sword of lifestealing, and midi items in general some automated ones will have code in the activation condition field on the items details tab
ah ha
There are probably better examples, and I swear to god bugbear a very long time ago made a drow poison item that failed by more than 5, and that would be waaaay more like the item you want but I can't find it so when he made it, he never used the words drow or poison in it
rats
I really really wish discord search allowed for searching in the code
so many things could be found so easily
no joke, that's super annoying
activation conditions, and also the effect value on midi flags, is basically an equation that has to evaluate as true
So this line
workflow.diceRoll === 20 && !(["construct", "undead"].includes(raceOrType)) && item.attunement !== CONFIG.DND5E.attunementTypes.REQUIRED
Help me understand each part so I can modify it. I only want the dice roll check to be +10 more than AC, then roll another weapon damage dice
ooh wait, bonus damage might need a macro, ugh I got dual sessions this week I can't dive deep into anything here bud I hope I got you part of the way
I feel like it should be something like:
workflow.attackTotal - 10 >= workflow.targets.first().actor.system.attributes.ac
I don't mess with activation conditions much, but this may work
Let me actually test it
EC?
yeah, the flag doesn't tell me what EC stands for
check calego's post in dnd5e maybe?
either that or select a token and do _token.actor
in the console
I don't see that as a field
and try to follow the rabbit hole with system, attributes, ac, yada
there are keys in dae that do nothing btw, its kinda like mod authors register them I think with tposney and he adds them?
thats why half of ate's keys right now don't auto complete, dae hasn't updated since ATE went v10 official
Not a core field at all. Maybe just stale module data.
Yea, no clue. Module garbage probably
Gotcha
Not core at all
moto, I found the flag for limiting dex. It's attributes.ac.dex
yeah it is funny though that there are modules parading as dnd5e flags, theres a bunch of them in there, wouldn't the wiser thing be to use different flag naming to not confuse with dnd5e?
Depends
you actually want the key to be system.oh god bonuses.ac? and then in the effect value use +attributes.ac.dex
I'm banking on the fact that whatever world you are making your shield in has DAE installed as I think core doesn't let you do +attributes.ac.dex but dae would allow it
yeah we've got DAE. I'll do it there
did you test it?
Fixing it now
Testing to see what works or not lol
I don't normally ever mess with activation conditions
@covert mason
Step 1. Create a compendium that is specifically setup to store all of your various future "Macro.createitem" items. As you don't want to mess with them or random shit will start to break.
Step 2. Download both of these items and import them into the side bar. I personally put both of them in the special createitem compendium, but technically only "Scorching Rays" needs to go in it.
Step 3. Edit "Scorching Ray" and go to the effect value on the active effect, Drag and drop the "Scorching Rays" feature into the effect value. Do not confuse the two items here.
Step 4. If you have VAE, ask me if you want the button to appear in VAE otherwise ignore the rest of this.
oh shit step 2: If theres something already in it, DELETE IT(the effect value, its my UUID which I think breaks when we import/export
maybe one of the pros can clarify that but I'm pretty sure the UUID's are unique to server/sessions
You'll need to update the UUID in the macro.createItem by re-dragging it from the compendium to that field
But that's about it
prolly should have cleared it before I sent it, oh well he'lll figure it out
workflow.attackTotal - 10 >= workflow.targets.first().actor.system.attributes.ac.value
There
@spring dove
in the other damage field
awesome, thank you so much
What if I have my Macro.createitems in an items directory folder instead of a compendium? Also, can I turn this feature into an atwill spell?
That's technically fine
But you'll very quickly have a disorganized mess of items
Plus run the chance of accidently deleting it
Compendiums are tucked away a bit
hmm, so it's not working as I expected.
how so?
did you want circlet of blasting instead?
What's your midi setting for roll other damage?
Do you mean on the weapon?
What's the AC of the target?
if you upcast the scorching ray spell, it will change the charges on the scorching rays feature, I don't see any value in the feature being an at will, other than it being in the spells tab if they use their sheet to roll
@covert mason I think I might have modified that for circlet of blasting make sure I'm not overriding the to hit on the spell
Does it work after changing that?
testing now
yep! works perfectly
AYYY, IT WORKS
Now all I need is a wee ui notification telling them it's been added to their at-will spells.
I use VAE
I've started doing all my temp items with buttons in VAE tooltips
Yours probably has it setup but its poitning to a folder macro that doesn't exist
so you'd have to remake it
ui.notifications.info('Message');
@vast bane I saw you were talking about EC flags. That's Challenge Mode Armor Class related.
Check midi readme. EC stands for Evasion Class.
@dark canopy π
https://gitlab.com/tposney/midi-qol#optional-rules scroll a bit down if anyone is interested π
hmm was it damage if fail by 5 or more?
I'm trying to add an effect filter to my Levitate effect, and I'm trying to use Effect Macro to achieve this.
On Effect Creation:
let params =
[{
filterType: "transform",
filterId: "dodgeStance",
padding: 50,
animated:
{
translationX:
{
animType: "sinOscillation",
val1: -0.05,
val2: +0.05,
loopDuration: 6000,
},
translationY:
{
animType: "cosOscillation",
val1: -0.05,
val2: +0.05,
loopDuration: 4000,
}
}
}];
TokenMagic.addUpdateFiltersOnSelected(params);```
On Effect Deletion
```js
TokenMagic.deleteFiltersOnSelected();```
How can I ensure that it's only the token with the effect on it that's affected by these? Anything that can be improved here?
I think Chris took care of him, it wasn't my request personally, I just remember you making a fail by more than 5 item for either me or someone a very long time ago.
Aedif made a macro tool for tmfx that is insanely awesome
Maybe? that's for a hit though
Nice! Do you have a link to it?
This requires Mass Edit Module and you kinda want TVA too it only works on tokens who have an existing TMFX filter on them.
You don't need TVA, its just the easier way to get a filter on the token
I donβt suppose anyone in here has tackled Magical Inspiration yet? Iβm guessing it would use an optional bonus and therefore the DSN base dice wonβt roll again π
someone just recently dealt with a single roll to one target in an array, I dunno if they figured it out, they asked tposney for help
I think it was chris
It's pretty simple to do with optional bonus flags
its not an overall add, it adds to 1 target if you use it on a fireball
If a creature has a Bardic Inspiration die from you and casts a spell that restores hit points or deals damage, the creature can roll that die and choose a target affected by the spell. Add the number rolled as a bonus to the hit points regained or the damage dealt. The Bardic Inspiration die is then lost.
Ah
so it gets messy
I need to update mine for that
If I had a bard, I'd prbably just rule it as the unearthed arcana version and let it roll
but probably block it for magic missile lol
I swear someone did something, I thought was you, might have been another user, tposney responded to them so you could probably search his messages
Was me for a similar feature
Some sort of snag in picking a target out of the group
I didn't post yet however
This looks pretty cool! Though I'm trying to have the macro animate the FX on the token its effect is on when it's created
the macro lets you easily create and save them
and then when you do macro.tokenmagic the created ones show up there(in a dae key)
cause the old tmfx method was a pita to save new versions
So-... wait, hold on
I have a guest player coming tomorrow night who wants to play a level 10 battlemaster fighter but I have no idea if they are going to flake out on us or not, trying to decide if I really want to go through MASIF and v10ify his work just for a potential no show
The ones from that flag are just the saved presets
...I'm a little bit confused. How do I use this editor macro to achieve what I'm trying to do?
The lil mouse looking icon on the top bar is the "add new preset" button
macro.tokenmagic
@covert mason You may be interested in this: https://github.com/MrPrimate/ddb-importer/blob/main/macros/spells/magicWeapon.js
Integrate your dndbeyond.com content into Foundry virtual tabletop - ddb-importer/magicWeapon.js at main Β· MrPrimate/ddb-importer
Based on the macro you're troubleshooting in #macro-polo
Nice! Is this an on-use ItemMacro or one executed through DAE?
Looks like DAE
@hoary reef if you want Midi to prompt the player and yourself for saving throws with a button, you would need to install LMRTFY or Monk's tokenbar. I personally use MTB. I dunno why midi blocks the core button
in the same place as auto check saves, theres 3 drop downs at the bottom, change them to the setting you want. I personally run MTB for all 3, but I turn mine to auto during the week when I'm idle so the players can cast on the combat dummy
This one?
all three
the one you highlighted only works for players, the ohter two are for the DM
Looks like it applies a NaN bonus to the item in question
You likely need to look at how it's configured.
try it on a starte rhero
NaN = not a number, so it's likely looking for something that's not set
I can screenshot how mine looks configured when I'm back later
Otherwise I'm pretty sure spell importing doesn't require a Patreon sub
Yup, same issue
I'd very much like that π
I'll try installing the module and importing it
Looks like it needs @item.level set somewhere
Whoa. ok. TIL midi is even more hard core then I had understood
Would you happen to have a visual example of how your Dragon's Breath is set up? Macros, DAE, MidiQoL, etc?
https://ko-fi.com/post/Badger-Scripts-Dragons-Breath-spell-M4M3GED2E
Also, could it be possible to change the name and icon of the summoned item depending on the damage it deals? I'd love to try my hand at having A-A recognize each name and have different colour breaths for each type of damage.
If your have token magic fx it should change the template based on the damage type
Aye, but the auto-recognition for damage types TokenMagicFX does look a little too janky for my tastes. I honestly prefer the stuff JB2A does
Readme for that says it needs a little setup, you'll want to swap one of the first lines to use midi args
args[0].castData.castLevel I think
Actually
It's not using that
Looks like you need the spellDC
const [{spellLevel: level}] = args;
const actorDc = actor.system.attributes.spelldc;```
Something like that?
For a Midi on-use item macro?
Oh wait
It does
castdata.castLevel most likely
Depending if uses a scaling formula or not
const spellLevel = castdata.castLevel;
const actorDc = actor.system.attributes.spelldc;```
args[0].castData.castLevel
const spellLevel = args[0].castData.castLevel
const actorDc = actor.system.attributes.spelldc;
const buttonData = [
{
label: 'Acid',
value: 'acid',
},{
label: 'Cold',
value: 'cold'
},{
label: 'Fire',
value: 'fire'
},{
label: 'Lightning',
value: 'lightning'
},{
label: 'Poison',
value: 'poison'
}
];
const element = await warpgate.buttonDialog({buttons: buttonData, title: 'Target recipient and select element:'}, 'column')
if(!element) return;
const target = game.user.targets.first();
if(!target) {
ui.notifications.warn('Please target one token to receive the ability.')
}
const abilityData = {
"name": "Breath Weapon",
"type": "spell",
"img": "https://assets.forge-vtt.com/6148732b96e0aff7127b447b/Icons/Spell_Icons/Fire/T_Icon_Fire_98.webp",
"system": {
"activation": {
"type": "action",
"cost": 1
},
"duration": {
"units": "inst"
},
"target": {
"value": 15,
"units": "ft",
"type": "cone"
},
"range": {
"units": "self"
},
"ability": "",
"actionType": "save",
"damage": {
"parts": [
[
"(@item.level + 1)d6",
element
]
]
},
"save": {
"ability": "dex",
"dc": actorDc,
"scaling": "flat"
},
"level": spellLevel,
"school": "trs",
"preparation": {
"mode": "atwill"
},
},
}
const updates = {
embedded: {
Item: {
[abilityData.name]: abilityData
}
}
}
await warpgate.mutate(target.document, updates, {}, {name: 'Dragon\'s Breath Ability', description: `Providing an at-will spell, ${abilityData.name}, at level ${spellLevel} using ${element} damage`});```
I hit the damage buttons on the dialogue and nothing appears in the at-will spells.
just copy the call lightning bugbear made with macro.createitem
First line needs a spellLevel = in the front
I have a macro.createItem implementation for this too, uses advanced macros to update the DC and spell level on the item however
yeah I just copied bugbears work on call lightning for my temp save items
I should remake it as a warpgate item to avoid using a gm macro call
mine doesn't use a gm macro call I don't think
Or maybe have effect macros read a flag
game.user.updateTokenTargets()
canvas.templates.placeables.at(-1)?.document.delete()
let i = 0;
while (!token.actor.items.getName("Call Lightning attack") && i < 3000) {
console.log("Waiting for Call Lighting attack item to be created, if needed!")
await warpgate.wait(250)
i += 250
}
const item = token.actor.items.getName("Call Lightning attack")
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 3) {
let newItem = duplicate(item.system)
newItem.damage.parts[0][0] = `${castLevel}d10`
await item.update({'system.damage.parts': newItem.damage.parts})
}
As written, simply item macro on the dragons breath spell
What I really like about it is that I'm able to follow how to adjust them finally, kinda feel like neo in matrix
But it looks like the midi execution is worked out?
Worked out perfectly!
Just need to figure out how to change the breath weapon name depending on damage chosen now
"name": `Breath Weapon (${element})`,
? hmm
My biggest weakness, dialogs in macros lol
heh, yea, hence buttonDialog and menu π just gimme some buttons and gimme an answer
Is it supposed to be
"name": "Breath Weapon (${element})",```
or
```js
"name": `Breath Weapon (${element})`,```
?
Warpgate dialogs make it pretty dummy proof
Oh, wait, the java script in the code tells me. π
@vast bane youβve precisely suggested using a dfred effect to work around a complicated macro. Maybe you can help me with this?
I was able to build a macro today (with help from the community) but I would like to make a passive effect that triggers the macro whenever that actor casts a spell. Is this possible?
I was able to set it up on a firebolt spell as an item macro. And set it to the duration to expire on spell cast and for that one spell itβs working as desired. It applies when I cast the spell and triggers the macro. Then I have the effect on me, and it triggers again when it expires on cast of any other spell. If I could get it to automatically reapply that effect Iβd probably be golden.
sounds like world script territory
Shoot thatβs what the other guy said too haha. But was unable to help me further.
Can be done with an on use macro with midi
How so?
oh yeah actor on use
So I can check the on use box. Set the active condition to βWhen casting a spellβ (or something like that)?
Then filter for the item type
If you want an example
Cool! Alright Iβll try messing with this for a while. Thanks!
On use macros have a lot of uses. I feel like half my automations make use of it
Are you willing to walk me through the steps this is saying?
if (this.item.type != 'spell') return;
let damageType = this.defaultDamageType;
let validTypes = ['healing', 'acid', 'fire', 'necrotic', 'posion'];
if (!validTypes.includes(damageType)) return;
let damageFormula = this.damageRoll._formula + ' + ' + this.actor.system.abilities.int.mod;
this.damageRoll = await new Roll(damageFormula).roll({async: true});
this.damageTotal = this.damageRoll.total;
this.damageRollHTML = await this.damageRoll.render();```
so it's checking if the target is size 0, then it's checking if they are using a spell, then...?
oh then it's checking if the damage is one of those types. if so then roll damage
then you lose me at line 6
Sure
Line 6 is adding the actors int modifier to the damage formula
Line 7 does the roll
8 updates the total, and 9 rerenders it since this macro is running post damage roll
What about an actor onUse macro? Everything should be the same, it's just that it will trigger on any spell cast, rather than just the item.
yes this is exactly what I want. I'm just not very good at writing macros. I was actually just about to ask how to set up and actor on use.
I tested it setting up the item macro on use for firebolt and it works exactly how I want. So I could go through and apply that to every spell on the character. But if I can do this actor onUse that would be better
Dae set to flags.midi-qol.onUseMacroName CUSTOM macroName,macroPass
Most likely want it set as a on equipped passive
Do I put that on a custom convenient effect with no expiry?
I have some screenshots here: https://github.com/chrisk123999/foundry-macros/tree/main/Features/Class Features/Monk/Focused Aim
Make a feature and give it a DAE effect essentially
the "macroPass" part, what do I do for that?
before attack roll, and make a second one before save?
So create a new feature (in my example imaginatively called New Feature) and create a transfer effect with the following setup.
Which says call the itemMacro on the item "New Feature" whenever an item is rolled. Then you need to check that it is a spell being cast (item.type === "spell")
Depends what you're doing
The pass only really matters of your modifying a workflow from midi. Use postActiveEffects if you're not.
If you set it up like in tposney's screenshot you can have the macro in the item macro of the feature
oh nice ok
I want to tackle the 'never-or-always' broken bounded accuracy of late game expertise/advantage/observant that hinders flat DCs with traps and spells requiring Perception, Investigation, and Insight. With absurdly high DCs necessary that others couldn't possibly reach, and otherwise having to decide how to narrate and write around characters noticing everything automatically, even in dim light.
And how when choosing flat search DCs, you're basically choosing beforehand who sees and who doesn't, unless characters make a search check.
I want to make a formula bonus for passives, but I'm not sure how to format it.
The idea is this. No +/-5 from advantage/disadvantage, no double proficiency from expertise:
Expertise + Advantage: For checks, 3d20kh (min 5?) + proficiency + mod. For passives, 7 to 17 rolled 3 times keep highest + proficiency + mod.
Advantage: For checks, 2d20kh + proficiency + mod. For passives, 5 to 15 keep highest + proficiency + mod.
Neutral: For passives, 5 to 15 + proficiency + mod
Disadvantage: For checks, 2d20kl + proficiency + mod. For passives, 5 to 15 keep lowest + proficiency + mod.
Due to the level of variance making at least one character statistically likely to pass, I could implement group checks.
I was thinking a formula like this:
value = 0
adjust = 0
if (flags.midi-qol.advantage.ability.check.all == 1 || flags.midi-qol.advantage.ability.check.wis == 1) {
value += 1
adjust += 5
}
if (data.skills.prc.value) == 3 { (assuming 3 means expertise)
value += 1
adjust += @prof/2
}
if (flags.midi-qol.disadvantage.ability.check.all == 1 || flags.midi-qol.disadvantage.ability.check.wis == 1) {
value -= 1
adjust += -5
}
if (value == 2) {
[[{3d11kh, 5}kh - 4 - adjust]]
} else if (value == 1) {
[[2d11kh - 6 - adjust]]
} else if (value == -1) {
[[2d11kl - 6 - adjust]]
} else {
[[1d11 β 6 - adjust]]
}
Any insight?
where do I put the item.type === "spell"
In my macro?
Yes, my example from before has it on line 2.
this is my macro
const dieSize = character.system.resources.primary.value;
const roll = await new Roll(`1d${dieSize}`).evaluate({async: true});
await roll.toMessage({
flavor: `${character.name} burnout roll`,
speaker: ChatMessage.getSpeaker({actor: character})
});
if(roll.total > 2) return;
await table.draw();
await character.update({"system.resources.primary.value": Math.max(4, dieSize - 2)});```
I can just copy `if (this.item.type != 'spell') return;` and put it at the top?
Yep
ok I put it in and tested it, it is running my macro even when using a crossbow. So I didn't do it right
Could you post what you have?
I must not have clicked save macro. I got it working now
That would do it
@scarlet gale @gilded yacht You both are champions!!! Thank you so, soo much!
I did receive this variance macro in this post here #macro-polo message
It creates a single effect with separately-rolled boosts for Perception, Insight, and Investigation to tokens that are selected. It could be replicated for this, but I'm not quite sure how to work the if statements and stat references in.
for(const token of canvas.tokens.controlled){
const effect = token.actor.effects.find(e => e.getFlag("world", "randomPassive"));
if(effect){
await effect.delete();
continue;
}
const {total} = await new Roll("3d6 - 10").evaluate({async: true});
const changes = ["inv", "prc", "ins"].map(id => {
return {key: `data.skills.${id}.bonuses.passive`, mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: total};
});
const effectData = [{
changes,
label: "Random Bonus",
icon: "your icon here for the effect.webp",
"flags.world.randomPassive": true
}];
await token.actor.createEmbeddedDocuments("ActiveEffect", effectData);
}```
Hey there! I'm trying to understand what args[0].workflow is being used for here.
Is there something I'm missing that you don't just go for args[0]?
They don't have the same data
The workflow has more stuff and I find easier to work with
such as grabbing the token
Ah! Can i read up somewhere on what's contained in what?
The midi documentation kinda touches on it
I've just been messing with workflows long enough to notice that they contain more useful things
and they're formatted differently
for example args[0].targets is an array
while args[0].workflow.targets is a set
@lean stone You can!
What! There's a dedicated option for that. Shame on me for not spotting that. Thanks for the heads-up!
Is it possible to have midi transfer effects like Blinded or Restrained even if they do not match the name of the item rolled?
did i do this right?
Yes, the setup is correct, now you just need the macro to do something!
suggestions?
Haha, I'm afraid I don't know javascript
thats fine. what would you have to macro do typically
thsi is an awesome idea!
if you manage to make this work could you share with me
Click the wrench on the item rolling, add a new dae for blinded or restrained.
Does anyone have a working version of the Swashbuckler feature Panache or do you just handle it manually?
is there an easy module way of doing spell effects that remove when out of radius and apply when going into radius? I have the damage part using overtime so that's bit is ok.
Active Auras
Hey everyone sorry noddy question but I am having a problem with getting midi to automatically add concentration on using a spell, it still seem to check the concentration if I manually set it but it doesn't set it on casting
does it work with just midi/socketlib/libwrapper active?
Nope
midiqol configure module settings>workflow button>concentration tab. If its not obvious what to change, screenshot the tab, one of us will chime in with whats messed up
Okay wait I tried it now and it works turning everything else off, I will go through and figure out what caused the issue. cheers
combat utility belt and/or all the naughty rollers are probably the culprit
I'm using system.bonuses.msak.damage to give +1 to touch based spell damage, but I also want to give +1 to touch/melee ranged healing. Is there an option for this?
Better rolls for 5e
Ready Set Roll
Minimal Roll Enhancements
Roll Groups
Fast Rolls by default
Fast Rolls
Dice Tooltips
retroactive advantage
Wire
All do not work with midi qol
Cheers thanks
theres like 4-8 spells total and likely they don't have all those spells, you could just mod them all manually if the bonus is permenant
Making some good progress on Magical Inspiration.
This is way more complicated than I thought it would be
Is there a 'radius' circle template setup which does -not- also target yourself?
set the bottom of the two range/targets as self special
So it was the simple Calendar module causing the issue for me
Just wrapped up making Magical Inspiration. Needs some heavy testing, but I think it's pretty good to go.
(Requires your Bard class to have a scale set for bardic inspiration),
that seems weird, are you sure? alot of folks make the mistake of not pre enabling socketlib/libwrapper and other dependencies and it winds up throwing the culprit off
I know it cant be simple calendar because I have midi and SC, as many of us do. Is your SC stuck in the 1.3 versions? A known bug people sit with without realizing it cause of the update button being broken
what is your foundry build, dnd5e version, and midi qol version?
uninstall and reinstall simple calendar, but I highly doubt thats the cause
Will try
you never shared the midi settings tab for concentration
@coarse mesa I think you were interested in magical inspiration yesterday.
just show us what a spell looks like in chat when you cast it
and the details tab of said spell
maybe we can spot one of the naughty rollers
It works fine now with simple calander
(my list was not exhaustive)
the simple calander was just stuck in 1.3
and was throwing it off for some weird reason
yeah but SC doesn't even touch rolling spells or concentration
Oh yes indeed, thanks so much! Will give it a test this week
Let me know if you run into any issues.
I'm pretty sure I've done a good amount of testing
But there's always edge cases I could be missing.
Thanks for the help though
It looks pretty involved! Never would have figured this out myself
Yea, it was pretty messy
The targeting selection dialog took me the most time lol
That and figuring out how to edit the damage details
I predict WotC wonβt have abilities that work like this in 5.5β¦ now theyβre in the VVT game too. Probably a good thing for everyone
Assuming the rules designers even talk to the devs π
@coarse mesa Small update. I just realized I didn't need to be running on as many macro passes as I was.
Is there a reason why this isn't working?
Character A uses spell on Enemy A.
Enemy A gets hit and gains the effect.
Character A Ends turn.
Enemy A loses effect immediately (instead of at the end of their turn)
I thought it might see the enemy as the 'source' instead of the target, but I tried changing to 'end of sources turn' and it makes no difference
What happens if you add rounds to the duration? Also do you have Times Up?
yes to times up
If I add rounds to the duration the special durations then actually work it seems
so that fixes it, but still seems like a bug (as far as I know the specials shouldn't require a regular duration as well)
The issue there is you never specified any duration to begin with. No duration for a temp effect is just gonna be removed. Passive effect wouldn't.
(works for me fine on v9)
midi should respect the details duration though I think, ist the item not setup?
The duration is 'end of targets next round', I'd have thought that would be sufficient as it's a definitive time
turn not round, but yeah personally I always set seconds AND rounds AND special durations
cause of weird totm combats
Like that player who casts shield to roleplay a solution to a non combat encounter or something
That's fine then I added a random limit that was longer than it needed to be
I just assumed it was a bug
So last night was my first night running my humanoid randomizer. It works great, but it was utterly hilarious to have the Giff recieve a -5 to his dex mod as a gunner. His dc for his handgrenade was 19, but all of his gunshots were dex based and had no positive bonus it was comical. I still love it, adds to the flavor of humanoids in battle. Just need to scan their randomization before I go to play them lol.
Anyone have a working macro for Tasha's Hideous laughter? I've tried the ones in MidiSRD, but they are for v9 (I'm on 10) and don't work. I have everything in the effect working just fine, but the "target gets to save on taking damage" part.
pretty sure this is in midi sample items or midi srd
did you install the unofficial midi srd?
Love this. Our table really really gets a kick out of Token Mold adjectives for similar reasons
I went with the mods instead of actual attributes cause the dice rolls would swing too far having to double the changes
cause an attribute changes the mod for every 2
This is really weird, the tashas automated versions are not in midi srd anymore?
I swear they were
oh, srd versions, naughty tasha
@vast bane I installed the one from the Dropbox link, but it is missing the macro attached to the spell. Do you have a link I could grab it from?
the macro is in the modules file, thats how midi srd works:
I dunno how to find them in midi srd's files but I'm testing it now to see if it works
@vast bane Yeah, I saw that, but I couldn't actually find the macro itself. The only macro in the Macros Compendium is CUB Condition.
nah, midi srd has an actual file in the modules folder for midi srd where all the macros are stored
they aren't front facing for users you have to dig
honestly we should @violet meadow since its his pet project and this is the error in midi srd's macro version of hideous laughter. I ponder if the issue is some missing things in the macro.itemmacro key:
If bugbear doesn't figure it out I'm sure one of the other gurus here can spot the mistake in MidiMacros file in the modules folder
its apparently line 29 in midisrd macros
@vast bane Yeah, it's a weird one. I tried it out and it works, IF I use it from the character sheet. If I use it from Token HUB, nothing happens at all. But it does solve the saving on damage thing. Thanks!
its got alot of midi shennanigans but we could also post it in macro polo they might spot a v10 issue
Ah give me a sec to enable MidiQOL
Zhell just caught something in it in macro polos Bugbear
If I edit it in the dev tools does it edit the actual file on the server?
@vast bane@violet meadowDidn't mean to start a whole thing!
this is what we're here for bud
plus I have a wizard in my party, he doesn't have it prepared, but he does infact have it
@vast bane I've got a bard - he uses it all the time.
it's been broken since v9 lol
Ah no worries. I just saw a forgotten deleteEmbeddedEntities
I get the feeling editing in the dev tools is client only till I refresh eh?
I couldn't save it properly cause I'm not actually the host
I'd have to go into the file which I can...just will take a few
I am pushing an update in a bit
@violet meadow Thanks. That spell is way OP, but it will be nice to have it working properly!
Did you confirm it as the fix, otherwise I'll continue manually editing to help you test it if you want
do I need to reboot the server when I edit a modules file or just the clients?
Can you try updating?
my manual edit seemed to keep the error but I probably messed it up, using your version now loading in
Target is not defined?
normally item macro in the active effect, you guys put things in it like @something this one has nothing in there
lol it completely lacks the definition of target.
I'm trying to automate an Absorbing Tattoo's Damage Absorbtion feature. Is there an optional flag for specific types of damage taken?
Or is there some sort of macro that can prompt this effect?
When you take acid damage, you can use your reaction to gain immunity against acid damage, and you regain a number of hit points equal to half the damage you would have taken.
I would just make a reaction that gives them acid absorption for that attack
I believe theres an actual absorption key set in midi that does it all automatically
Oh shit
I don't think you can control when the reaction prompts though
well....hmmm. The optional macro setup might actually work, I dunno
Well I'll be damned
yeah that'd prompt every time but I dunno about you, thats just a thing we live with in our game, I set player reaction timers to 10 seconds and just live with the delays
Would probably need a world script to control when it prompts no idea if its trully even possible
or necessary really
Try updating again and grab the Hideous Laughter (macro) from the MidiSRD spells compendium anew
I can't cause its windows update week and my servers being a pita with a system restore step cause apparently its a big update
though when I was trying to find the error I get the point now of the macros being in the module file, this way you don't have to redrag them out...usually if the code changes on the file instead of the item.
You will need to draw the item out from the compendium again, or add a @target to the call of the macro.itemMacro in the Hideous Laughter DAE
For me, it throws the following error when it tries to add the effects.
You might be missing a needed module
No DAE?
@violet meadow I've got DAE and all my other added MidiQOL effect apply just fine. I'll toodle around with it and see if it's something on my end.
What version of MidiQOL are you on?
@violet meadow CUB? I don't even have CUB installed! MidiQOL 10.0.23.
Oh yes. It's Simple calendar module missing, or stuck in an earlier version
@violet meadowAhhhh! Let me uninstall and reinstall Simple Calendar and try again.
Afterwards probably the error will become ```js
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addCondition')
[Detected 1 package: midi-srd]
can we fix that to be cleaner, I was actually seeing that error and not worrying about it cause dfreds seemed to catch it
it would do the red error but still apply prone/incapcitated
something was still accomplishing the condition step
oh shit, I wonder if dfreds has a hideous laughter premade woops
arrggg wish this machine would finish with its system restore!
Of course it has
@violet meadow Yup, that's the error that I get, but it works! Yay! Thanks a bunch.
I will push another change in a bit to get rid of that. Will get some other things in there too before though
I can' live with it for now myself, I'm just now getting in to test will report back
Its funny I have cub, I just have enhanced turned off, it stil fails to apply it but somehow, I'm guessing midi+dfreds, its still managing to apply them
Yeah I had a premade custom for hideous for some reason applying both the conditions
Check the DC here, I think theres a problem still in it
It also prompts for another roll, but this could be because I'm stuck on 10.3 of MTB atm. But it literally prompted for a manual wisdom roll after the turn advanced onto the next turn in addition to MTB's roll
I tried to just put @target in I will redrag and see if there was more nuance to the item changes
I rolls the spell the save automatically.
I tried with the actual version in the compendium and nothing changed, its got the above issues still
I'm gonna temporarily bump up to the newest MTB and see if I'm just on a bugged MTB version
How would I format this in a DAE while also allowing for things like a shield to further increase AC?
While you aren't wearing armor, the tattoo grants you an Armor Class of 15 + your Dexterity modifier (maximum of +2). You can use a shield and still gain this benefit.
I hadn't pushed the version for the cub error yet. Now its out the 10.0.9
AC formula most likely
Custom AC Formula
@covert mason #modules message
probably need a max in the dex mod too
isn't ther ea field in the data for ac dex?
@attributes.ac.dex
yeah, that post is old probably so they hadn't had it then?
just avoid flat like the plague as its the only thing that I think blocks bonuses
As intended
and natural as it is essentially flat π
@abilities.dex.mod > 99 ? 10 + @abilities.con.mod + 99 : 10 + @abilities.con.mod + @abilities.dex.mod
DDB importer uses this for Barbarian AC formula. It appears to work with shields.
I feel like you should just be able to do 15 + @abilities.dex.mod as an upgrade
the what now
??
for the same effect
what is that 99
I have no idea what it's doing
I'm guessing it's some fancy way to allow equipped armor to overwrite it.
What the fuck is that.
Natural is the same as flat but allowing bonuses. It's for when you want a specific base number and don't really care about equipped armor and such
At any rate, custom AC formula still allows a shield bonus
yeah it does but now I wonder what that formula is supposed to do. Is there a fancy AE going on?
Why not just set it to .barb??
that was intended for Chris
Doesn't look like it's anything other than just a AC formula upgrade
Monk unarmored defense also imports like that too
ternary operators on formulas are not a thing anymore, no?
The importer does tend to use a bunch of deprecated stuff for AC, so it wouldn't surprise me if it's just outdated ways of doing things
Apparently ternary operators do work in AC formulas
Easy test: @abilities.dex.mod > 1 ? 0 : 1
How do i set up the midi to prompt players for advantage or disadvantage + any dice command they can add to it
Turn off fast rolls or whatever it's called
Should be in the midi settings
its outside the workflow button in main settings
its abnormally in a weird spot
I'm sure theres a reason why, but just pointing out its in a unique place int he settings outside the workflow settings button
hey @vast bane, I got a complicated question
In roll20, there was a way to set up a query inline with a roll. It was a "?" followed by the options and if those options translated to something else, like a number. So for example, you could set up an inline query for an upcasted spell damage, something like
?(Spell level?|2,d6;3,2d6;4,3d6,etc;etc)
I know the syntax won't be the same, but is there a way to set up inline queries in Foundry, or in Midi?
What should the damage be for each level?
Reason I'm asking, is I've got that extra damage on the "other damage" field when the attack roll is +10 over target AC. But, some weapons have versatile, so I need an inline query to ask how many hands are on the weapon
So the inline query needs to be something like
?(One handed or two handed?|one hand,d6;two hands,d8)
I've got other conditions that need inline queries, but once I figure out how to do it, I'll write them myself.
My opinion of dialogs in foundry vtt:
https://media.giphy.com/media/aNFT7eG2rIKK715uLk/giphy.gif
Bit confused what you're trying to do
If it's from that extra damage when over 10 ac thing from earlier
Yes
It being versatile shouldn't change anything
Because there's only one "other damage" field, I can't two different damages.
Chris hes doing an activation condition to apply other formula
Yes, but am I not using the "other damage" field for the extra damage dice?
but since the dice size changes, it won't work
ah
Right
So if I can put an inline query in the other damage field, it could change the dice size depending on the query
inline queries are a roll20 thing, and I agree, yes, I miss that sweet sweet goodness
yeah? Would it be easier to have a one handed and two handed version of those weapons?
Yeah cause then you put bugbears activaction condition in and put the extra dice in other formula
So inline queries aren't a thing in foundry?
if you don't fast forward you could just do this as an advantage reminder
Cuz I could have sworn there were spells that asked for the damage type you wanted, like chromatic orb
no dialogs are a pain in the ass to make and need macro work
ugh
(warpgate dialogs)
It is virtually the only thing I miss in roll20
I cannot believe that they have not brought that over to foundry and made it better like everything else about roll20 here. It was such a core crutch that everyone used and in order to use it here it has to be a macro and it has to involve js
yeah that does seem like an obvious feature anyone familiar with roll20 would want in Foundry
I asked Kaelad about having the ability to use a macro to apply to a situational bonus in AR, and that will be the closest we will get to roll20 inline dialogs
Or hell, just add the option to add more than one "other damage" formula
but right now not possible
#feature-suggestions awaits, but it is far from an easy thing due to the richness of data that foundry's rolling system has access to
I'll put my bid in nonetheless. They've done a lot more with a lot less prompting lol
const result = await warpgate.buttonDialog({buttons: [{label: "OK", value: true}]}; console.log(result);
where do I put this?
the problem there is I have to know JS and honestly I'm kinda proud of myself that i've actually started to sus out some stuff, but dialogs just cross my eyes and confuse me
Wonder if babonus could pull your idea off
I'm right there with you. I feel like I should have learned JS a long time ago
in whatever script you need a dialog in π
however, now that the roll system is moving towards fully async -- inline queries are more possible than previously
Hm?
Wuh???
Oh, the core rolling.
Whew
A longsword that swings 1d8 or 1d10, if it beats the ac by more than 10, gets an additional die or two of whatever the handedness was
Gotcha. Then no. Attack rolls and damage rolls are two separate rolls, they don't interact.
we're doing it with an activation condition that then rolls "other damage" field
(as far as babonus is concerned)
Is that a module?
I honestly thought babonus was Moto's nickname for you, which was odd but I wasn't going to judge lol
At this point I think you're better off just doing it with a macro
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
if (workflow.attackTotal - 10 < targetActor.system.attributes.ac.value) return;
let damageFormula = workflow.damageRoll._formula;
roll = await new Roll(damageFormula + ' + 10').roll({async: true});
await workflow.setDamageRoll(roll);
Adds an extra 10 damage when the roller is 10 or higher than the target AC.
Run on "After Damage Roll".
Build A Bonus
it isn't an extra 10 damage, it's an additional damage dice. Which is why the damage dice size changes with versatile
No thatβs baebonus
this is an Item Macro, right?
thanks
Does the extra dice get doubled too when you crit?
no
May be helpful if you have the full text context.
This is from Revised Martial Equipment.
Powerful blow = +10 over target AC
wait, is the beaver really a baboon?
attachers = sneak attack, smite, poison, etc
what IS the animal in babonus then lol?
Otter
I thought it was some sort of homage to Badger or something
It's Steve
We all luv Steve
We all have a Steve
Thats 100% an otter
And the circle is complete π€£
You guys know the easter egg in his module?
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
if (workflow.attackTotal - 10 < targetActor.system.attributes.ac.value) return;
let damageFormula = workflow.damageRoll._formula;
let diceNum = 1;
//if (workflow.isCritical) diceNum = 2;
let bonusRoll = ' + ' + diceNum + 'd' + workflow.damageRoll.terms[0].faces + '[' + workflow.damageRoll.terms[0].options.flavor + ']';
roll = await new Roll(damageFormula + bonusRoll).roll({async: true});
await workflow.setDamageRoll(roll);```
Uncomment line 9 if you do ever decide to allow it to crit.
lol
Yeah
I think its basically crit if over 10 or 20
most of the time, but not all the time
but not twice if the ac is 10 and he rolls a 20 or whatever
you can +10 a slime pretty easy, but a crit on a dragon isn't going to be +10 over every time
You bsically don't want to add that extra dice twice during the natural behavior of the crit if both qualifiers happen
right
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
let doExtraDamage = false;
if (workflow.attackTotal - 10 >= targetActor.system.attributes.ac.value) doExtraDamage = true;
if (workflow.isCritical) doExtraDamage = true;
if (!doExtraDamage) return;
let damageFormula = workflow.damageRoll._formula;
let diceNum = 1;
//if (workflow.isCritical) diceNum = 2;
let bonusRoll = ' + ' + diceNum + 'd' + workflow.damageRoll.terms[0].faces + '[' + workflow.damageRoll.terms[0].options.flavor + ']';
let roll = await new Roll(damageFormula + bonusRoll).roll({async: true});
await workflow.setDamageRoll(roll);```
Make sure the item macro is running as "After Damage Roll" instead of the normal "After Active Effects"
I'll give it a whirl. Thanks so much for this, Chris
I assume I modify line 12 with the 'd' and put the damage there?
Missing a let
Can you tell me what exactly it's doing so I know?

