#MidiQOL
1 messages · Page 61 of 1
Well after all that, mine is mostly honeybadger's since I don't have the spell compendium that Chris uses
const buttonData = {
buttons: [{
label: 'Zombie',
value: {
actor: { name: "Zombie" },
}
}, {
label: 'Skeleton',
value: {
actor: { name: "Skeleton" },
}
}
], title: 'Which type of Undead?'
};
let dialog = await warpgate.buttonDialog(buttonData);
const [spawn] = await warpgate.spawn(dialog);
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
when he references a spell compendium thats cause hes mutating in an existing item, you just gotta replace that pack id with wherever your mutate item is stored, usually nowadays we all have a macro.createitem compendium that we're all pointing to
I think he does that so he doesn't need to put the full synthetic item in the macro
I really need to clean up my compendiums...
I've already done that, but my messy spot, is the folder macros and root directory of data, cause my players are soooo bad
I can barely get mine to write in their journals
(with my newest linked macro version
do I need to put in that weird line to precache the image since its a wildcard?
await Promise.all(imgs.map(i => loadTexture(i)));?
Or is it the name: that is wrong?
is auras just broken that it sometimes just applies an effect twice when a spell is used? lol
Unless I'm reading it wrong, your original script just passed a string to spawn, and your dialog is passing an object
no the problem is that active auras can run without midi, and they both do the same thing in some cases, so when you get duplicates, it can either be that issue, or you are on the newest ddnd5e 2.1.x and dae has a duplicate bug tthat is insidious.
when you are creating an aura out of a template with active auras, you need to use the aa helpers macro that you canf ind on any of the premades in the active auras compendium(don't use the macro compendium one), and set the activation condition to FALSE and check the box at the bottom of the item
oooh thank you, I'll give that a try
if you have not done anything with activation conditions yet:
at the very bottom of the workflow tab set these to my settings
the two drop downs at the very bottom
Pretty much this. No point embedding the item data when I already have a compendium for macro.createItem things.
however you could do all of this and still get duplicate effects because dnd5e 2.1.x has a glitch with dae atm where dae duplicates effects
Would I use the Midi DR flag to add resistance on an effect or is there a different way?
DR is damage reduction
dr is damage resistance
Reduction or resistance?
Resistance
Resistance is a core flag
Damage reduction would be stones endurance or heavy armor master
Damage resistance would be things like rage for bludgeoning/piercing/slashing
Ah yep! I found it, autofill didn't show me it i had to fill it in a little more mb
log out dialog after the buttonDialog call -- keeping in mind that spawn expects a String
is it the space before name in the macro?
wait a minute
its the name: isn't it
cause when I normally use warpgate I just call its name
cept that its not working still after testing I dunno prolly cause i deleted too much:
const buttonData = {
buttons: [{
label: 'Zombie',
value: "Zombie"
}, {
label: 'Skeleton',
value: "Skeleton" }
], title: 'Which type of Undead?'
};
let dialog = await warpgate.buttonDialog(buttonData);
console.log(dialog)
const [spawn] = await warpgate.spawn(dialog);
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
I removed spaces around it, was that wrong?
One of these days you'll just start using warpgate dialogs. It's super simple to setup.
I generally just copy everyone else lol
Or use my helper function that dumbs it down even more
Why not just 'value: "Zombie"'
actually before I do do that...was one of my issues that there was a rogue comma after both of them?
value: { actor: {"Zombie"}} should be value: "Zombie". Same for skelly
Not sure about the ,. In Rust that sort of thing is expected
Ok now my problem is its only summoning one
Anything comma separated doesn't need a comma after the last item
do I need to await the sequences?
Most code editors should yell at you about it
I just see one spawn and two misty step animations
its called in the sequence
Oh...
each sequence
My guess is I need to await them but I'm gonna go find my dancing lights macro and see if that solves it
const buttonData = {
buttons: [{
label: 'Zombie',
value: "Zombie"
}, {
label: 'Skeleton',
value: "Skeleton" }
], title: 'Which type of Undead?'
};
let dialog = await warpgate.buttonDialog(buttonData);
console.log(dialog)
const [spawn] = await warpgate.spawn(dialog, {}, {}, {duplicates: 2});
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
However if I remember right, this won't do 2 crosshairs
Time to consult the wiki
Wouldn't that one get you 4?
Cool! @violet meadow almost got it working with me privately. I'm at a convention this weekend so I won't have a much chances until Monday to test it on my system. I guess I could give you coDM privileges in my game though.
good catch
I'd have to drop a sequence
I genuinely don't know whats wrong here then but I am just noticing theres an animate dead in the wiki
(which is the bad midi srd macro)
how would I scale this:
Level:amount
3:2
4:4
5:6
7:8
I find this impossible to scale
Steal from that line
the warpgate wiki uses this equation but that seems wrong to me:
const number = (level - 3)*2 + 1;
wouldn't that be 1 at level 3?
pemdas tells me that parenthesis are done before multiplication unless its different in JS?
Yeah, that's not right
i have no idea what spell you are reading 😅
At Higher Levels: When you cast this spell using a spell slot of 4th level or higher, you animate or reassert control over two additional Undead creatures for each slot above 3rd. Each of the creatures must come from a different corpse or pile of bones.
This spell creates an undead servant. Choose a pile of bones or a corpse of a Medium or Small humanoid within range. Your spell imbues the target with a foul mimicry of life, raising it as an undead
smh 😴 lol
and that means the wiki's equation would be easier to run
just define it and plop it into the duplicates
although
const level = await warpgate.dnd5e.rollItem(item);
is that a v10 useable line?
What does duplicates 1 do? Make one or make 1 duplicate meaning 2?
can't we get the level from like @item.level since its an on use macro?
or @spellLevel
I hope its 1 and not an error lol
but 2 got me 2 fwiw
If this is an ItemMacro just set it to run after the spell level has been determined already
yeah running it after active effects to be safest
pretty sure item macro lets me use @spellLevel
const spellLevel = this.castData.castLevel;
nope
const level = (@spellLevel - 3)*2 + 1; is no bueno
I will just copy the macro lol
const buttonData = {
buttons: [{
label: "Skeleton",
value: {
token: {
name: "Skeleton",
//img: 'assets/tokens/withka_skeleton.webp'
},
actor: {
name: "Skeleton",
//img: 'assets/tokens/withka_skeleton.webp',
}
}
},{
label: "Zombie",
value: {
token: {
name: "Zombie",
//img: 'assets/tokens/vithka_zombie.webp',
},
actor: {
name: "Zombie",
//img: 'assets/tokens/vithka_zombie.webp',
}
}
}]
}
const level = await warpgate.dnd5e.rollItem(item);
const number = (level - 3)*2 + 1;
for(let i = 0; i < number; i++){
buttonData.title = `Animating which type? (${i+1} of ${number})`;
const choice = await warpgate.buttonDialog(buttonData);
if (choice === true) return;
const [spawn] = await warpgate.spawn(choice.actor.name, choice);
}
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
This causes an endless loop, I think I am about to just call it and say fuck it to using animations on this spell.
actually its not my animation causing the endless loop, I guess the warpgate wiki animate dead is not midi friendly
Get the spell levl with the code I linked above. That's from midi
got it
Animate Dead
Midiqol
DAE
Warpgate
Sequencer
Item Macro
const buttonData = {
buttons: [{
label: "Skeleton",
value: {
token: {
name: "Skeleton",
//img: 'assets/tokens/withka_skeleton.webp'
},
actor: {
name: "Skeleton",
//img: 'assets/tokens/withka_skeleton.webp',
}
}
},{
label: "Zombie",
value: {
token: {
name: "Zombie",
//img: 'assets/tokens/vithka_zombie.webp',
},
actor: {
name: "Zombie",
//img: 'assets/tokens/vithka_zombie.webp',
}
}
}]
}
const level = args[0].spellLevel;
const number = (level - 3)*2 + 1;
for(let i = 0; i < number; i++){
buttonData.title = `Animating which type? (${i+1} of ${number})`;
const choice = await warpgate.buttonDialog(buttonData);
if (!choice) return;
const [spawn] = await warpgate.spawn(choice.actor.name, choice);
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
}
Args saved the day
But your loop seems off. I'm not sure what choice === true is supposed to be doing. You'll just exit the whole macro. Then you are redfining a const i times
I think it works as a button macro but when its in a midi on use shit hits the fan
some of the warpgate wiki is meant to be a button macro
I feel like it should be if (!choice) return
Since that means the dialog was closed without a selection
also spawn should not even be accessible outside of that loop
yeah I'm seeing the weird shit now I dunno why its working fine now
Ahh, If you want the misty step put it inside the loop
The real question is why you aren't just using Arbron's Summoning or something
I have edited it now and it has animation and looks to be fine
I don't see the point in adding a module that does only half of what I need
if I have to make it a macro anyway for animation, why bother with arbron summoning
fair enough
automated evocations is not to my liking either, it does both but its not one click like a macro is
https://github.com/p4535992/foundryvtt-automated-evocations-variant
This module has an API so you can do summons with animations without the player having to select the animation
This is the one I personally use for my summons if it's not something Crimic already has
Most of the time, summons are pretty simple
I can usually pull them off as 1-2 lines unless they are scaling off the summoner
1 warpgate line, 1 sequencer
I haven't tackled summons yet. My players haven't picked spells that require it yet
When my players long rest I usually will double check their prepared spells and fix/automate them since it will be 2-3 months before they get to long rest again lol
Running Sandy Petersen's Mythos for 5e, so one of my players is the cat familiar of another wizard player. Yes that gets weird
again, I dunno why, but my games take soooo long ot progress through an adventuring day
yeah the players are loving it so it isn't a bad thing generally but my gosh they will be level 20's facing the 9th floor at this pace
Bit surprised you aren't doing milestone for that module
Since you can pretty much tie it to the floor
I like Lovecraftian stuff, but a few of my players couldn't handle your character will either die or go insane and become the villain, so this is the next best thing
even if I did milestone, theres 24 floors, and they started at level 7 cause I dragged out dragonheist 2 extra levels
I'm doing just creature exp, and then they get a bonus each long rest based on their faction level(aka points) with halaster(using companion)
the party gained 2 points on 2nd and 3rd floors, but then they pissed him off with their shennanigans in skullport so they are back to 1
Its fun, I have them complete tasks for a different simalcrum personality of him for each floor and I have fun rp'ing the different versions. 2 was a gameshow host with a suit and tie, 3 was a ravaged strungout angry damage dsimulacrum, and 4 is a Catholic Priest looking Simulacrum lol.
I rp'ed the damaged one like the guy from Its always sunny in philly lol
https://github.com/chrisk123999/foundry-macros/blob/main/Mechanics/DMG Cleave/Chris-Cleaver.js
New version of the cleaver macro. With dialog rendering changes by @coarse mesa (Although I touched it up a little bit).
This is some top quality stuff, so good Its almost worth using even if you don't do homebrew lol
I’m gonna have to talk our table into using this rule now
Updated my Magical Inspiration dialog to have these changes as well:
https://github.com/chrisk123999/foundry-macros/blob/main/Features/Class Features/Bard/Magical Inspiration/Chris-MagicalInspiration.js
Its sooo smooth
It would be super easy to make it Anonymous friendly… idk about CUB tho
I already did for Moto
Yeah I have it say Target instead
I love the ping and the mouse over, it looks like professionally done video game quality lol
This might actually reveal hidden tokens, depending if midi includes them in a findNearby
I honestly would rule its possible
when you cleave, your swing is going through someone so if that invisible creature is in the arc, sucks to be them
I bet you "NoTarget" would be safe from it
most of my gm hidden stuff that stays hidden is NoTarget
actually I can test NoTarget lol
yep, NoTarget Race type is ignored by cleave
interesting
Its a midi thing I believe
Midi tells all its stuff to ignore NoTarget in race/creature type
it does target GM hidden, and invisible
but thats not an issue for me
yea same
the only dude who sits hidden in a combat encounter is my avatar who is a NoTarget
Oh well, GMs should know better then to have a hidden token in the middle of combat
I only put him on the map as a token cause i have dotmm stuff that I fire off him occasionally
I learned to put NoTarget on him cause one time he got caught in a cone of cold
was when I was freshly v10, the target settings were fubarred and set to go through walls and the padding wall
That feels creepy for some reason
I require some help, whenever I activate MidiQOL I can't alter MaxHP
I have successfully made it so that a TMFX macro applies to a target when hit, but how can I make the TMFX automatically clear upon another trigger such as being attacked?
you should not alter max hp nor current hp, or even temp hp with an active effect. Must use macros or the overtime flag or effect macros.
change the flag to macro.tokenmagic
if you want a custom filter for it, use mass edit to make a new filter and save it as a preset so its an option in macro.tokenmagic
Max HP AEs are OK, but they do cause the input field to be locked, so they have to be disabled before manual adjustment. For a short term effect like Aid, its handy, but not for permanent or long term changes
for us, in midi, Aid is handled by a premade that doesn't use an active effect, its a macro that actually mods the actual max hp instead of tempmax oddly enough.
the main reason why its a macro is because aid also heals for the same amount so its just easier to do both in a macro I think
also if its things like tough or draconic origin, its better done manually just cause its always on.
right, yea, the current HP makes sense -- just pointing out that it is a valid option in come cases to modify max HP with an AE
(but often leads to this "locked field" confusion)
I had an effect macro made to adjust hp
On Creation
const {value, max} = actor.system.attributes.hp;
const v = Math.round(value * 1.4);
const t = Math.round(max * 0.4);
await actor.update({"system.attributes.hp": {value: v, tempmax: t}});
On Deletion:
const revertMax = actor.system.attributes.hp.max
await actor.update({"system.attributes.hp": {value: revertMax, tempmax: 0}});
I think you want hp.override now 🤔
Oh no I was thinking of something different
im a bit behind the times i guess -- i'd listen to zhell....as I see them spamming PRs and fixes on dnd5e repo 😉
You really don't want to touch hp for max if you like your hp level up automation
Well you know, I was mildly inconvenienced
And something was grammatically incorrect and
huh... an effect modifying system.attributes.hp.max just plain ol' does not work
it disables the input field, but does nothing more than that

I don't really know why Aid targets the max field instead of tempmax, its probably really easy to fix though
Is the "Midi SRD" module obsolete in v10 now?
There is a fork by thelonelybugbear for it that I use
What does fork mean?
Is it possible for someone to pin the midi srd for v10?
Its a code repository term. Means you took the base version and are working on your own version of it.
@sand agate not a bad idea. Also the list of midi-incompatible modules would help, Moto posts that a few times a day
Give me an actual post you want pinned, and I can pin it. 🙂
i dunno how good of an idea it is to pin an unpublished module 🤔
That's what's being asked?
an unofficial fork of a published module
yeahhhhhh
v10 compatible fork of Midi-SRD, maintained by @violet meadow https://raw.githubusercontent.com/thatlonelybugbear/midi-srd/master/module.json
I think we'll wait for that to be merged.
Hang on that needs more explanation lol
Well, it’s been around for months and referred to incessantly
and should be officially submitted or the project transferred
It’s about as official as we’re gonna get until K comes back
We’ll have to ask @violet meadow about that – I think he’s been in touch with Kandashi over it
soon as we can point to a foundry package listing, it'll be pinned
Fair enough, folk must be getting tired of explaining about it… especially Moto. Although it does give him something to keep himself busy with
not hard to correct it 🙂 I hope you understand why we would not want to push non-foundry approved packages 🙏
Yeah sure, although we all know bugbears credentials by now
Anyway, Mr Primate and Kaelad got the reins for a couple of K’s modules so I’m sure it’s possible
Getting through to the package repo is an extra step of vetting that grants us comfort in the promotion.
If bugbear can pull that off most of the issues will dissipate anyway, so yeah best course of action. He’ll just need to bite that bullet
Mr.Primate can solve this without any issues I feel
No need to ask bugbear or the mods here, Bugbear just needs to chat with Mr.Primate I think.
Also hes only working on it out of the kindness to the community, its really tedious to fix that module I think
I'm slowly digging into it to give him fixes but I'm no where near complete on it.
Midi SRD is pretty huge
@dark canopy Pretty sure Mr.Primate has a direct communication with Kandashi so he can get it squared away.
Per stuff said on another discord
ah, mmk, doesnt really matter who. 🙂
I can't speak for bugbear but I imagine he probably wants to put more work into midi srd, theres still quite a few blatant dead items in it, we can edit the midi file, but the individual items are pretty much at issue at this point.
I'm attempting to recreate some functionality of the Gryphon's Saddlebag's Alchemist's flamethrower by creating an ability for it that, when used, deletes a single alchemist's fire from its wielder's inventory, and gives the flamethrower 50 charges, up to its maximum charges of 100.
Does anyone know how that'd work, if there are any examples I can use, or if there's an easier way to achieve this?
I have an on use macro that fills another items charges if you want that
That could work!
const otherItem = actor.items.getName("(Snack Buff)Wolf Spleen Turnover");
const {value, max} = otherItem.getRollData().item.uses;
const {total} = await item.rollFormula();
const toAdd = Math.ceil(total/5);
await otherItem.update({"data.uses": {value: value + toAdd}});
Prolly just need first and last lines.
I think that data is needed in this macro, someone will correct me I think, I don't see a compatibility warning with this macro
I'd just need some code that deletes one of a specific item.
make alchemist fire have charges and destroy on empty
then you can use the above on it
hell you might even be able to pull off guessing what quantity is on an item, my first guess would be data.quantity lol
but you could also find the data in the console
Hm. Doesn't seem to work as an Item Macro :<
did you forget to change the name of the item you are defining?
it very definitely does for me
in the first line, you need to define the other items name
const otherItem = actor.items.getName("Alchemist's Flamethrower");
const {value, max} = otherItem.getRollData().item.uses;
const {total} = await item.rollFormula();
const toAdd = 50;
await otherItem.update({"data.uses": {value: value + toAdd}});```
nope I don't think you want the value, max, and total
pretty sure you want line 1 and 5, and in 5 you put the 50 where toAdd is
My item rolls and takes the roll and does math
if your item doesn't roll a d20 thats probably the fail
I don't think you need to define toAdd cause yours is just an integer, mine was a math function so it needed to be defined
expanded whatever I'm not a js pro
also you probably want this macro twice
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
await itemOne.update({"data.uses": {value: value + 50}});
await itemTwo.update({"data.uses": {value: value - 1}});
you could fiddle with shit and find out what quantity is and update that instead on the alchemist fire but I dunno if zzero quantity deletes the item.
if you set alchemist fire to destroy on empty, that should.
wait we need to define value
that one I'm not sure of
gonna need to phone a guru here cause you need value to be useable by both items
or define itemOneValue and itemTwoValue
their defintions will be that second line I think
only replace otherItem with their values
can someone help me set up adamantine armor?
the critical flags don't seem to work
could have sworn this was automated in midi srd but I always mix up the flags for it
in the midiqol it says flags.midi-qol.fail.critical.all
but this applies to attackers
which would bog down the server too much
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
const valueOne = itemOne.getRollData().item.uses;
const valueTwo = itemTwo.getRollData().item.uses;
await itemOne.update({"system.uses": {value: valueOne + 50}});
await itemTwo.update({"system.uses": {value: valueTwo - 1}});```

Isn't there a simpler 'doesn't receive crits' option?
I don't understand what you are asking, you are asking for that flag but then saying is there something that doesn't do that flag
why does a flag bog down your server?
thats not how flags work
Adamantine armor prevents criticals from working against the wearer, that is what that specific flag does
do you mean an adamantine weapon?
oooh I bet you this is probably your issue really:
Midi does not work with:
Ready Set Roll
Better Rolls for 5e
Roll Groups
Fast Rolling by Default
Fast Rolls or Quick Rolls
Dice Tooltips
Taragnor's Gm Paranoia
WIRE(Whistler's Item Rolls Extended)
Minimal Roll Enhancements
Retroactive Advantage/Disadvantage
Max Crit
Multiattack 5e
Advanced Spell Effects module is in beta in v10 and often the culprit of things...
oh I thought it was like elemental adepts
giving an AE to targets every time
it works fine without adding unnecessary AEs uvu
thank
nope its a flag you put on the armor and then it prevents all attackers from clickign crit, for non fast forward users, they can still hit crit so beware of that
dang
I wonder if someone has coded the Drakewarden's Drake Companion
to like, pick the damage type from a query or something
I don't think that one is worth automating
draconic spirit is, cause its a spell, but the drake warden companion rolls hit dice
its best made to be a player character and give it the same amount of ranger levels as the player has and just level it up that way
you can do a simple warpgate/sequencer macro to spawn it, but I wouldn't use the scaling stuff on him since hes permenant
well, semi permenant
oh I don't mean
that
I mean automating what type of damage is chosen for it
or have like a macro that switches all of them
make 5 attacks on one actor and then use warpgate to delete the other 4 but thats going to be a dialog that gives me nightmares just thinking about
(or just leave the attacks)
make its reaction be a mirror of like magic missile where it deals straight damage with an other type roll
it can't automate anyway cause its a third party reaction
Can probably copy how chromatic orb works
My draconic spirit doesn't get more janky manual than anything lol
Dialogue box that has you pick the damage type
Integrate your dndbeyond.com content into Foundry virtual tabletop - ddb-importer/chromaticOrb.js at main · MrPrimate/ddb-importer
in regards to foundry forcing us to make attack rolls before damage rolls.. is there other settings than just this one?
the problem with that is that the damage type also influences the dragon's and its owner's damage resistance
Would be easy to adjust for your needs
also needs to apply shared resistance
I gave janner that macro a while back, shared it in a DM
You get this sorted?
Still trying to figure it out
It looks like your item uses might not be an integer
if (class === barbarian)
let classHeal = (args[0]spellLevel)d12
is this right?
Right for what?
Yeah. I'm still trying to figure how how to change that. xD
Log out the input and see what type it is
for syntax, I'm trying to automate the heal in Wither and Bloom ignroing the hit dice cost cause I'm ruling the spell not rules as written for our group
It's likely solved with a toInt
I tried looking out the inputs. I didn't get anything back
You can get the hit dice size from the classes object
actor.system.class?
Then it's likely your adding a number to undefined
Yep
It has a quantity of 3. 1 charge each. Destroy on empty
then I think your issue is you are defining the wrong thing in line 3 and 4
@vast bane you're likely wanting to combine strings
instead log out those items and get the acual path to the item uses
Should be like 'string' + 'd12'
you need that console command to call an item in the sidebar by its name to get its data in console
the class decides the size of the die, the castData decides the number of dice, and I need to use the con mod of the target as well
Roll the item once with 'console.log(this) at the top of the macro
Find the data you need from that output
can someone remind me where to find presets for Active Token Effects? .3. I know there were more than a few MidiQOL compatible ones
oof thats a lil iffy, ate is in a weird spot, I don't know if the presets are workin right
console.log(valueOne)
console.log(valueTwo)
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
const valueOne = itemOne.getRollData().item.uses;
const valueTwo = itemTwo.getRollData().item.uses;
await itemOne.update({"system.uses": {value: valueOne + 50}});
await itemTwo.update({"system.uses": {value: valueTwo - 1}});```
if you mean just the keys, the light keys should all work with DAE auto complete
just wanna program Nightvision Goggles
so no light, just vision o3o
the vision keys require the cheat sheet:
https://github.com/MaxPat931/Macros/blob/main/QuickReference.md
let conMod = this.targets.first().actor.system.attribures.con.mod
omg can I do that line with their hit die too??
Yep
bookmarks
Although you'll need to loop over their classes
max and kaelad gonna slap me cause they have an official one thats updated better but I never update my bookmark lol
ATL.sight.visionMode.darkvision?
:0
till tim and kaelad get together and flesh out the new vision keys in dae
if you have adequate vision, I think you don't even need to use ATL keys, just add the trait
there's ATL brightsight and dimsight :1
don't use auto complete, type exactly what I show
ATL.sight.range
ATL.sight.visionMode
okie
its cause the keys changed, and ATE is kandashi's module, he is on hiatus so theres weird issues getting updates dealt with specially onesbetween authors
welcome to ATE's wildcard bug
you need to not use wildcards sadly
kealad is working on a solution to this but till then, you have to live with it
TVA makes it less painful
I'm not sure what to do. It pops that error out at me and doesn't log any outputs.
#1010273821401555087 message
but isn't token variant art broken now?
um, I doubt aedif's modules are broken, but I'm on a stable build so /shrug
dnd5e 2.1.x /shrug
once it mystery mans, just reset the image with TVA
TVA is the workaround for this, caus eyou should see all the images in TVA's button to reset it
(or use adequate vision but its not going to solve all the other ATL keys)
I'm using perfect vis. I think
The error says that you try to access the valueOne variable before you declare it.
And that’s true. Look where you log it and where do you declare it with const valueOne
faerie fire and enlarge/reduce is always going to mystery man your wildcard tokens, but kaelad is working on this, its very definitely on his radar
and ye I can reset it using the TVA interface
if you are on kandashi's server kaelad is working on figuring out the mystery man bug
soon™️
that's fine I'll just remove the variants from my PCs
none of them are usin' em rn
or just utilize TVA to manually fix shrugs, either works
does it still mystery man if u don't have a wildcard set?
I actually kinda wish that Aedif could make the default wildcard flagged in the list
I might feature request that
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
const valueOne = itemOne.getRollData().item.uses;
console.log(valueOne)
const valueTwo = itemTwo.getRollData().item.uses;
console.log(valueTwo)
await itemOne.update({"system.uses": {value: valueOne + 50}});
await itemTwo.update({"system.uses": {value: valueTwo - 1}});```
Okay, looks like it's struggling to find the charges of the flamethrower?
it is purely a wildcard only issue, its cause somewhere in ATL's code it puts the path with the * in and doesn't resolve the wildcard again
does the flamethrower have charges?
Ah, nevermind.
You are accessing the Uses object. You need the actual value
Aye, I fixed that up
So newValue.value
is this a dnd5e 2.1 thing, am I really gonna have to go through this malarky with my macro which he started with?
I set a default token and it still does mystery man
:c
is the actor unlinked, are you still using the old canvas actor?
the darkvision feature I shared to you is on an actor, so it clearly does not cause mystery man...in 2.0.3 dnd5e.
my guess would be that you updated the proto token, and the existing canvas token did not update, pro tip, use mass edit for stuf like this cause mass edit lets you update all tokens
or you edited the canvas actors token, and ATL is weird it yoinks the sidebar actors data I think
so drag out a new sidebar actor and test
(with the proto token adjusted)
So I'd need something like this?
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
const {valueOne, max} = itemOne.getRollData().item.uses;
const {valueTwo, max} = itemTwo.getRollData().item.uses;
await itemOne.update({"system.uses": {value: valueOne + 50}});
await itemTwo.update({"system.uses": {value: valueTwo - 1}});```
found a workaround
Aye, just trying to figure that out now
You need 3 and 4 to be different slightly and then 5 and 6 need updated value's
I feel like getRollData is not something you need to use, if you just logged out the items, you should know the path to their item.uses
in the above snippet, what were the 3-4 arrows you expanded to get to value on each item
what really confuses the hell out of me is that MY macro uses data in line 6 instead of system, and I get no shim warning
Okay, I think I'm making some progress.
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
await itemOne.update({"system.uses": {value: + 50, max: 100}});
await itemTwo.update({"system.uses": {value: - 1, max: 1}});```
This sets the flamethrower charges to 50 instead of *adding* 50.
It also sets the charges of the alchemist's fire to 0, but doesn't delete any when emptied. I might have to find the quantity data and modify that instead.
this is because you are not defining its current value
pretty sure update is basically the same as override
Damnit
so if you don't have originalvalue+50 then it will just be 50 after that macro fires
and the alchemist fire works cause the field can't be negative so it turns to 0 and then destroys itself
I don't think you want to set a max for alchemist fire
You just want to decrement its uses
(same with the flamethrower)
Yeah
you also need to remedy going over the limit for the flamethrower
if he reloads at 75 charges does it become 125/100?
I dunno if it fixes itself in that case

I feel like you had the solution in that snippet above you just didn't use it
when you expanded to find the values in that snippet, the prior 2 expansions were the things that you should have put in place of getRollData
then you'd have the values defined
it could be as simple as itemOne.system.uses.value
const itemOneValue = itemOne.system.uses.value
then itemOneValue + 50
repeat for item two as well
it may even be itemOne.uses.value
you'd know if you went back into the console with that snippet above for sure
The code I put was the exact one I was trying to have you run. (Without the bad autocorrect on console)
const itemOne = actor.items.getName("Alchemist's Flamethrower");
const itemTwo = actor.items.getName("Alchemist's Fire");
const itemOneValue = itemOne.system.uses.value
const itemTwoValue = itemTwo.system.quantity
await itemOne.update({"system.uses": {value: Math.min(100, itemOneValue + 50)}});
await itemTwo.update({"system.quantity": itemTwoValue - 1});```
Okay, I think I have quantity reduction working, and also it now *adds* 50 charges.
Only trouble is deleting the last Alchhemist's Fire when the quantity reaches 1, and limiting the maximum charges on the flamethrower to 100. Maybe adding an error and notification when there's no Alchemist's Fire to reload with, and when an Alchemist's Fire is put into the Flamethhrower.
Worked like a charm
Ok my turn!
const item = token.actor.items.getName("Wither and Bloom Heal")
const {castLevel} = effect.flags["midi-qol"].castData;
const actorHD = actor._classes.system.hitDice.???
const actorCon = actor.system.abilities.con.mod
if (castLevel > 1) {
let newItem = duplicate(item.system)
newItem.damage.parts[0][0] = `(${castLevel}-1)d${actorHD} + ${actorCon} + 5`
await item.update({'system.damage.parts': newItem.damage.parts})
}
What should line 3 have at the end?
also does line 3 have a naughty underscore?
this is an effect macro, so actor is defined as the owner of the effect
I'd take this to macro polo but it has midiqol in it
even though I feel its not utilizing any of it at all
Could you scroll down more on the classes output?
There should be a hit dice left variable
Also don't use _classes
There is a .classes further down, you'll need to expand it
Might be able to steal some lines from this
Bit dated macro however. There are some parts I would do differently now
@covert mason Math.min(100, itemOneValue + 50) to cap it to 100
yeah macro polo just squared me away.
My last wither and bloom issue is I need to roll an item by its name as an on use macro and I'm afraid to ask macro polo due to the fact I know they've told me in the past but I can't find when I used it.
the macro on use would literally be
Find item
Use Item
but I also need it to have a pause so like....
wait 200 useitem
I can throw together a wither and bloom macro tonight
I'm actually 99.9% done
Perfect! ❤️
Thank you
I actually got it working I just don't have the two parter combined into 1 roll
I have wither and bloom setup as a self buff to give the heal item, and an aoe damage as well. The heal I need to have auto roll when the damage rolls, but I don't know how to put an item roll in item macro
well, I know the janky way, by dragging it to the hotbar, but that implies that the actor is selected or the assigned actor, I want to prevent any hiccups by using the legit item roll syntax
item.roll() ?
would the name of the item be in the parenthesis?
Nope
also wasn't roll deprecated in v10 for use?
actor.items.getName('Item Name').roll()
Not for this one
You can do item.use() they both do the same thing
bugbear uses some nifty things where he changes the setting for an item, like foundry utils or something. Is there a way to make an item use late targeting?
Copy what they do I suppose
I've never messed with late targeting
Just easier to pass the targets
man this spell would be 10x easier if I rewrote it to be that the heal target is the origin and then I can just use findnearby
https://github.com/chrisk123999/foundry-macros/blob/main/Mechanics/DMG Cleave/Chris-Cleaver.js#L162
This is how I do it with items in macros.
Line 172
This is for wither and bloom right?
Doesn't it use the targets hit dice?
yeah but my wither and bloom our table agreed needed to change, it no longer expends hit dice, its a damage and heal for just a spell slot
otherwise the spells kinda shitty
@vast bane Loop over the classes object and count the hit dice available.
nah I gave up, its getting a straight heal
I have 1 multiclass player
badger showed me the drawbacks of calling the classes hd
I also make the mistake of using effect macros actor when I need to use args
let hitDice = {
'd6': 0,
'd8': 0,
'd10': 0,
'd12': 0
};
let classes = actor.classes;
for (let [key, value] of Object.entries(classes)) {
hitDice[value.system.hitDice] += value.system.levels - value.system.hitDiceUsed;
}```
This will get you all object with all the available hit dice
I think I'm just gonna rewrite it to be a heal that is (level - 1)d10 + (@details.level / 2)
I'm walkin away from this one, I thought I was so close only to have it fail at the finish line
I have 90% of the work done for you ¯_(ツ)_/¯
Just had a really cool rewrite idea for Wither and Bloom but its still to complicated lol. I was thinking have it deal damage in a template and then take half that damage and apply it as a heal to all allies in the template
How do I write a macro that shocks the player(not the character) the third time they cast silvery barbs in under 10 minutes?
Could have it increment a resource then roll damage on the 3rd time
The logic is fine, just delivering the shock over the internet to his mouse isn't working out
I should have known it was going to be a problem when he asked if I had banned the spell
#tabletop-discussion probably better spot for that discussion
const item = token.actor.items.getName("Wither and Bloom Heal")
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 1) {
let newItem = duplicate(item.system)
newItem.damage.parts[0][0] = `(${castLevel}-1)d10 + 10`
await item.update({'system.damage.parts': newItem.damage.parts})
}
This macro is failing to update the item, and I suspect its because my world is laggy right now and the item is created seconds later.
I don't see a spelling error do you?
is it the [0][0] thing thats failing it?
Formatting is hard to tell on mobile
But I think you're doing too much in one line
Duplicate it
Then edit the duplicated part
Missing a ; I think
I honestly dont know why its not working it works for my others
On the newItem line
🤦♂️
I pulled this from the original, which is a bugbear macro:
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})
}
and it seems to work with every other item I've done with this bottom half
Hard to tell on mobile
It puts new lines in that spot
To me it looks like it should have a ; there
can macro.whatevers in DAE have an extra argument for macropass?
even if they aren't item macros?
could I add the extra argument of preitemroll after the uuid on a createitem?
I know you can add , permenant to them
Are you trying to store the cast level to the item?
I'm trying to diagnose why its not updating for this item and my server is soooo laggy right now that I think its the timing
the item always appears really late and reallly slowly
You're missing a ; almost guaranteed
my mistake was leaving in the const lines that were broken, it wouldn't finish the rest of the macro
God this has broken like 10 items now realizing this
I don't even know how to fix all this shit, this drives me nuts
The only one of these items that works now is this one:
let i = 0
while (!token.actor.items.getName("Scorching Rays") && i < 3000) {
console.log("Waiting for Scorching Rays item to be created, if needed!")
await warpgate.wait(250)
i += 250
}
const item = token.actor.items.getName("Scorching Rays")
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 2) await item.update({'system.uses.value':castLevel+1,'system.uses.max':castLevel+1,'system.uses.per':'charges'})
this ones waiting so thats what I think the problem is
so of the 30ish macro.createitems I have done, none of them upcast and i've never caught this problem, and my macro I based them all off of is the culprit.
the only one that properly upcasts is this one cause it waits
const item = token.actor.items.getName("Wither and Bloom Heal");
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 1) {
let newItem = duplicate(item.system);
newItem.damage.parts[0][0] = `(${castLevel}-1)d10 + 10`;
await item.update({'system.damage.parts': newItem.damage.parts});
}
Try that
If this an effect macro?
it is an effect macro, my problem is that its killed 30 items so I'm going back through, I have to add that wait function in too
I'm not sure if the effect will have the castData flag
mass edit? I'm not sure what you mean by that
its hard to explain honestly, aedif made a macro that lets you save and edit with a UI for tokenmagicFX. The problem is its a macro he shared to me and I have no idea what module its from
I'm pretty sure it requires mass edit installed to run, but I dunno if its included with Token Variant Art module or Mass edit module or both /shrug
This is the macro, but its an exported json fyi so import it to your folder macros.
It has a hard requirement of the module Mass Edit
this is the easiest way to make a custom tokenmagic FX
otherwise you are stuck with whatever macro.tokenmagic gives you
So I have to install Mass Edit. Then I can make this macro and use it to create a new TMFX?
yeah but the macros user interface is a lil wonky
its not exactly tooltip and help ready
Then it's a good thing I'm doing this in my test world
I think you change what you want and then check every box and hit apply changes, and then it asks you if you want to make a preset
I don't think you want to just check the changed lines, you want all lines when saving a preset
I'm unsure how having the custom TMFX will help in having it turn off when attacked though
That was my original question
because you were using a macro to apply a custom tmfx
they dont toggle
only macro.tokenmagic toggles
when you use macro.execute it just fires the macro and leaves it
and macro.tokenmagic only gives you the basic defaults for all the tmfx animations
I assume your macro was customized and not a default
All of my custom ones are at the bottom of this list, made with mass edit(the macro I just shared)
fascinating
Taking your changes and adding in the wait time has solved it, but I have to go through 30ish items and fix them all blegh.
let i = 0
while (!token.actor.items.getName("Healing Spirit Heal") && i < 3000) {
console.log("Waiting for Healing Spirit Heal item to be created, if needed!")
await warpgate.wait(250)
i += 250
}
const item = token.actor.items.getName("Healing Spirit Heal");
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 3) {
let newItem = duplicate(item.system);
newItem.damage.parts[0][0] = `(${castLevel} - 1)d6`;
await item.update({'system.damage.parts': newItem.damage.parts});
}
this is what I get for not testing upcasting
I would just warpgate the feature when it needs upcasting. Waiting for an item to be created just to edit it after is a bit janky
Can just add the item with the upcast stuff pre-adjusted
I work with what is shown to me, plus macro.createitem is something I can understand fully
besides, I'd have to go through all this process again just with another modules api, I'm already up the mountain might as well stick with it
Is there a neat way to at least have the on crit force save part work? I'm not too fussed on automating the banish part
Doable with an on use macro for sure
Maybe with an activation condition, but I'm not as familiar with those
Yeah I tried fiddling with activation conditions but i'm not entirely familiar with how that works or macros tbh
Quick and dirty way would be to make a feature with those effects
how do you download json's from github, specifically I'm trying to reget potion of poison from your github Chris and everytime I save as, it gives me a json that isn't working with foundry import
guess I could copy the raw and save as a json
weird, worked when I manually copied the data
Click raw, then save as
heh, I just clicked raw, copied it all to np++ and saved it there
Make sure your computer isn't accidentally making it a text file
funny thing though, when I did that and imported, I then found MY copy of it lol
I forgot I named it Potion of Healing(Poison) like you did lol
so when I searched for Potion of Poison and never found it, yeah...
I think I will call it Potion of Poison in the compendium for now on lol
or maybe I will remember this time
I could make an item macro that swaps out the item on use
Would mean all you do is add the macro name to "convert" it
Is there a way to make an overtime effect only remove itself after 3 successful saves?
The overtime thing accepts using a macro
Never used it however
I really just figure out how to do custom monks token bar requests with a macro
Hi All. I have a newbie question. How do I deal damage with damage type?
All I can find is this...but in a way it deals true damage
targetActor.update({"data.attributes.hp.value" : targetActor.data.data.attributes.hp.value - damageRoll.result})
question- about items .. i have a Dwarven Thrower .. ive had to make a a copy of it for the ranged portion of the weapon. that is working fine i can throw it at range and roll 2d8 for damage . what i am having trouble with is that agaisnt giants it is supposed to do 3d8 .. but that part is not working .. how do i get it to do that damage agaisnt a giant creature when thrown ?
I have seen a similar Giant Slayer macro. Perhaps this may help?
https://gitlab.com/crymic/foundry-vtt-macros/-/blob/8.x/5e/Equipment/Giant Slayer.js
Basically when the target is giant it add more weapon damage to it
cool so the easiest way to solve this is with a custom macro added to the weapon ?
yeah I think put it on "on use"
still learning here .. so bear with me .how would i assign it on use just add the macro name ?
Oh I am also new so I will try my best to help
I assume you have item macro module?
yes
no idea how to make use of it i was just told to get it as part of the setup i did lol
okay on the item, top left corner, there should be a "item macro" button. open it
get your macro code in it
then go to detail tab, at the bottom, there should be a "On use macro" , and a "+"
ok so i pasted the giant slayer macro in it
then go to detail tab, at the bottom, there should be a "On use macro" , and a "+"
click the plus
there should be a input field and a drop down
yes
in the input type "ItemMacro" this should link the macro to your item
oh yeah I have heard of that but not an expert
in activation condition it has this ["giant"].includes("@raceOrType") && @item.attunement !== 1
Why add the attunement part?
cause the weapon needs to be attuned to a dwarf
Yeah, so just don't give it to non-dwarves or if they do have it, remove the extra fields
Cause even if they aren't dwarven, nothing is gonna stop them from attuning to it (mechanically speaking)
Just ["giant"].includes("@raceOrType")
And put the extra damage in the other formula field
I changed the eagle to giant for this
ok made the modifications . testing now 😄
ok so when i used the other roll 3d8[bludgeoning] + @mod + 3 it rolled 8d8 instead of 3d8 lol
Show a picture of the details tab of the item
I'll check back in a few, walking my dog
ahhh nice .. thank you
think im gonna head to bed it is after 3 am here . Ill be around with more questions soon . thank you again for your help
use a midi workflow
you need to change the weapon attack to ranged
Does anyone knows how to apply the cant regain HP for X time/ What Attribute Key that would be? (Making the Weapon of Certain Death Currently work properly)
Hello does anyone know how would I go about using Effect Macro to automatically roll an item upon that item being created with Macro.createItem? Essentially Id like the macro to roll the item as soon as it is created in the actors inventor.
damage immunity to the Healing type
does the item self roll?
cause if it doesn't that shits messy
what are you trying to make gamewise before you go down a rabbithole that doesn't fit you
I am automating a feature that allows a bard to bestow an effect that allows the target to teleport 30 feet. I automated the feature being created in the targets inventory. What I would like to automate is the activation of that feature once it is created (I want the item to be rolled automatically upon creation in the actors inventory).
Isn't that a player choice feature?
the bard can give them it but they choose whether they want to move or not
you should be able to pull that off just fine it doesn't require targets
Those? and which?
that is not damage immunity, thats not even damage resistance
damage immunity can probably be found by typing .di in dae
value and then a drop down appears thanks to dae
yw
you can get the item by name and then roll it I believe
actually you don't even need to get the name
👍🏻
I think you spelled that wrong
not my 1st language gonna have to spellcheck 100 things anyways
Oh yeah, you are right. It shouldn't activate automatically since the creature can choose weather to use it or not, but it expires either way.
Chris gave me the syntax to roll an item like 8 hours ago in here but its hard to search his history cause he is 1 of 30 chris's on this server
if its misty step macro, they can right click to cancel it
might be wise to just auto run it
let me see if I can dig up chris syntax to roll an item
I think its item.roll()
So what does this do?
that should work in an effect macro cause actor is defined as the owner of the effect
you might have to put a delay in
Roll an item after macro.createitem.
let i = 0
while (!token.actor.items.getName("Item Name") && i < 3000) {
console.log("Waiting for Item Name item to be created, if needed!")
await warpgate.wait(250)
i += 250
}
actor.items.getName('Item Name').roll()
obviously swap out the blue for what you need
but you should put a delay in cause the item doesn't always appear right away
just put the linked code at the bottom of this outside the curly bracket
I'll edit it hang on
god I'm kinda scared I'm starting to catch on with this js stuff
This requires Warpgate to function?
so does misty step?
I guess? I never used Warpgate. So I can automate Misty Step with Warpgate aswell? Make it so the player can like teleport within the spell template or something?
Yes
(also EM isn't a midi module (it's mine), questions about it don't need to go here)
item.use
(.roll is deprecated)
only midi is a midi module
the rest are like everything else in foundry modules that work well together
@vast bane did you solve the issue you had? I saw quite a few messages but didn't go through 😄
I think I'm good, its game day so I can't change anything now
You are using the DAE method macro.createItem to create it, right?
The macro was intended to fix issues when using THIS method and upcasting. The item some times will NOT be present already when you try to update it.
The wait is there to make sure it is.
Never said it was the best way to do that, but it will work as you wanted in your current setup 😄
yeah somehow I lost the first half of the macro when making everything
wither and bloom is a pain in the ass item to automate
It does not look that complicated looking at the description 🤔
race ya?
Currently in a league game 😂
I actually had an epiphany with it, what if the item does the heal, and then you do a template drop that has to include the heal target almost like a crosshair
either that or a target prompt after the fact like chris cleave
For some reason, the "legendary resistance" from the MidiQoL sample items is not working for me. I'm on v.9 still. I've tested with a few failed saving throws and nothing. Is there another module it depends on? Not sure what's up
Or if it's possibly an issue with my Midi workflow settings?
@violet meadow you got time to help me build the feature we talked about with Build-a-Bonus?
Midi does not work with:
Ready Set Roll
Better Rolls for 5e
Roll Groups
Fast Rolling by Default
Fast Rolls or Quick Rolls
Dice Tooltips
Taragnor's Gm Paranoia
WIRE(Whistler's Item Rolls Extended)
Minimal Roll Enhancements
Retroactive Advantage/Disadvantage
Max Crit
Multiattack 5e
Advanced Spell Effects module is in beta in v10 and often the culprit of things...
Are you planning to trigger some of it using midi? cus babonus is not a midi module, you can take that to #dnd5e if so.
Will do
I am AFK till Monday 😁
All good :d
Still trying to work out the Elemental Bane active effect. I set up the dialog for the damage type and the hooks for resetting the "applied" flag after every turn. I made custom CEs for each dmg type but I have to link the correct ItemMacro on the onUpdateTarget flag
I'm getting this
Could anyone tell me what I'm missing?
Hello all. I'm having some trouble with ItemMacro and I hope someone here can point me in the right direction. I have an ItemMacro setup on an item, with an OnUse = "ItemMacro" in item details, but when the ItemMacro executes, it's not getting any arguments, args.length = 0. Does anyone know what might cause this?
I'm having some issues with MidiQOL.
I'm running v10.286, I did an update to all modules and now I'm getting this with Midi. This was working before I updated Midi.
Where do you see that? It might be the same issue I'm seeing. If you log out args, is it zero length?
Anybody recognise this style of attack roll? trying to figure out why it's showing as this for players
I don't think that is the issue I'm seeing. Mine seems to be a compatibility issue.
I got it working. I had to grab an older package of MidiQOL.
Hello, how would I go about setting up an effect that transfers on an activation of a primary item onto an actor and than applies a condition (through CE or otherwise) on that actors next spell/weapon attack hit? I know the same thing is possible with damage with the flags.midi-qol.optional.NAME.damage flags but how would I replicate this with another effect (a condition)?
Hi I think I am have something like
The purpose is for DM to make players damage themself.
`const damage = await new Roll('1d8').evaluate({ async: true })
let actor = canvas.tokens.controlled[0].actor
let token = canvas.tokens.controlled[0].token
let target = canvas.tokens.controlled[0];
console.log(canvas.tokens.controlled[0].actor.name)
new MidiQOL.DamageOnlyWorkflow(actor, token, damage.total, ['psychic'], [target], damage, {
flavor: canvas.tokens.controlled[0].actor.name,
});`
But it seems the damage is not being applied.
I think I messed up something at the target part?
Do you know what canvas.tokens.controlled is...?
and what does "make someone damage themselves" mean
let selfDamageFormula = '1d8[psychic]';
let selfDamageRoll = await new Roll(selfDamageFormula).roll({async: true});
selfDamageRoll.toMessage({
rollMode: 'roll',
speaker: {alias: name},
flavor: this.item.name
});
await MidiQOL.applyTokenDamage(
[
{
damage: selfDamageRoll.total,
type: 'psychic',
flavor: this.item.name
}
],
selfDamageRoll.total,
new Set([this.token]),
null,
null
);```
Change the damage type as needed.
Assuming this is an on use macro on an item / spell / feature.
Follow up question: Can the damage be directly inflicted by DM and not going through ItemMacro?
Will need a small change, but yes
let selfDamageFormula = '1d8[psychic]';
let selfDamageRoll = await new Roll(selfDamageFormula).roll({async: true});
selfDamageRoll.toMessage({
rollMode: 'roll',
speaker: {alias: name},
flavor: ''
});
await MidiQOL.applyTokenDamage(
[
{
damage: selfDamageRoll.total,
type: 'psychic',
flavor: ''
}
],
selfDamageRoll.total,
new Set([token]),
null,
null
);```
Pretty sure that should do it as a hotbar macro
You'll need to have a token selected for that to work
oh this is elegant
(without the _)
No?
console?
Without I think just selected can deal damage
_token is last selected token, which may not be what you want
I saw that you changed it and stroke through mine 😅
token is currently selected (in a macro)
ohh I see
there
The entire purpose of this is so I can damage players when they deviate from a Geas spell
Yeah thanks everyone
If you use that as a GM you don't need to hoop through the MidiQOL sockets to execute this.
Only reason to do that is to have the Reverse Damage Card from Midi pop up.
Otherwise a "simple" ```js
await token.actor.applyDamage((await new Roll('1d8[psychic]').toMessage()).rolls[0].total)
Yeah a damage card is always nice. Thanks everyone
Send me a DM with what you're looking for, cause otherwise I will forget 😄
Is https://github.com/kandashi/midi-srd still usable in V10 today?
No, but there is a fork of it that works.
Where is that fork, also thanks for the quick response.
Thank you for maintaining this one @violet meadow
@violet meadow did you see our convo yesterday about midi-SRD? We’re not allowed to pin your fork in here until you publish it officially 😅
Ah nope, I haven't followed this.
The dislogue is only popping up for me, the GM, whenever a player uses it. I don't know why.
wild guess, "execute as GM"
It's unchecked
Either way it appears to only be showing up for the GM
It should pop up for whoever made the attack
I'm not sure how it would be showing up on the GM side
Could you screenshot your configuration of the feature?
uncheck the first box
rarrrrrrrrrr
Still showing up only for the GM
Maybe I need to restart the server
No errors in the console
double check that the chexbox is actually staying unchecked
Hello, is there a way to edit/fix the Misty Step Warpgate macro to only cast once upon activation? I know the repeated castings are caused by the incompatibility with Midi so that's why I am asking here.
By chance do you use automated animations?
and that you dont have duplicate named macros
No. I know that's a solution, but I was hoping there was a workaround so that I don't have to install another module.
I took the macro from one of your old messages here from discord and than integrated it as ItemMacro attached to the Misty Step spell.
there is likely an item.use() or item.roll() in that macro somewhere
i dont write macros for midi, so you always have to translate
The DDB importer has a misty step macro that doesn't use AA.
Uses the usual midi stuff.
That ones outdated I am afraid, but Il try to get it to work. Thanks.
Like using old methods for doing things? Or just not updated to v10?
Because all the ddb spell macros should be v10 versions.
I mean I took the macro from the Importer, imported it as ItemMacro and its giving me the Deprecated since version 10 error.
In other news, I just finished making a Wither and Bloom spell macro. Requires: Midi, Effect Macros, Warpgate. Item macro should execute on "Before Damage Application."
https://github.com/chrisk123999/foundry-macros/blob/main/Spells/Wither And Bloom/Chris-WitherAndBloom.js
What's the exact error?
Should probably be submit as a bug on the ddb importer Discord.
It'll still work, even if it says deprecated for what it's worth.
Configuration for the item macro for Wither and Bloom.
I went and tried checking, unchecking, and recreating the macro while on the player's view. The dialogue just pops up for the GM, not the player.
I'm honestly not sure how it's even showing up on the GM side. The workflow is all ran on the client.
If the GM is somehow running the macro, it should just have errors.
Unless you have another module that moves all rolls to be started by the GM.
If such a thing even exists.
Imma Find-The-Culprit
Its typically naughty to define actor and token fyi. You'd know for sure this is an issue if you didn't have advanced macros installed as it purposely bypasses that error.
This is amazing! But please put some space between the img and name in the heal a target dialog. I’d not tried with pog tokens 😅
Like a visual space?
Yeah very minor detail 🤏 Just next time you’re updating maybe
Oh sure
Cool to see that getting some more uses ☺️
That's the good thing about having it as a pretty standardized function
Can use it everywhere
So, I'd like to create a macro that automates a second strike when a weapon hits. So far, I have:
let hitTargets = args[0].hitTargets;
// if there are no targets, exit
if (!hitTargets.length) {
return;
} else {
const options = { showFullCard: true, createWorkflow: true, versatile: false, configureDialog: false };
await MidiQOL.completeItemRoll(item, options);
}
Where would I add the counter so it works? Can I just add let counter = 0 at the beginning and counter = counter+1 in the loop and check for that?
Just thought about it and I can't use that as the initialization of the counter needs to be outside of the loop and then added to within the loop and checked before the loop.
You can put a flag on the item.
Then depending what value the flag reset it or do another attack
Haven't worked with flags before. Do you have a link to a quick info dump on how to add flags, etc.? Thanks!
Untested ```js
// get the targets that were hit
const {itemId, hitTargets} = args[0] ?? {};
const item = args[0].actor.items.get(itemId);
// if there are no targets, exit
if (!hitTargets.length) {
return await item.unsetFlag("midi-qol","attacks-counter");
} else {
Hooks.once("midi-qol.RollComplete", async (workflow) => {
const counter = item.getFlag("midi-qol","attacks-counter");
if (!counter) {
await item.setFlag("midi-qol","attacks-counter",1);
const options = {showFullCard: true, createWorkflow: true, versatile: false, configureDialog: false};
//await MidiQOL.completeItemRoll(item, options);
await MidiQOL.completeItemUse(item, {}, options); //start using this one instead of the previous one, where the second argument inside the {} are the item.use() config ones.
}
else return await item.unsetFlag("midi-qol","attacks-counter");
});
}
Hey All - I'm fumbling about (admittedly) with creating a few macros. They are small and not overly complicated. I've lifted bits and pieces from here and there to serve my purposes. My current foe is this: a dialog box that displays when the item (a spell) is cast. The button is clicked, and on a fail the dialog box closes and the chat message is displayed. However on a success, the dialog box closes, the chat displays, then the dialog box re-opens. If I click the button a 2nd time a 2nd skill roll happens, and then the item card displays (spell is cast). I seem to be missing something to close the loop? Here is the macro:
title: "Psionics Focus Check",
content: "To use this ability you must succeed on a DC 15 Focus Check",
label: "Roll Focus Check",
callback: () => ChatMessage.create({content: `${token.actor.name} focuses on her inner Well and spawns a psychogenic effect!`})
});
const {total} = await actor.rollSkill("cus_0") ?? {};
if(total < 15) return ChatMessage.create({content: `${token.actor.name} tries to focus on her inner Well, but is too distracted.`});
await item.use();```
Are you using this as a Item onUse macro?
I am. But when I attach it just as an item macro, it has the same behavior
So Item onUse macro. You want the item to be rolled only of the skill check is successful?
Otherwise abort?
correct
ItemMacro | Called before the item is rolled. ```js
const results = await Dialog.prompt({
title: "Psionics Focus Check",
content: "To use this ability you must succeed on a DC 15 Focus Check",
label: "Roll Focus Check",
callback: () => ChatMessage.create({content: ${token.actor.name} focuses on her inner Well and spawns a psychogenic effect!})
});
const {total} = await actor.rollSkill("cus_0") ?? {};
if(total < 15) {
await ChatMessage.create({content: ${token.actor.name} tries to focus on her inner Well, but is too distracted.});
return false;
}
If you return false it will stop the Item from rolling.
Otherwise continue the MidiQOL workflow
You were using the item and when the skill was successful you were re-rolling it once more
or more... as this would be going on forever 😄
I see, so the return false is what I was missing. so I should put the macro itself as an item macro then point midi to that, instead of having it be a separate macro and call it by the name of the macro.
Can do both
Whatever is more convenient for you.
I tend to "store" Item specific macros as ItemMacros on said Item
Thank you! I was scratching my head and decided to just ask for help instead of fiddling about. If I want multiple items to use the same macro then just calling the name of the macro and having it be external to the item is ok?
Would be fine yes!
Though now that I re-read it, what do you want the result of the Dialog Prompt do?
The cast the spell - the dialog prompt displays (forces them to make a skill check) if the skill check fails, they get a chat message and nothing happens, if the skill check succeedsm they get a different chat message and the spell casts as normal
sort of like a successful proficiency check to be able to activate/engage the spell
I'm introducing Psionics into my homebrew
const results = await Dialog.prompt({
title: "Psionics Focus Check",
content: "To use this ability you must succeed on a DC 15 Focus Check",
label: "Roll Focus Check",
rejectClose: false,
callback: async () => {
await ChatMessage.create({content: `${token.actor.name} focuses on her inner Well and spawns a psychogenic effect!`})
const {total} = await token.actor.rollSkill("cus_0") ?? {};
if(total < 15) {
await ChatMessage.create({content: `${token.actor.name} tries to focus on her inner Well, but is too distracted.`});
return false;
}
else return true;
}
});
if (!results) return false;
else return true;
If you reject the Dialog it should stop the item from rolling correct?
Should be ok now
the power of buttons!
Oh hmm, it didn't like something in there
haha i left in an extra letter c at the beginning
Ctrl_a I said!
A small edit. It should be fine too now, with everything in the callback.
I caught that. It seems to do everything (rolls dice, closes dialog box) but the item card doesn't get called on a success.. let me make sure I have your recent edit in there (Thank you so much for your time on this by the way!)
By Item card, you mean the Item's description that is about to be rolled?
haha
It's super close (ok this isn't as simple as I thought so I'm not beating myself up so hard now)
Yeah that it the default message by MidiQOl
Not easy to change it .
deleted
Oh that's fine about the message - I cna live with that. the spell still isn't casting though weirdle enough (on a success)
lemme try that
haha k np
yeah.. hmm. maybe I have something else going on. dialog box seems to be working, blue ui banner gone, but the spell still doesn't cast on a success
Well I appreciate the attempt for sure! I'm closer than I was anyway 🙂
Yeah it's something small now, but too tired too see it.
Probably when the midi pre item roll hook and the dnd5e.preItemUse hook are getting called
Anybody else experienced lag at MidiQOL at calculating if an attack roll hit, rolling the damage and applying it? I find myself sometimes waiting after making the roll for the module to actually do anything at all
Maybe waiting for Reactions from players (MidiQOL settings => Workflow Settings => Reactions tab),
or Saving throws (MidiQOL settings => Workflow Settings => Workflow tab).
Oh, that's very likely
Honestly I just installed the module and I'm very lost haha
Quick settings doin' numbers tho
Wait does this not do it? #1010273821401555087 message
I misread your comment!!! 😭 💤
hey guys, i'm being unable to cast ice knife with an item macro that came with it
const tokenOrActor = await fromUuid(lastArg.actorUuid);```
these are the first two lines of the script, and the console is saying
```Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'actorUuid')
[Detected 1 package: itemacro]```
The Midi Qol Fields section of the spell came pre-defined as this:
any hints? I never wrote any script in foundry so I'm not sure where to begin, but I am a programmer. How is lastArg supposed to be initialized?
Nope 🙂 haha /shrug
Wrong execution method. When you see lastArg DAE is supposed to run the macro, via an effect with a macro.itemMacro and not MidiQOL onUse as shown.
Well not wrong execution method in this example, but Item Macro's sheet hooks settings ON instead of OFF.
Can you copy paste once more? Might have changed something in between. Works for me 🤔
so paste the entire macro into the effect value of a temp effect?
What's the macro?
title: "Psionics Focus Check",
content: "To use this ability you must succeed on a DC 15 Focus Check",
label: "Roll Focus Check",
rejectClose: false,
callback: async () => {
await ChatMessage.create({content: `${token.actor.name} focuses on her inner Well and spawns a psychogenic effect!`})
const {total} = await token.actor.rollSkill("cus_0") ?? {};
if(total < 15) {
await ChatMessage.create({content: `${token.actor.name} tries to focus on her inner Well, but is too distracted.`});
Hooks.once("dnd5e.preUseItem", () => { return false });
}
}
});
if (!results) Hooks.once("dnd5e.preUseItem", () => { return false });```
const lastArg = args[args.length - 1];
const tokenOrActor = await fromUuid(lastArg.actorUuid);
const casterActor = tokenOrActor.actor ? tokenOrActor.actor : tokenOrActor;
const casterToken = await fromUuid(lastArg.tokenUuid);
if (lastArg.targets.length > 0) {
let areaSpellData = duplicate(lastArg.item);
const damageDice = 1 + lastArg.spellLevel;
delete(areaSpellData.effects);
delete(areaSpellData.id);
delete(areaSpellData.flags["midi-qol"].onUseMacroName);
delete(areaSpellData.flags["midi-qol"].onUseMacroParts);
delete(areaSpellData.flags.itemacro);
areaSpellData.name = "Ice Knife: Explosion";
areaSpellData.system.damage.parts = [[`${damageDice}d6[cold]`, "cold"]];
areaSpellData.system.actionType = "save";
areaSpellData.system.save.ability = "dex";
areaSpellData.system.scaling = { mode: "level", formula: "1d6" };
areaSpellData.system.preparation.mode = "atwill";
areaSpellData.system.target.value = 99;
const areaSpell = new CONFIG.Item.documentClass(areaSpellData, { parent: casterActor });
const target = canvas.tokens.get(lastArg.targets[0].id);
const aoeTargets = await canvas.tokens.placeables.filter((placeable) =>
canvas.grid.measureDistance(target, placeable) <= 9.5 &&
!canvas.walls.checkCollision(new Ray(target.center, placeable.center), {mode: "any", type: "light"})
).map((placeable) => placeable.document.uuid);
const options = {
showFullCard: false,
createWorkflow: true,
targetUuids: aoeTargets,
configureDialog: false,
versatile: false,
consumeResource: false,
consumeSlot: false,
};
await MidiQOL.completeItemRoll(areaSpell, options);
} else {
ui.notifications.error("Ice Knife: No target selected: unable to automate burst effect.");
}```
Yeah take the other one from the linked <#1010273821401555087 message>
Hmm still nada (but I have another set of eyes on it now too)
yeah, sticking the macro into a temp effect did allow me to cast the spell, just didn't allow for the handling of the ice shard explosion part
i think it just ignored the macro entirely
OK well. That's an onUse alright!
No need for a DAE!
Check your ItemMacro module settings
This should be OFF
I am also trying to automate booming blade but seem to be stuck. What/where is the DDB script that you linked supposed to go?
Im tired too (and an idiot)
checked the box and it works fine now
Ah, does it create an AE only afterwards? 🤔
Yeah a semi-perm effect that lingers
it worked, thanks so much!!
its working perfectly now - it does spam the chat with 3 different chat messages but its working great
You can create just one message saying YAY or NAY but 😅
I’m not in front of foundry right now but those are typically item macros on the spell itself. Looking at that screen cap you replied to I’d say definitely (the itemmacro call at the bottom)
i don't see documentation on the itemmacro repo, nor am i able to find more info on that character sheek hook option.. are you able to give me a rundown on why that actually fixed it? i'd like to understand as I'm dipping my toes into scripting here
If you want to use Item Macro with MidiQOL you should have it off.
https://gitlab.com/tposney/midi-qol/-/tree/v10#item-macro
And I would make sure to read the MidiQOL readme at least once 😅
hahaha right, thanks so much!
Has Tim set the current one as the main page yet?
nope, master is still v9
Is that deliberate do you think?
Yes, cause it would change the Git structure afaik
Ok sweet. We’re almost at v11 👀
Up until v9 is no longer maintained at least, I wouldn't expect this to change 🤷
is there a way to get intelisense capabilities while writing midi qol macros?
I might suggest if he could put a big link to the current version at the top of the page to cut down on confusion… this stuff feels super dated
Maybe an issue would make sense to see what could be done
I'll ask a question that has been bothering me for a very long time: how to make two versions of the effect on one weapon? Honestly, I'm not sure exactly where to ask this, so let's try our luck here first.
What do I mean in general: let's take the good old Flame tongue, it damage like a regular sword, but if you switch the mode, it will cause different damage, I would do something similar through the effect, or I would create a second item with the name of type "Flame tongue - activated", which would already deal (regular sword damage)+2d6 fire damage, however, honestly, this clogs up the inventory a lot, considering that I give items to players more than once a year. How to make two weapon modes in one item?
There are a few ways.
dnd 5e, foundry v9, as always, just in case if it's important
Activation condition tied to having an effect would be one route
It would be nice to understand what exactly this means
Oh, the activation condition, I understand. I never understood this thing, not even examples of items from MidiQoL
Could set it to look for a specific effect to get the additional damage
Okay, I'll read it. And what about the rest of the options if in short?
Then just have a feature that toggles the effect on and off
Something along the lines of "effects.find(ef=>ef.data.label === "Flame Tongue")"
Untested, I don't personally use activation conditions much.
The most basic option would be to put the alternative damage in the Versatile or Other field
I don't really understand how to make the alt damage roll if the condition is met. I see the line "Roll Other Damage has 3 options" in the document. As I understand it, this should be switched not in the subject, but in the module settings?
Found it
Okay, let's say I started to understand how to work with alt damage. Now, if the condition is met, both normal and alt damage are rolled. Is there a way to do that only the alternative is rolled if the condition is met?
Nope, not without a macro
Would need workflow.actor.effects.find(ef=>ef.label === "Flame Tongue")
@robust vault Great Weapon Master Toggle with a twist.
Instead of a static -5/+10, you can pick the boni you want, up to the character's proficiency bonus.
Set up as an ItemMacro | Called before the item is rolled on a feature called Great Weapon Master, targeting Self.
THIS ONE HAS A BUG. PLEASE CHANGE LINE
if (!args[0].item.system.properties.hvy || args[0].item.system.actionType !== "mwak" || !args[0].item.system.proficient) return;
``` to ```js
if (!args[0].item.system.properties?.hvy || args[0].item.system.actionType !== "mwak" || !args[0].item.system.proficient) return;
**PLS CHECK AND CHANGE THIS LINE 👆 in 👇 **
Use once to activate. Use once more to deactivate
It will apply only to heavy and mwak
Nice, i will test this afternoon
(forgot a console.log in there)
Ah the character needs to be proficient too. Well the full check should be ```js
if (!args[0].item.system.properties?.hvy || args[0].item.system.actionType !== "mwak" || !args[0].item.system.proficient) return;
`if(args[0].macroPass === "preAttackRoll")`
`if(args[0].tag=== "DamageBonus")`
@next sun The Life Syphon
(Life Syphon) - If a creature attacks and causes damage to you this feature activates. [Causes 2d4+2 Magical Damage to the creature at the end of your turn as long as they are within 15 feet of you for 1 minute. Your character regains 1/2 of the damage in HP].
Set up as a Reaction Damaged feature with an ItemMacro | After Active Effects on the reaction Item, targeting Self and an ItemMacro ```js
const effectData = {
changes: [
{key: "flags.midi-qol.OverTime", mode: CONST.ACTIVE_EFFECT_MODES.OVERRIDE, value: "turn=end, macro=Life Syphon Macro"}],
duration: {startTime: game.time.worldTime, seconds:60},
flags: {
core:{statusId: "Life Syphon"},
world:{targetSyphon: this.workflowOptions.sourceActorUuid},
},
icon: "icons/magic/fire/barrier-wall-flame-ring-yellow.webp",
label: "Life Syphon"
}
await args[0].actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
Then create a Script Macro in your macro folder named Life Syphon Macro and copy paste this ```js
const targetUuid = args[0].actor.effects.find(e => e.getFlag("core","statusId") === "Life Syphon").flags.world.targetSyphon;
const targetToken = fromUuidSync(targetUuid)?.token ? fromUuidSync(targetUuid).token : fromUuidSync(targetUuid)?.getActiveTokens()[0] ? fromUuidSync(targetUuid).getActiveTokens()[0] : fromUuidSync(targetUuid);
const sourceToken = args[0].actor.getActiveTokens()[0] ?? args[0].actor.token;
const distance = MidiQOL.getDistance(targetToken,sourceToken, {}, true);
if (distance <= 15) {
const damageRoll = await new Roll("2d4+2").evaluate();
await game.dice3d?.showForRoll(damageRoll,game.user,true);
const total = damageRoll.total;
const halfTotal = Math.floor(total/2);
await MidiQOL.applyTokenDamage([{damage: total, type: "none"}], total, new Set([targetToken]), args[0].item, new Set(), {forceApply:false});
await MidiQOL.applyTokenDamage([{damage: halfTotal, type: "healing"}], halfTotal, new Set([sourceToken]), args[0].item, new Set(), {forceApply: false});
}
Put up a Sequencer effect linking the 2 tokens and you're golden 😄
I am trying to get a weapon to do extra damage and roll with advantage against certain creature types, but it is not working for me. Any thoughts as to what i have done wrong here?
Here is the details and effects Pane:
looking to do the 1d10 force to those creature types specifically.
The other way around as per the MidiQOL readme. ['fiend', 'undead'].includes('@raceOrType')
Ah, i pulled straight from the MidiSample dragonslayer and it had it backwards then!
thanks
For 1 type of creature its fine. But for multiple it's not
and square brackets instead of the ()?
yes
the advantage is happening regardless of race or type still, though the damage is working.
Match the [ with ] not )
im missing a ( around race or type i think. So this:
["celestial","fey","monstrosity").includes('@raceOrType')]
actually this if im reading the readmy correctly:
["celestial","fey","monstrosity"].includes('@raceOrType')
Thanks!
Question - Why would midi be rolling the tother dice twice ?
A screenshot might be helpful.
If you don't have multiple rolling modules enabled, some sort of macro being applied twice might be the case.
If you are on DAE > 10.0.15, there is a bug that applies effects twice. So check if the actor has the same, maybe damageBonusMacro or other bonus effect twice
This is the weapon i am using only rolling mod i have is dice so nice... also have dice tray but disabled dice tray as a test and it still double rolls.
i currently have no macro attached to the weapon
Soo, to look into the rabbithole that is the janky spiritual guardian and all the aura type spells how do you use / fix them?
as for now i see two problems with them
1: The Spell if cast on the caster during AOE Placement also harms it and allies.
2: The Spell does not "Persist" and does not force new saves being made during the following turns and would need to be recast, jumping back to problemo 1.
So how did yall do it, because i do not fancy fixing all allies HP each turn for 100 Possible turns xD
Sleep also acts in sense of damage over status effects but i think i can do that fix myself.
Is there a good way to quickly add an "in cover" status to tokens that works with the MidiQOL ecosystem?
Convinient Effect has them made, i just havent seen a way to automatically apply them to tokens.
They are working, just need to hand it out manually.
(As well as levels auto cover)
(As well as https://foundryvtt.com/packages/tokenvisibility)
OK, with this it seems that the Other Formula should be rolled automatically due to activation conditions on the Item
How does the chat Damage Card look like?
And do you roll the Other Formula via a shortcut keybind maybe?
When I said roller modules, I meant Better Rolls, Ready Set Roll and the likes
Use the included Spirit Guardians from the MidiQOL sample Items compendium!
@violet meadow I roll it from the dialog dropdown when it comes up here is the most recent cards
i would never recommend Levels JUST for its cover component 😅
(plus, simbul's is implemented RAW 😉 )
Can you post a screenshot of the card before selecting this dialog dropdown you mentioned?
i mean thats the one making the mess i try to fix or is there another version i do not know of?
It should be working fine. Might have an issue with DAE version right now, but 🤷
What's your MidiQOL version, system etc?
@violet meadow
you likely have a bad character in your damage formula, if you can't find it share the details tab of the item
If that is your damage details, the roll you showed is a bit strange 🤔
It seems to change the basic damage formula to the Other Formula one
lots of wrong in that item details
I would recreate the Item. Is this a DDB import?
the bludgeoning in the damage formula is redundant(its required in the versatyle and other formulas)
and [additional] is naughty