#MidiQOL
1 messages ยท Page 110 of 1
Also its not an async function so don't await it
You need a number or the what I shared
there are alot of "waits" in the macro this is in
you can check which function is async and which is not in the console quite easily ๐
All set now, will reshare Divine sense all fixed in a second
Divine Sense
Midi Item On Use
Setup the item with charges
Clear target settings
After Active Effects
u.u
CPR?
The module Chris' Premades. Its got a bunch of advanced automations for dnd5e and is one of the mainstays here for midi users.
oh awesome i'll take a look thanks!
it is possible to create this?i guess undead, construct and elemental doesnt count as "alive" for making it easier to do
It wouldn't be perfect, would it be worth automating then?
ATL detection mode key for one of the senses
hmm good idea
i guess if you can create an item that only activates on some "races" you can make one that excludes "races"?
living in dnd terms is anything with more than 0 hp that is a creature
so is as easy as adding one special sense using ATL keys
is it possible to make a DAE delete itself if certain conditions aren't met?
I mean, through item macro
don't describe foundry/midi terms, describe the actual item instead
Depends on the condition but yes
I have this effect that, if certain conditions are met, it creates stuff on an actor through args on and deletes them on args off. It's working fine, problem is, even if conditions for args on aren't present, the effect stays on the actor (doesn't create anything, but stays there).
conditions are: 2 other specific effects must be present
if I try deleting the effect through actor.deleteEmbeddedDocuments("Active Effect", [currenteffect]), the macro just goes args on and creates stuff
are you making the thor premade items interactions?
thor?
You can check for the conditions in args each (per turn), but deleting an active effect should not create one lol
nm if you don't know it nm
theres 3 magic items where one of them gets something special if you wear the other two, and alot of people make the mistake of not realizing they don't need to attune to the other two, just wear them, so if you had been making that, your approach was flawed because the other two don't need to be attuned therefore their ae's wouldn't be on the actor.
but you aren't making that so nm
nah, nothing to do with attunement, it's that same astral monk stuff I've been dealing with for the past week
it's not hard to do, but I've been doing and learning at the same time, hence the difficulty
I had no clue what "args" was until like 3 days ago, so... ๐
Right now, macro is like this:
//Check Arms of the Astral Self and Visage of the Astral Self
const hasArms = !!actor.effects.find(e => e.label === "Arms of the Astral Self");
const hasVisage = !!actor.effects.find(e => e.label === "Visage of the Astral Self");
const currentEffect = actor.effects.find(e => e.label === "Body of the Astral Self");
actor.deleteEmbeddedDocuments("ActiveEffect", [currentEffect])
//Define abilities
const empoweredData = await fromUuid('Compendium.world.monk.bZTGlfOBKpuDFQHC');
const deflectData = await fromUuid('Compendium.world.monk.uR3ou0xtetQ7TrlR');
//Check if actor already has abilities and creates them
if (args[0] === "on"){
let hasEmpowered = !!actor.items.getName(empoweredData.name);
if (!hasEmpowered){
await actor.createEmbeddedDocuments("Item", [empoweredData]);
ui.notifications.notify("Empowered Arms added to your abilities.")
}
let hasDeflect = !!actor.items.getName(deflectData.name);
if (!hasDeflect){
await actor.createEmbeddedDocuments("Item", [deflectData]);
ui.notifications.notify("Deflect Energy added to your abilities.")
}
}
/*When args off (effect is removed), it checks if feats exist and deletes them (this check is by item name, so, if you have other items with that same name, it won't work). Deletion can't be done using
empoweredData and deflectData because the ids are different than the ones created on the actor.*/
if (args[0] === "off"){
actor.items.getName("Empowered Arms")?.delete();
actor.items.getName("Deflect Energy")?.delete();
ui.notifications.notify("Deflect Energy and Empowered Arms removed from your abilities.")
}
it stores the effect just fine on const currentEffect (used console.log to check), but, once it gets to the delete part, it goes nuts, doesn't delete anything and sends args on
actually, it's not args on, it sets true all the ifs inside args on
your world is fully homebrew so who knows
show the attack in chat?
nvm, it isn't messing with args or anything, it just isn't deleting itself
any clues how to make this lil'guy terminate itself?
Hmm, yeah I wonder if it can find itself when applied, not sure when that check happens
Let me play and I'll get back to you
give it a duration, or have the other dae's terminate it
@frail osprey Actually, double checking the logic here; in what cases do you expect this item to delete itself? Not programmatically, but like the logic while the player plays the game.
It seems strange to need an effect to self-annihilate
so, this ability (the one that generates this effect) can only be used if two other effects are present
Ability 1 + Ability 2 -> unlocks Ability 3 (this ability)
Ability 3 grants 2 other abilities (lets call them subab1 and subab2)
Now, the original version of this macro checks if effects 1 and 2 are present and, if not, terminates it with a return, BUT this doesn't delete the effect, so the player doesn't get subabs 1 and 2 as intended, but the effect stays on the actor.
not really gamebreaking or anything, but sorta sends a false information to the player
tl;dr: I don't want the effect to show up if certain conditions aren't met
Gotcha. I don't think letting the effect "catch" itself is the right approach here, I think you should make this an on use macro instead and programmatically create the active effect. The macro will check for the other two(?) active effects and create the effect if appropriate. Since you've also already created the items of the features that it's adding, instead of using args for on/off, use macro.createItem. Functionally the same, just saves you some coding
I think Krig should just look up the Astral Self monk
its the first 3 features of astral self
I looked it up, I didn't think it needed this complex of an automation personally
will try. I was having a problem that my effects created through macro didn't carry the change ๐ข
Arms is a macro.createItem key
Visage is an ATL key, 2 advantage keys for the skills
Body is a macro.createItem key and an optional.name set of keys for once per turn bonus damage
If you really wanted to automate when they can use them, make arms give visage as a macro.create, then have visage give body as a macro.create.
Try this;
const hasArms = !!actor.effects.find(e => e.label === "Arms of the Astral Self");
const hasVisage = !!actor.effects.find(e => e.label === "Visage of the Astral Self");
if (hasVisage == true && hasArms == true) {
const effectData = {
label: this.item.name,
icon: this.item.img,
changes: [
{
"key": "macro.createItem",
"value": 'Compendium.world.monk.bZTGlfOBKpuDFQHC',
"mode": 0,
"priority": 20
},
{
"key": "macro.createItem",
"value": 'Compendium.world.monk.uR3ou0xtetQ7TrlR',
"mode": 0,
"priority": 20
}
]
}
await this.actor.createEmbeddedDocuments("ActiveEffect", [effectData])
}```
It should also have a clause for not finding the effects to alert the player, but we can add that afterwards
ui.notifications.alert("YOU CLICKED THE WRONG ITEM MOFO")
I am home and have tried to apply the new effect to the item. Unfortunately it doesn't seem to be working ๐ฆ
worked great, Krig! Thanks! I'll just add a notification and make the effect temporary ๐ฅณ
I had changed somethings between the first upload of the macro and the one that is now shared in the post. Had you grabbed it when I first posted it?
Any errors in console?
let me check the version
btw, @short aurora , lemme know if you ever get around automating that fly thing I saw you talking about earlier
is this correct for the effect value setting?
nope just empty effect value
I have a homebrew ability (created before we moved to FoundryVTT) that allows the player to move double their move speed and then deals AoE damage based on moved distance, and I have NO IDEA on how to automate that
@vast bane I just discovered a limitation of macro.createItem regarding consumables and quantities; it can't be removed after being applied, if it's being applied to an existing stack (e.g. create another arrow on top of your 99 arrows). I think you had your jank reactions set up like that? Just a heads up if they ever behave weird about removal
realistically, I'd just put in a dialog and trust the player, that'd seem a lot smoother in actual play
also maybe they get the jolly out of putting in a big number if they like hasted themselves or something
like: "insert how many feet you walked"?
Forgot to mention it also gives the player fly speed
Yeah, how far you travelled. Basically to automate it, you'd have to calculate based on start and end position of their turn, presumably, and that's a big can of worms
name of the ability is "swoop of the electrical phoenix", actor gets electrical wings and flies to a certain spot, then electricity explodes around them
Grid based gameplay means that the shortest distance is not always the distance you travelled, after all
it still appears to not be working. I do appreciate all of the assistance so far though!
The effect doesn't change, nor does a new one get added
No console errors, and no console messages with it (tested with item added and removed)
Oh, they pick a point? It is actually just the shortest distance?
Yeah, I actually found that out then, just never responded to tell anyone lol
Then it's not so bad, midiQOL get distance before triggering the ability I guess
but the "max pickable point" should be double their speed
if that doesn't calculate for the proper 5/5/5 or 5/10/5 grid based (it might, have not checked), then you need to do some shenanigans
search macro polo for "measureDistances" (plural) as a start
will do! Thanks for the tips, guys
btw, to have midi-qol autoapply damage through macro, I'd have to find a way to insert the damage in the workflow, right?
if you mean for body, that screams optional.name
one on turn, deal extra martial arts die damage with a melee attack
no, for this other ability I was describing, that deals damage based on distance. Since macro will calculate the distance (and therefore the damage too)
Yup, or if there's no save or anything involved, you can do a damageOnlyWorkflow as a line in the macro itself
Basically no evaluating of "does this hit you" if you're a target is a good usecase for a damageOnlyWorkflow, of course, you can also macro in the "does this hit you" but I tend to not do that personally, so midi can take care of that for me
the less logic already coded I have to code, the more sanity I have
so basically midi will check the hit and, if there is any, it'll get the damage from damageOnlyWorkflow?
damageOnlyWorkflow is a function to damage someone, how we evaluate the target depends on the feature, but let's cross that bridge when you actually sit down to make it
lots of ifs and maybes here
you're right, unfortunately I have a lot of other more critical stuff to automate before that
that just means you wont get bored!!!11
All midi distances functions respect the diagonal rules
Did you equip and attune to the item?
yes
I didn't see these in the midi docs - what do they do?
Theoretically these flags on an actor, grant disadvantage on attacks that are type util and other. Now if that holds any value ๐คทโโ๏ธ
Share some screenshots of the DAE, item and the macro as you ve set them up to see if anything seems amiss.
Won't be at me pc till the morning in some 8 hours
@krig managed to get an effect to delete another effect on args off. Had to use effect.id
actor.deleteEmbeddedDocuments("ActiveEffect", effect.id)
Ah yeah, I overlooked that in the original, you're right, need id for deleting embedded documents
weirdly enough, I didn't need to state the id when deleting stuff using actor on use Item Macros
just when macros were triggered by effects
Sounds good ๐
Ok that is the initial item and seems fine.
What is under the Effects tab in the actor's character sheet when you equip and attune to the item?
Yo, for these kinds of saves, (flags.midi-qol.advantage.ability.save.all) do I need to input an effect value to get it to work?
Or, rather I guess, how do I tell that its worked?
I've tried adding a +1 and it doesnt prompt or automated advantage on saves when rolling as a player with the effect
Just 1 instead of +1 should do it
Unless you fast forward though, all it does is highlight the advantage button for ya
not really midi related, but anyone here also had this issue at some point? I have an effect that gives 120ft darkvision, and the actor gets the darkvision, but the token doesn't
Prototype token and sheet do not translate like that
Hmm
No correlation as far as I am aware
I mean, there's no vision at all
The advantage isn't highlighted in the saving throw pop up, or am I missing what that highlight is?
What I meant by no correlation is that you gotta set up the prototype token of actors separately
Look into the module "Adequate Vision" it'll automate the vision from character sheet and token
Its something that should be in the system, but isn't (yet)
I see. Thanks, Tom
np.
Nope, looks like you got a conflict with a module or something, unless you already had disadvantage on the save. Works fine.
(Adequate Vision, not lighting)
Here's the quick big bad list of modules
https://github.com/thatlonelybugbear/FoundryMacros/wiki/MidiQOL-knowledge-database-by-@MotoMoto1234
Alright thanks, I know what the conflict most likely is then, but need the other module to keep my current workload
Although it isnt on Motos list
@modern badger What's the normal damage and damage type of your weapon?
Is there a way to setup a "damage absorption" that would absorb 10 points of damage / day? (similar to charges for an item that would recharge each day, but in this case it would be damage that would be absorbed)
dae + magic item module
You'd create a spell with the effect then drop that spell on to the item
You can assign cost, charges and how charges return
So when using an item that drops a template that will target anything you drop it on, is there a way to get it to not select allies?
Don't think you can without a macro
So I'm looking at the tab for the attribute key for Active Effect, and i see a bunch of "flags.midi-qol." in theat drop down. is there a list somewhere of what some of the less obvious "flags" are for? For example... what is "flags.midi-qol.inMotion" like, what does that mean? a lot of them make sense, but a few seem curious to me.
Yeah, the default should be true (not false) for overtime effects
It would have to be a macro that untargets friends before doing the rest of the workflow.
Does Midi account for disadvantage when making a ranged attack with an enemy at 5ft? (5e)
It might be a setting but yes
oh fuck, sorri, was sleeping, normal damage is 1d8, 1d10 versatile, and bludgeoning
There is an Arcane Ward Item in the MidiQOL sample items compendium that might be good as a starting point too, if you are used to macros and such.
Which MidiQOL and DAE versions are you on?
I didn't write an issue for that, cause I also discovered that there is a checkbox for this too in one of the later tabs in workflow button for ignoring incapacitated for actions. But it did seem like the wrong option was default in the overtime.
I'm playing dnd 5e and trying to use an effect similar to heavy armor master to reduce damage taken by an amount. I'm using the "flags.midi-qol.DR.bludgeoning" tag for example, then putting in a formula there for the amount. Is it possible to have damage reduced by an amount, but to a minimum of 1?
flags.midi-qol.DR.bludgeoning | Override | min(1,formula)
@pale magnet In MidiQOL settings => Workflow settings => Workflow tab, you can have a setting to automatically match a DFreds CE to the name of the used Item.
So if Rage is used, the Rage CE will be applied.
Apply Convenient Effects which is the one shown in the cropped screenshot.
Thank you so much!
Is it fine to ask here a question just about DAE? Its regarding the system.attributes.ac.flat key.
We're probably the best source for the answer so I'd say sure
okay!
I noticed that in DAE the attribute system.attributes.ac.flat is deprecated but it seems to work fine if one just wants to reduce current armor by 2.
Even if one uses flat armor instead of a calculated one like natural or equipped. Why is it deprecated?
I think specifically dnd5e deprecated that one in favor of bonus for adjusting armor?
Its deprecated I think because calcs got added afterwards. That key will only do anything if the ac calc is set to flat
well it also works on non flat stuff
it tested it on monsters with flat, monsters with equipped, monsters with natural and also players.
does it change the ac calc to flat though?
Krigs suggestion is the recommended key for what you want to do fwiw
Not seeing a change with equipped armor for players personally, works if set to flat like Moto mentioned
I think its overriding but not showing in your sheet/sheet module
AC is 11 with leather armor and 0 dex mod
I have an active effect that heavily uses a bunch of deprecated keys and the behavior of the sheet is really weird on them
The easiest (but not strictly correct) is to have an effect that deals temphp healing of 10 points. To get it to reapply each day I'd suggest effect macro for the on/off cases and a special duration of end of day. The delete macro would just reapply the effect to the actor.
works on my paladin player with 23 AC from armor, shield and ring.
It even lists the modifications on the tooltip.
Maybe it only works with + and - symbol in front of it?
I think the flat is how you set calcs actually
and since you didn't set it right its not doing anything right?
Hmm, nope, I can't replicate yours, only seems to work with flat and natural
the flat one is just a left over from old tests.
weird...
natural is actually like flat fwiw I found that out weirdly
oh that's value, not flat, it adds if you put it in flat?
dae and midi have alot of synergy and some things will work differently when midi is absent in dae
your picture I mean
not using midi, yep
value works fine, flat does nothing if not set to flat or natural
okay nvmd I am illiterate. I mean to ask about value, not flat ๐คฆ
value is really wonky, but why aren't you using bonus instead?
Aah, fair fair. I think it is just to follow dnd5e's change to bonus, I recall it being value before?
its a much stronger key as long as you aren't using flat
because bonus does not work with pure flat.
I think its usually advised to swap to natural
which my DM loves
natural is basically flat but bonus works
yeah but my DM is too lasy to swap everything to natural I think.
well I could write him a macro...
and then just to be sure remove flat from the list of options too...
I think theres a setting with most importers to swap to natural vs flat fwiw
all creatures we use are basically hand made ๐
good idea
fwiw I can't think of something that breaks right now, despite it being deprecated, might just be a thing to consider for future or if AC starts doing shenanigans
also fyi, I am pretty sure changing from flat to natural doesn't reset the value
cause both require a manual entry
yep it does not. just testet it. it does allow things like a shield to be added though.
which is neat
yeah I recently ran into this exact situation, I was like...huh, whats the point of flat then?
and deprecation is not always bad to use:
These ones work, but the sheet gets really weird in displaying them.
Then again I haven't looked at them since I dropped tidy so maybe the core sheet handles them
Its a "shocked" kitty
Its used on especially difficult monsters
so for the world script I need to loop through all actors in the world... and then update the calculation.
All actors in the world means all in the sidebar and all unlinked tokens on all scenes as well?
A macro could be made for doing existing things, I think a world script would be for making sure flat isn't the default on a created actor
hes electing to pick flat
maybe a world script or CSS to hide flat lol
default is "unarmored"
You could tell them about natural maybe that will get them motivated to use it
yeah they just used the first one that did what they wanted to do lol
I think it would be easier to get the DM to change than to go in and change so much stuff thats already using .bonuses
and then I just use the ac.bonus key, right?
make sure before you give a macro that swaps flat and natural, that it passes the test of maintaining the value
you don't want to fire that macro on a compendium or scene and then have it turn a bunch of ac's to 0
players would love it
it could also send a bunch of actors into validation errors too
if it nulls the ac field
eww
basically, test it on a small unimportant sample before you make it override the bestiary or a whole map hehe
yeah definitely. You don't know an easy way to get all actors in the entire world at once, right?
besides a loop over scenes
I know zhell would, but thats a really dangerous macro lol
I was thinkin something along the lines of all tokens on scene, all sidebar actors, and all actors in a compendium
the server makes a backup of all worlds every day at 0:00 and uploads it to a gitlab repository so that does not matter too much.
but first make a macro that does selected token to make sure the actual macro method doesn't reset the ac
the UI method may keep the value because its left in the UI and then you hit save. A macro doesn't do that so I'd be worried about that
Migration completed without errors or wrong values ^^
World Script is also completed.
Went down the rabbit hole for that one.
Seems that next DAE will probably have some changes regarding this, making do not stack by name the default option more or less.
oh cool, that would make the janky immune to custom ce's alot easier
the question though is, will that change existing aes?
will we have to delete and rebuild the dfreds CE item?
Fwiw, all you need is default behavior changed. The non custom ce's are typically not important for this as the conditions are all already handled with Conditional immunity
Up until now, if an AE didn't have a defined flags.dae.stackable, it would pretty much default to multi. In the future it will default to noneName.
Alongside this, the dropdown menu in the DFreds CE create effect dialog, should in the future default to the Do not stack by name instead of origin, so newly created CEs would have that as default.
Already placed AEs should not be affected
is there a flag for "can't take reactions"?
Does anyone know if there is a toggle anywhere to change initiative to fast forward/auto rolls?
I have not changed anything in a world apart from something in MTB that is totally unrelated and now the initiatives of PCs are being auto rolled. (I have changed the totally unrelated ting in MTB back just in case and initiative is still auto rolling)
Would that not be in something like Dfreds CE incapacitated condition?
Quiet initiative module maybe?
No, I do not have anything like that.
I have two worlds, different campaigns but identical set ups. One has suddenly started rolling initiative automatically.
Wait a minute, it could be Quick Combat, I installed it this week so that I can get combat sounds going when a combat starts.
Configured that for the Wednesday game but not Friday game. ha ha DOH!!
Hey all, had a question on the let me roll that for you module. I'm using it with midi's prompt players to roll saves, but when the dialogue pops up they don't have the ability to select advantage or disadvantage. Is that just an inherent problem with lmrtfy? Should I just be using foundries standard dialogue box popup for that?
The reroll initiative feature is very fun, but a bummer that it messes up some effect expiry stuff. Does anyone know if there are plans in the works to get it working more smoothly?
You have fast forward turned on for whomever is rolling, thats a midi setting
I don't use LMRTFY, I use MTB, I'm unsure if there is an issue with fast forward with that module or not.
Thanks, fast forward isn't on, they get the dialogue box to initiate the saving throw, it just doesn't give them advantage or disadvantage option
u can use shift and control in the dialogue
cool let me try that
hm, that doesn't seem to change anything
huh, and that's on midi popups not just the general lmrtfy manual request?
ahhh, it looks like lmrtfy + query works
I'm trying to automate Staggering Smite. Is there another spell that gives you a bonus damage and then asks you to roll a saving throw or have AE applied? I just want to look at the code and see how that is constructed.
I'm unfamiliar with LMRTFY, it must have a setting overrding midi.
you should not need to use keyboard shortcuts to live with fast forward, it should be a setting you can shut off
fast forward has 3 setting locations
Yeah no shortcuts necessary, lmrtfy+query in midi settings works fine
ability/saves is outside the workflow button, and then attacks/damage are inside the workflow button in player/dm tabs
that gives you the lmrtfy dialogue box and when pressed then gives the diadv/standard/adv dialogue box
basically i just need a macro that has a save function that i can look at.
all of the bonus action smites need some desperate attention
i've just about got it. I just need to macro the save.
theres a midi sample and a ddbi macro available for bonus action smites
looks like Thunderous Smite is the model to work off.
@violet meadow Are you here today per chance?๐
Intermittently ๐
Link me the latest comments and I will take a look!
@violet meadow
How one would do this?
Iv tried using the this.save/hit Moto suggested but Foundry does not like it xD I keep geting errors and it destroys the rest of the macro.
and im trying to put it into this.
@violet meadow
So if there is no hit, give something back?
Cause that one has no save, has it?
The macro I mean
No, if the attack hits or the target fails a save the creature that attacked should gain resources.
I have another version for a save, I can link that to
Ok I will need access to my PC to write this though so it will need to be later
How are you trying to update the resource? I might get away with some copy pasting of the code if you have it correctly doing that for now
Otherwise coding on mobile not good ๐
Well im using the "resources.legres.value"
If this.hitTargets != 0 {resources.legres.value}
Im probably using them wrong, I tried to include it under the second line of the script.
Im 99% sure all of my versions of that line was utterly wrong
Oh yeah ๐
if (!args[0].hitTargets.length) return;
await args[0].actor.update({"system.resources.legres.value": args[0]. actor.system.resources.legres.value+1});
``` maybe going from memory.
If you log the actor and find the data path to the resources legres you can find the correct update
Does the above work if you don't hit?
If I dont hit nothing happens
When I hit with that part of the macro added nothing changes from how the macro normally works. However im not sure what you mean with "find the data path to the resources legres you can find the correct update"
But when I use it alone it "works". It adds a resource no matter if it hits or misses xD
@violet meadow
Replace the line in your macro
if(args[0].hitTargets.length===0) return
with the one I shared above
I did in the original macro, it still adds a resource on both hit and miss
Share the macro then again to check it
async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if (!args[0].hitTargets.length) return args[0].actor.update({"system.resources.legres.value": args[0]. actor.system.resources.legres.value+1})
if (!args[0].hitTargets.length) return args[0].actor.update({"system.resources.legres.value": args[0]. actor.system.resources.legres.value+1})
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;
const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = await new Roll(`${numDice}d6`).roll();
await new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD, new Set());
const effectData = {
label: "Drain",
icon: "icons/skills/wounds/blood-drip-droplet-red.webp",
origin: args[0].uuid,
changes: [{
"key": "system.attributes.hp.max",
"value": `-${damageRoll.total}`,
"mode": 2,
"priority": 20
}],
disabled: false,
duration: { seconds: 86400, startRound: gameRound, startTime: game.time.worldTime },
flags: {
dae: {
specialDuration: ['longRest']
}
}
};
await MidiQOL.socket().executeAsGM("createEffects", {actorUuid: target.actor.uuid, effects: [effectData]});
//let hpNow = target.actor.system.attributes.hp.max;
//let updateHP = hpNow - damageRoll.total;
let updateHP = target.actor.system.attributes.hp.max;
let the_message = `<p>${tokenD.name} drains ${target.name} of ${damageRoll.total} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${damageRoll.total} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
user: game.user.id,
speaker: ChatMessage.getSpeaker({actorD: actorD}),
content: the_message,
type: CONST.CHAT_MESSAGE_TYPES.EMOTE
});
And how do you execute this macro?
Ps you got the same line twice in the beginning, but shouldnโt matter in the grand scale of things anyways ๐
Item on Use , after active effects?
Not sure how that happened๐คฃ
On use macro
With which trigger?
After active effects
So what happens when you attack with that item? It adds legres and stops?
It adds a legres resource aswell as the other parts of the attack
So the only thing thats wrong is that it adds a resource on a miss
anyone had an issue where the auto target works for evryone except for one player?
Is there a player side setting they've messed with?
Wait you want to add a resource on a hit!?!
Nope
@umbral basin get this macro and replace the similar line
XD I thought I said that hahaha xD Im sorry
Yes so basically the plan is to have it as a part of a Boss mechanic. I find Legendary Resistance to be quite boring on itself.
So my plan is that the BBEG can have 10 Legendary Resources.
If it manages to drain the players on blood it gains a charge, it can use 8 charges to use a powerful Attack but also 2 resources to use a Legendary resistance. So if the players use a lot of abilities they can prevent the powerful attack.
The boss has a few other ways to gain resources such as minions bringing stuff so the players will need to kill these minions before they boost the boss.
how would I have an Activation Condition of having an ally within 5 feet of the actor?
I basically want to automate this: When a creature the thug gang boss can see targets it with an attack, the thug gang boss chooses an ally within 5 feet of it. The thug gang boss swaps places with the chosen ally, and the chosen ally becomes the target instead.
I just want to stop the workflow, swap the tokens and then let the player target the new token manually and roll the attack again.
that would be a reaction macro, which could be easily done findnearby, dialog and warpgate
does "args" not return anything anymore?
The similar line? Thats the part I added to the macro before.
I'm making this magic item
As an action, you can pull the hook on top of the Lantern of Souls to activate it, focusing on one creature within 30 feet. The target must make an Incapacitated Charisma saving throw until its concentration is broken or the Lantern is deactivated. You must continue using your actions to maintain concentration on the Lantern. If the target remains under the effect of the Soul Lantern after 3 turns, their soul leaves their body and is captured by the lantern, rendering them unconscious until the soul is recovered or the lantern is destroyed.
and I want a Midi-QOL macro to apply the incapacitated condition appropriately on the target. How do I do this?
Single target, on ST fail, for 3 turns
Figured out the incapacitated part. Still struggling with the overtime effect after 3 rounds to become unconcious
It works flawlessly!
What is the difference now then if I want to use this for a save ability?
So that if the target fails the save the user gains a resource? ๐ค
What if I do a Macro on effect Deletion? How do I write a macro so that the person with the effect gains the unconcious condition?
I'm sorry, I am very ignorant on this topic, but I'd love to have this item working
async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if (args[0].failedSaves.length === 0 && (args[0].failedSaves[0].value.actor.system.attributes.hp.value >= args[0].failedSaves[0].value.actor.system.attributes.hp.max)) return {};
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = game.actors.get(args[0].actor._id);
const target = canvas.tokens.get(args[0].failedSaves[0].id);
const itemD = args[0].item;
const gameRound = game.combat ? game.combat.round : 0;
const halfDamageHealing = Math.floor(args[0].damageTotal / 2);
await MidiQOL.applyTokenDamage([{damage: halfDamageHealing, type: "healing"}], halfDamageHealing, new Set([tokenD]), itemD, new Set());
const effectData = {
label: "Call the Blood Drain",
icon: "icons/skills/wounds/blood-drip-droplet-red.webp",
origin: args[0].uuid,
changes: [{
"key": "system.attributes.hp.max",
"value": `-${args[0].damageTotal}`,
"mode": 2,
"priority": 20
}],
disabled: false,
duration: { seconds: 86400, startRound: gameRound, startTime: game.time.worldTime },
flags: {
dae: {
specialDuration: ['longRest']
}
}
};
await MidiQOL.socket().executeAsGM("createEffects", { actorUuid: target.actor.uuid, effects: [effectData] });
const updateHP = target.actor.system.attributes.hp.max;
const the_message = `<p>${tokenD.name} drains ${target.name} of ${args[0].damageTotal} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${args[0].damageTotal} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
user: game.user.id,
speaker: ChatMessage.getSpeaker({ actorD: actorD }),
content: the_message,
type: CONST.CHAT_MESSAGE_TYPES.EMOTE
});
I tried to add your changes to the previous macro to this one but im doing something wrong๐ค
shouldn't need a wait for creating a chat message
These are my versions
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = game.actors.get(args[0].actor._id);
can just be
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = tokenD.actor;
also if you want the full name, should go off the actor's name. The token name is always the prototypes name. Unless you're not using token mold.
Remove the .value after the failedSaves[0]
And make the changes Crumic suggested
I haven't gone through the whole macro. There are things that should be changed
In all places?
I count two instances
I've also had args[0].uuid, fail on me. args[0].itemUuid is more dependable
Well those are removed now and the
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = game.actors.get(args[0].actor._id);
has been changed to
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = tokenD.actor;
or could do args[0].uuid || args[0].itemUuid
so if one is null, it'll fill in. it's the samething
const tokenD = args[0].workflow.token;
const actorD = args[0].actor;
const targetD = args[0].failedSaves[0]
two questions, if i want to create an effect that absorbs a damage (for example if creature takes fire damage absorbs half of it) what i would need to do and if i want to add "reflects damage back to the attacker" like armor of agathys if is possible?
Retribution sample item from the MidiQOL compendium is your how to for the reflect damage back
Absorbs meaning that is healed by that or resistant to the damage?
Do you mean to change
const tokenD = canvas.tokens.get(args[0].tokenId);
const actorD = tokenD.actor;
const target = canvas.tokens.get(args[0].failedSaves[0].id);
to
const tokenD = args[0].workflow.token;
const actorD = args[0].actor;
const targetD = args[0].failedSaves[0]
?
Yes
healed by the damage
Check absorption midi flags
okay
Is it me or something off on the MidiQOL screenshot and the version is not shown?
Anyway I had made a macro for that, which I checked on the latest versions of MidiQOL and DAE
I can share later
Or use target and not targetD
Whatever you use later in the macro
async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if (args[0].failedSaves.length === 0 && (args[0].failedSaves[0].actor.system.attributes.hp.value >= args[0].failedSaves[0].actor.system.attributes.hp.max)) return {};
const tokenD = args[0].workflow.token;
const actorD = args[0].actor;
const targetD = args[0].failedSaves[0]
const itemD = args[0].item;
const gameRound = game.combat ? game.combat.round : 0;
const halfDamageHealing = Math.floor(args[0].damageTotal / 2);
await MidiQOL.applyTokenDamage([{damage: halfDamageHealing, type: "healing"}], halfDamageHealing, new Set([tokenD]), itemD, new Set());
const effectData = {
label: "Call the Blood Drain",
icon: "icons/skills/wounds/blood-drip-droplet-red.webp",
origin: args[0].uuid,
changes: [{
"key": "system.attributes.hp.max",
"value": `-${args[0].damageTotal}`,
"mode": 2,
"priority": 20
}],
disabled: false,
duration: { seconds: 86400, startRound: gameRound, startTime: game.time.worldTime },
flags: {
dae: {
specialDuration: ['longRest']
}
}
};
await MidiQOL.socket().executeAsGM("createEffects", { actorUuid: target.actor.uuid, effects: [effectData] });
const updateHP = target.actor.system.attributes.hp.max;
const the_message = `<p>${tokenD.name} drains ${target.name} of ${args[0].damageTotal} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${args[0].damageTotal} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
user: game.user.id,
speaker: ChatMessage.getSpeaker({ actorD: actorD }),
content: the_message,
type: CONST.CHAT_MESSAGE_TYPES.EMOTE
});
I think I fixed what you said ^
await args[0].actor.update({"system.resources.legres.value": args[0]. actor.system.resources.legres.value+1})
^ Can I use this?
To make this macro also give resources ๐
Yeah
Where would be the best to add it? I always seem to missplace it
You can put it in the end, or pretty much wherever ๐
The const item might be undefined though
What version of midi are you on?
And probably in the first conditional you probably need to use || instead of &&
Ok you can use const sourceItem = args.item; then
Or however you want to call it
my Midi is 10.0.37
I'll keep my eyes open ๐
enable roll automation is off on the players client, not account, they have to confirm it on their end.
you are behind in versions, the two newest dae/midi's are the most stable releases, update.
ah I will do this thanks ๐
Take this for a test drive ```js
if(args[0] === "onUpdateActor") {
const {originItem, targetActor, options:{dhp}} = args[args.length -1] ?? {};
if (dhp <= "0") return;
else {
const effectData = {
changes: [
{key:'system.bonuses.abilities.save',value:'+1d4',mode:2},
{key:'system.bonuses.msak.attack',value:'+1d4',mode:2},
{key:'system.bonuses.mwak.attack',value:'+1d4',mode:2},
{key:'system.bonuses.rsak.attack',value:'+1d4',mode:2},
{key:'system.bonuses.rwak.attack',value:'+1d4',mode:2}
],
origin:originItem.uuid,
label:originItem.name,
icon:originItem.img,
duration:{seconds:8},
flags:{dae:{specialDuration:['turnEndSource'],stackable:'noneName'}}
}
await targetActor.createEmbeddedDocuments('ActiveEffect',[effectData]);
}
}
else {
const lastArg = args[args.length-1];
const sourceToken = canvas.tokens.get(lastArg.tokenId);
const sourceActor = sourceToken.actor;
const sourceItem = lastArg.efData.parent;
const flagValue = getProperty(actor, "flags.dae.onUpdateTarget") ?? [];
if (args[0] === "on") {
const onUpdateData = {
filter: "system.attributes.hp.value",
sourceTokenUuid: lastArg.tokenUuid,
sourceActorUuid: lastArg.actorUuid,
targetTokenUuid: lastArg.tokenUuid,
origin: sourceItem.uuid,
macroName: ItemMacro.${sourceItem.name},
flagName: ${sourceItem.name}
};
flagValue.push(onUpdateData)
await sourceActor.setFlag('dae','onUpdateTarget',flagValue);
}
if (args[0] === "off") {
const flagValue = (foundry.utils.getProperty(sourceActor, "flags.dae.onUpdateTarget") ?? []).filter(onUpdateData => onUpdateData.flagName !== ${item.name});
await sourceActor.setFlag("dae", "onUpdateTarget", flagValue);
}
}
Create a DAE on the Item, with transfer to actor on equip and an effect for macro.itemMacro | Custom |
Let me know, if you increase the HP of the actor twice in a row, what does happen?
@modern badger Version two, thanks to thatlonelybugbear. Put the following macro on the weapon, midi OnUse macro set to call ItemMacro for All passes; give it limited uses however you want that to be set up, 4 per day, charges with a recovery of 1d4, I don't remember. I think I changed like four things from thatlonelybugbear's example so really all the credit goes to them.
const {macroPass,isCritical,workflow} = args[0] ?? {};
if (!macroPass || !item || !actor || !workflow) return ui.notifications.error("Error with item");
if (macroPass === "preItemRoll") {
workflow.config.consumeUsage = false;
workflow.config.needsConfiguration = false;
workflow.options.configureDialog = false;
return true;
}
else if (macroPass === "DamageBonus") {
const charges = item.system.uses.value;
if (!charges) return;
const labels = ["None", "One", "Two", "Three", "Four"];
const content = `<center>How many charges? Available: ${charges}</center>`
async function dialogAsync(){
return await new Promise(async (resolve) => {
new Dialog({
title : "[[REPLACE ME WITH THE NAME OF THE FEATURE]]" ,
content,
buttons: Array.fromRange(Math.min(5,Number(charges)+1)).map(i=>({label:labels[i], callback: (html) => {
resolve(i);
}}))
}).render(true);
})
}
let damageDice = await dialogAsync();
if(!damageDice) return {};
await item.update({"system.uses.value": charges - damageDice});
const damageFormula = new CONFIG.Dice.DamageRoll(`${damageDice}d4[piercing]`, {}, {
critical: args[0].isCritical ?? false,
powerfulCritical: game.settings.get("dnd5e", "criticalDamageMaxDice"),
multiplyNumeric: game.settings.get("dnd5e", "criticalDamageModifiers")
}).formula
return {damageRoll: damageFormula, flavor: "[[REPLACE ME WITH YOUR DESIRED FLAVOR TEXT]]"};
}```
I'm sure someone else could pick it apart and tell me better ways to do everything but JS is not my native language and Foundry is not my native environment, haha.
Wait how do I make Discord do syntax highlighting?
```js
Code here
```
What is the description of this item?
I think they posted a li'l screenshot of it but I don't remember the exact text; the gist is that when you hit with the weapon, you can expend a number of charges to deal an extra 1d4 piercing damage per charge.
Take a look at this <#1010273821401555087 message>
You can get away with no actual updates to the Item. Use instead a DamageBonus macro
Unrelated to adapting this to that person's use case, just for my own education, but why are you calling update on args[0].actor.items.getName(item.name) instead of just item?
no reason at that point. Remnant of older reused code
Gotcha, gotcha.
Although it needed a small change to define item properly. And with the newer MidiQOL you can also define it as args.item
Hi folks. Once again in need of some help ๐
I am trying to automate a cursed item:
Curse. This item is cursed. When you hit a creature with an attack, you also take 2d10 necrotic damage and must succeed on a DC 15 Constitution saving throw or have disadvantage for 1 hour on any ability check or saving throw that uses Strength or Constitution. You are unwilling to part with the staff until the curse is broken with remove curse or similar magic.
So far, I have the cursed weapon and made the curse a separate feature item that I thought to roll via OnUse ItemMarco (checking if hitTargets.length > 0 and then do a item.roll).
I added a active effect to the curse item that handles all the disadvantages and gets applied on a failed save. So far, when testing, this part works.
What does not work is the 2d10 damage to self from the curse. If rolled for a save, midi handles the roll, but I have to manual roll the damage and it does not get applied to the actor. What am I missing?
Oh, and if anyone has a good idea how to handle the magic weapon that has been cursed, I'd appreciate it. So far I am using Magic Item module and added a spell item handling the charges, but I was considering to butcher some macros and go the OnUse route:
This staff has 3 charges and regains 1d3 expended charges daily at dawn.
The staff can be wielded as a magic quarterstaff. On a hit, it deals damage as a normal quarterstaff, and you can expend 1 charge to deal an extra 2d10 necrotic damage to the target. In addition, the target must succeed on a DC 15 Constitution saving throw or have disadvantage for 1 hour on any ability check or saving throw that uses Strength or Constitution.
When I make cursed permenant items, I just put a trap item on my avatar to roll on the user the first time it matters cause the players almost immediately sus it out and I don't see a point in masking the permenant item. I put the description of the cursed item in the trap item on the avatar and copy/paste it after the "trap has sprung"
Is the curse damage always on, or when you use a charge for the extra damage?
You also don't need a secondary 'cursed' Item. You can put all the logic in an onUse macro, triggered when using the original Staff
Yeah I never considered putting the nasties in the itemmacro but itโs perfect as the player wonโt have a clue
CPR's potion of poison is a great example of a hidden item
the curse damage is "always on" as long as the attack hits a target. ,
Yeah, I know... well, it came with a big "better not steal these ominous items from the dead dude who dabbled in dark stuff" warning, which my players totally ignored. The player who chose to use the item totally loves it, that it is cursed and really goes all in RPing the "not parting willingly" part while the rest of the party is not onto it being a cursed item. And as we enter a dungeon crawl, I thought to automate what originally was just meant to be a MacGuffin.
ok let me crunch some numbers
Kind of offtopic but I am very curious how powerful the staff attacks are to warrant dealing 2d10 damage to self!
For the Cursed Item. Add this as a MidiQOL item onUse ItemMacro | After Active Effects ```js
if (!args[0].hitTargets.length) return;
const itemData = duplicate(args.item);
delete(itemData.flags['midi-qol'].onUseMacroParts);
delete(itemData.flags['midi-qol'].onUseMacroName);
itemData.flags.midiProperties.fulldam = true;
itemData.system.target = {value: null, width: null, units: null, type: 'self'};
itemData.system.actionType = "other";
itemData.system.damage.parts = [['2d10','necrotic']];
itemData.system.save = {ability: 'con', dc: 15, scaling: 'flat'};
itemData.name = "Cursed "+args.item.name;
itemData.effects = [{
changes: [
{
"key": "flags.midi-qol.disadvantage.ability.save.con",
"value": "1",
"mode": 0,
"priority": 20
},
{
"key": "flags.midi-qol.disadvantage.ability.save.str",
"value": "1",
"mode": 0,
"priority": 20
},
{
"key": "flags.midi-qol.disadvantage.ability.check.con",
"value": "1",
"mode": 0,
"priority": 20
},
{
"key": "flags.midi-qol.disadvantage.ability.check.str",
"value": "1",
"mode": 0,
"priority": 20
}
],
label: "Curse - "+args.item.name,
duration: {seconds:3600},
icon: args.item.img,
origin: args.item.uuid,
flags: {dae: {stackable: 'noneName'}},
transfer: false
}];
const pseudoItem = new Item.implementation(itemData, { parent: args[0].actor });
await MidiQOL.completeItemUse(pseudoItem)
I would expect it only to happen if you expend a charge to deal more damage to the target.
And probably I would also expect it to force the wielder to use as many charges as it has with maybe a high CHA save to avoid.
But that's me and barely on topic too ๐
This staff has 3 charges and regains 1d3 expended charges daily at dawn.
The staff can be wielded as a magic quarterstaff. On a hit, it deals damage as a normal quarterstaff, and you can expend 1 charge to deal an extra 2d10 necrotic damage to the target. In addition, the target must succeed on a DC 15 Constitution saving throw or have disadvantage for 1 hour on any ability check or saving throw that uses Strength or Constitution.
It's from a community made side-quest supplement for my current campaign and I never intended it to be a serious item, just a plot device and something to teach the rookies in my group that there are cursed items, so better not to fiddle with everything you can get your hands on, if your cleric is not prepared to beg their goddess to save your sorry asses. So there was not much thought about how to balance it. It's only now that the Tabaxi Monk player deems that the staff is her new toy, because the old one got boring and it's really sweet to play out that I've been thinking about it. And I think I will take thatlonelybugbear his idea and modify the curse a bit.
Anyhow, thanks for the macro ๐ Will study it to learn for futures use cases
No worries.
How do you deal with the charges? You can incorporate that in the same macro if you don't mind a dialog pop up when the player attacks, asking if you want to expand a charge (if one is available).
First thought was to use Magic Item module, but adding in to the macro seems smart. And now that you planted the idea in my head, I am really thinking of redesigning the curse and the workflow ๐
So it would be: roll attack > hit ? > CHA save for 1x (3x?) forced charge > apply weapon dmg to target > amplified dmg to target and self > CON save target/self for disadv AE ?
Hahaha yeah it can be done like that more or less.
I can work something out later when I have time ๐
Reposting my question here from #dnd5e:
Does anyone have any advice on automating the Path of the Totem Warrior's Wolf Totem Spirit (grant advantage for allies attacks against enemies adjacent to you) in Foundry?
I tried to set it up with MidiQOL + DAE + Active-Auras and have an aura that sets the midi-qol.grants.advantage.attack.mwak/swak fields for adjacent enemies. That works, but the issue is it applies advantage for everyone (including the barbarian). Is there another way I can approach this?
I believe Active Aura has an include or exclude self checkbox?
That only applies for activated auras not persistent passive auras fwiw
Works fine for me, just still shows on the character sheet
Like the active effect is there, the effects don't seem to be
is it rolled?
If I try and make an attack with the triggering barbarian they still are listed as having advantage.
Just passive
if its transfer on equip, you can't stop it from applying to the source actor
Try this box for your aura
The active effect will show, but in my testing, does not give the actual effects
what is the effect
on the source actor it doesn't show on the sheet but will show in the mods
This checkbox does work, you're right. But what are the effects you have in this to make it give advantage only to enemies adjacent to the barbarian?
Oh, only adjacent? I'd probably just give it a... what, 2.5 feet radius?
So it's just the squares next to them
Wolf. While you're raging, your friends have advantage on melee attack rolls against any creature within 5 feet of you that is hostile to you. The spirit of the wolf makes you a leader of hunters.
This is the feature I'm trying to implement.
So any allies of the barbarian (regardless of distance) get advantage against enemies adjacent to the barbarian.
have it set to hostile, and a grant advantage flag
Yupp, that's what I did. But that gives advantage to the barbarian too. Once the grant advantage flag is set I don't think the "apply to self" is relevant any more.
make it use an evaluation all allies not named bob
instead of 1 in effect value look up activation conditions
would something on the line of OnUse Before Attack roll > midiQoL.findNearby(target / distance 5ft ) > check result for barbarian > alter roll, grant advantage work? would have to add it to all allies, so nah, would not work ๐
it'd be easier to just put an evaluation in the key since you gotta do a 1 there anyway
Oh! I can put an evaluation into the midi flag?
yep
This should solve it, thanks everyone!
if its a hostile effect though, you need to make sure that midi doesn't try to transfer the aura to everyone
No aura. Wait I should read this. Why an aura?
nm its an aura not a template
Everyone within 5ft of the origin actor thats hostile should get a grant advantage flag with an evaluation to allies of the source actor that aren't named Bob(source actor)
I don't think 2.5 is gonna cut it cause diagonals are 5ft
Yeah I had it set to 5 before and it seemed to apply the aura properly.
I was just missing the evaluation in the flag.
As Moto mentioned, it's an aura because it applies to all enemies within 5 feet of the barbarian.
is the aura activated?
If you feel like it, I would much appreciate it. But no stress โบ๏ธ
This seems like it should be something easy to do but for the life of me I can't get it to work. I looked through the midi documentation and can't seem to find the answer either. How would I properly evaluate the attacking actors name in the flag? I've tried a few iterations of the attached image but can't get it to properly evaluate to false.
Custom not override
that evaluation is probably wrong too
Thanks! This should help. I 'll swap it to custom and take a look through these examples to see if I can get it working.
I got it working. I wasn't aware that it was the rollData that was being used in the evaluation not the entire actor. Thanks again for all the help @vast bane
Should it be one charge per use, after the CHA save, to make it less deadly or all 3 at once or should the user decide?
yeah, let's make it less deadly for both ends of the stick ๐
might I ask what UI module ur using for items? it pretty owo
That would be the tidy5e sheets module: https://github.com/sdenec/tidy5e-sheet
used it and it works perfectly :3 I love that it separates the damage rolls and lets u add flavor text, thankye v much!
I have tidy5e and mine don look like that .3.
ooooooooooh
there's a separate option for item sheets
๐
ye!
yeah.. there are a couple separate default sheets ๐
sooooo try this as an Item MidiQOL onUse ItemMacro | All
Oops wrong reply
Ah lol it was almost a correct reply ๐
Staff of Decay homebrew.
The staff can be wielded as a magic quarterstaff. On a hit, it deals damage as a normal quarterstaff, and you can expend 1 charge to deal an extra 2d10 necrotic damage to the target. In addition, the target must succeed on a DC 15 Constitution saving throw or have disadvantage for 1 hour on any ability check or saving throw that uses Strength or Constitution
Curse. This item is cursed. When you hit a creature with an attack, you are forced to spend a charge or try to fight it (CHA save DC15).
If you spend a charge willingly or fail the save, you also take 2d10 necrotic damage and must succeed on a DC 15 Constitution saving throw or have disadvantage for 1 hour on any ability check or saving throw that uses Strength or Constitution. You are unwilling to part with the staff until the curse is broken with remove curse or similar magic.
In the macro below you need to add a || !target in the check to return in the last macroPass for postActiveEffects.
The Staff should have its details page more or less like so
The 2d6[necrotic] secondary damage formula is there by mistake. No need to provide any extra damage info or save.
It will do 2d10[necrotic] when needed, doubled up for a crit hit as is right now.
Also check the Full Dam Save box in the bottom MidiQOL Item Properties
That was freaking fun ๐
Thank you sooo much ๐
Let me know if it works ok, as this might have some issues with different MidiQOL settings
Will do. Have to leave atm, but I sure will test it tonight.
how do you do this? i copied the macro in the small On Use Macros Field under Midi qol Fields... but nothing seem to happen...
when i click on item Macro at the top of the spell (besides DAE) there's no entry, is that fine?
paste the macro into them
I actually don't think the macro works after learning more about macros
I think that macro only works on owned tokens
Needs a midiqol function to delete other tokens effects, or to run as GM via advanced macros
not really worth the hassle i think
just found your macro via the search option, so i thougt it was working ๐
make the effect 6 second duration
change the definition of targetedToken to token
if you change the definition of targetedToken to token and put it in an effect macro that lesser restoration applies to a target token, then it should work
This lets you get past editing unowned tokens by leveraging midi's effect transfer to get to the token and then run it on the target actor, I think the dialog will pop up on the target owners screen though
little fast for slow me ๐ but will try that...
alternatively the e.delete function needs to be changed to MidiQOL.executeAsGM
Delete this line:
let [targetedToken] = game.user.targets.values();
The next line down change it to:
let availableValidEffects = token.actor.effects
This should be put in on creation Effect Macro(this is a module, Effect macro)
Lesser Restoration, Effect macro On creation.
let VALID_EFFECT_LABELS = ["Blinded", "Deafened", "Paralyzed", "Poisoned"];
let availableValidEffects = token.actor.effects
.filter(e => VALID_EFFECT_LABELS.includes(e.label))
if(availableValidEffects.length < 1){
ui.notifications.warn("No conditions exist on this creature which are removeable by Lesser Restoration.");
return;
}
let dialogButtons = availableValidEffects
.map(e => Object({
label: e.label,
callback: () => {e.delete();}
}))
let dialog = new Dialog({
title: "Lesser Resoration Condition Selection",
content: ``,
buttons: dialogButtons
})
dialog.render(true);
@sleek glacier
You can replicate this with greater restoration and Heal as well removing even more effects
hmm have the module installed XD but not sure where to insert it ๐ edit the spell, right Effect section and add a temporary effect?
yeah i got it ๐
party... had to choose which effect too, thats really nice thyvm ๐
ok. i'm a little bumfuzzled. I'm trying to automoate this: When a creature the thug gang boss can see targets it with an attack, the thug gang boss chooses an ally within 5 feet of it. The thug gang boss swaps places with the chosen ally, and the chosen ally becomes the target instead.
Would this be a plain old reaction with an ItemMacro? A DAE macro, onUse macro? how would I even start. Basically, I want it to interrupt the workflolw, swap tokens, retarget the new token, and continue the workflow. Just not sure where to call the reaction or the ItemMacro.
I think I got staggering smite to work correctly.
i can see how @scarlet gale swapped tokens in his Bait and Switch automation. Just thought I might be able to adapt that.
I really need to learn how to move tokens with a prompt. I got like 3 things I want to automate that way.
thorn hawip and a custom grappling hook weapon that pulls a target towards the attacker
@molten solar You told me to check here for the macro?
Hmm... so far, the dialogAsynch does not seem to get triggered and during the course of the workflow 2x1 charges are used, one at the beginning and one at the end. Will add some debug logs to see if I can trace the workflow.
Other then that, damage and ae are being applied just fine ๐
DMing you an Item export
So, I need some help.
I have this macro @molten solar wrote for me. It checks if the attack roll was 10 or more over the target's AC, then adds an extra damage dice to the damage roll. I need to modify it so it checks if the attack roll was 5 or more over the target's AC, then roll an extra damage dice at the start of each of the victim's turn. This effect should end when the victim rolls a successful Constitution saving throw against the DC set in the weapon's details.
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);
The effect is called Wound. When a character attacks with a wound weapon and the attack roll is at least 5 higher than the target AC, the target takes an additional damage dice in damage at the start of its next turn. At the end of its turn, it can roll a Constitution saving throw against the source actor's Weapon DC, which is 8 + prof + STR/DEX. I can set that DC in the weapon's details.
```js
code here
thanks
Have your macro create a midi overtime effect on the target
Can you help me with that
Actually, that wouldn't work, the condition damage is dependent on what item gave that condition to the target.
As Chris mentioned, this sounds like OT. Base it on the Life stealing item in the MidiQOL samples
Iโm just trying to process that Zhell wrote a midi macro
That seems like something Chris would write tbh ๐
Yeah if the overtime AE is on the item the damage can be whatever you like for that particular item
setDamageRoll() ?
all of the 3 last lines
Is that a known Item? I could give a title if others might need it, to be found easier with a search
It was called 'Staff of Decay' and pretty sure it was a homebrewed MacGuffin. So, I guess, not many will search for this item explicitly. But the solution to the curse mechanic is quite neat. I hope someone finds a use for that.
Someone pinged Zhell in midiqol, thats asking for some serious wrath.
That can't be a chris macro because it doesn't have excessive use of this
Dรฉjร vu
holy cow, league swooping in and saving foriens unidentified items
I asked up in #513918036919713802 whatโs going on as there are no update notes. Did anything significant change? It was pretty buggy last time I tried it
No response yet
its a league revival so probably just manifest fixed
Itโs been with the league for a while yeah
I should be able to tell pretty quickly if itโs been fixed. The issue we had was the window that you drag the masking item into would only work occasionally
honeybadger is still teasing us with a little wait before their module that should handle a lot of the same usecases
archon was the codename unsure if that will be end name, for when you need to scour package-releases
Super looking forward to that. I also really hope the system implements it though, then it might get used in official adventures
https://youtu.be/Ba4hhwD2to8 its coming along ๐ need the unmask function now
Of course you went straight to using it for nefarious purposes
@empty fable here.
test
now it works. gonna post again then:
A player of mine obtained a magic item from Griffon's Saddlebag and its ability feels rather complicated for me to automate.
So i want to ask if anyone can help me set it up so the feature of the weapon automatically gets rolled for etc.
Item for reference:
"You gain a +1 bonus to attack and damage rolls made with this magic weapon. When you hit a target with this weapon, you can choose to roll a second d20 before calculating the weapon's damage. If you roll an 11 or higher on the second d20, the blade magically seeks out and hits the weakest point of the target, turning the attack into a critical hit. On a roll of 10 or lower, the blade ricochets harmlessly off the original target and scores a critical hit against you, instead. When the axe hits you in this way, its damage ignores resitances and immunity."
I took the greataxe item from the compendium and modified it to be a magical +1 greataxe. so far so good but now i have no idea on how to implement the feature that comes with the item.
Do you actually have midiqol?
I don't think any player would use that item past the first attack with it though so are you sure you want to automate it?
With reaction features, is there a way to use the activiation condition to check if the trigger was a ranged attack?
Bugbears been sharing this a bunch, its now possible with the latest midi's but I don't recall the code to use.
search for isAttacked
i do have midiQOL and all i want to automate is a that a request is being sent as to wether he wants to use the feature or not and if he does then it should prompt him to roll 1d20. the targeting and auto crit we can do manually.
Not yet.
For now you will need a macro. Essentially you create an Item:
a. Reaction Manual,
b. Item onUse MidiQOL macro: ItemMacro | After Active Effects
and a DAE on the Item with:
- transfer to actor on item equip,
- Effect:
flags.midi-qol.onUseMacroName | Custom | ItemMacro,isAttacked.
Paste this macro in the Item Macro: ```js
//Midi 10.0.41 verified
if (args[0].macroPass == "isAttacked") { // this will be executed when the actor with the onUseMacroName flag isAttacked.
const { [0]:{ workflow:{item:attackingItem} }, item:reactionItem } = args ?? {};
if (attackingItem.system.actionType == "rwak") {
const activation = duplicate(reactionItem.system.activation)
activation.type = "reactiondamage";
await reactionItem.update({"system.activation":activation});
return true;
}
else return true;
}
else { // this will be executed when the Reaction Item is used, After Active Effects.
const reactionItem = args.item;
const activation = duplicate(reactionItem.system.activation)
activation.type = "reactionmanual";
await reactionItem.update({"system.activation":activation});
}
Oh shite. Nope. Will need to change it
@gaunt python ๐
sneak edit
// MidiQoL Item OnUse Macro v1.0
const sourceActor = args[0].actor;
const sourceItem = args[0].workflow.item;
if (!args[0]) return ui.notifications.error("Notify GM: Deselect Item Hooks options in Item Macro module settings or use the macro as a MidiQOL Item onUse macro, with a trigger All");
async function dialogAsync() {
return await new Promise(async (resolve) => {
new Dialog({
title: `${sourceItem.name} feature request`,
content: `Dare to let the magic guide your swing?`,
buttons: {
1: {
label: "I dare!", callback: () => {
resolve(1);
}
}, 2: {
label: "No, let's be save.", callback: () => {
resolve(2);
}
}
},
close: () => {
resolve(0);
}
}).render(true);
});
}
let choose = await dialogAsync();
if (!choose) return;
if (choose === 1) {
const flavor = `Magic guide my hand`;
let roll = await new Roll('1d20').roll();
await game.dice3d?.showForRoll(roll,game.user,true)
if (roll.total > 10) {
ChatMessage.create({content: `${sourceActor.name}` + " chose to let the magic guide their strike. Their bravery is rewarded with a roll of " + `${roll.total}`});
} else {
ChatMessage.create({content: `${sourceActor.name}` + " chose to let the magic guide their strike. Their folly is punished with a roll of " + `${roll.total}`});
}
}
if (choose === 2) {
ChatMessage.create({content: `${sourceActor.name}` + " chose not to trust the fickle magic. We will never know if this was wisdom or cowardice."});
}
(Search terms: War's Wager, Griffon's Sattlebag)
Oh I like the repurposed macro ๐
Add it to the item and set the OnUse to "Before Attack Roll".
And thank bugbear for teaching me stuff xD
ps: no need to remove the line await game.dice3d?.showForRoll(roll); //remove this line, if no 3D dice are used.
it will just do nothing if no DSN is used https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
Though needs to be ```js
await game.dice3d?.showForRoll(roll,game.user,true)
wow can I get this by default for all lol
Is it possible to make a world script that puts an active effect on players when they finish a long rest?
I'm trying to come up with a hands free no hassle way to track when they last benefitted from a long rest
right now I have to constantly check my session posts to remember the time of day it happened on
Sounds like a FR for Rest Recovery 5e?
Hooks.on('dnd5e.restCompleted', (actor,result) => {
if (result.longRest) game.dfreds.effectInterface.addEffect({effectName:'long rest completed',uuid:actor.uuid})
})
is that long rest completed or any rest?
wow! thanks
Does the Roll Groups (https://github.com/krbz999/rollgroups) module work with MidiQOL?
no
Aw
Is there something like it that will work?
I don't like having to redo the item description every time I use a flametongue greatsword for example
Choosing whether a weapon deals a certain kind of damage
I think you need to fix your name here before you get yelled at btw
I think it's funny
They won't
Fine
Doesn't a flame tongue just deal regular damage plus some fire
only when its ignited
Yes, but you have to activate it first
oh, my flametongue I did lazy
I just have the bonus action feature that gives them a bonus to mwak damage
With advantage reminder
babonus territory perhabs?
Fair enough. In the absence of roll groups, I would just make 2 swords. But the second is weightless and includes the fire damage.
probably, I never know how to do babs, I just take ones given to me lol
Mwak?
Melee weapon attack
so true ๐
I handle the flametongue this way:
The first main item is the weapon, it has a transfer on equip macro.createitem that gives the bonus action feature
Bonus action feature rolls to self and applies an ae that gives a light and adds the advantage reminder message to the actors mwak damage popouts. My setup only works if you don't fast forward and install advantage reminder.
I really need to add the VAE button for that item
I'm sure theres a more automated method
An Optional BAB might be really good for this actually
it'd probably be in the form of a dae item macro warpgate on the sword
optional bab is not compatible with midiqol fast forward
Just add an AE for the extra damage and enable disable it accordingly
You said you arent fast forwarding
Ah strike that
good point, I return to this statement however:
it'd still wind up being something I make on an ae, so since I already made it with AR, no sense in doing extra work
What GS item is it? I will add its name to the macro, just in case someone else is looking for it.
Put the damage on other formula . Activation condition false.
It will not roll it
Do you ever actually use the sword with 2 hands? If not just set the damage as Versatile
Make it true and it will roll
War's Wager
Piece of cake
@gaunt python im also having trouble implementing your macro. i put it onto the item macro scrip section but when trying to execute the macro or test it out with the attack it does nothing. is there anything i have to change in the script?
And with BAB:
console errors?
So many options and none require fiddling with macros for hours
VM52656:4 Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'actor')
[Detected 1 package: itemacro]
at eval (eval at Item._executeScript (helper.js:82:18), <anonymous>:4:37)
at Macro.eval (eval at Item._executeScript (helper.js:82:18), <anonymous>:47:9)
at Item._executeScript (helper.js:88:12)
at Item.executeMacro (helper.js:60:23)
at ItemMacroConfig._onExecute (ItemMacroConfig.js:43:10)
If the macro is sound, I'm pretty certain your issue is
hah
bam, mic drop
if you are a midiqol user, and you ever ever ever see an error in the console for itemacro you are midiqol'ing wrong.
Hi there,
Might be a Macro Polo question however does anyone know what I can add to rage so that if the actor is concentrating on a spell the concentration auto goes down? When they rage.
Midiqol hijacks the module Item Macro and turns it into a pure storage device and does NOT play well with its actual features
so remove item macro?
I find that auto ending conc is a very painful automation to use as it can be done accidentally and conc ending is not easily reversed, its better to always handle this with manual deletion of conc by the DM
the box is unchecked and not working, thats why i was asking if it needs to be removed.
Alternatively, janky solution, make rage require concentration.
I forgot last night, and the Barb/Bard's suggestion spell ran on far too long after he started raging. I am getting old and forgetful ;-p
nah that wouldn't work it'd make you roll and end rage early
a message to chat helps
I do this with a bunch of spells
like Command
Fairly ๐ง move if you ask me
Although wouldnt you have to make it a spell
I would actually not make rage use conc
Or can you require Conc via AE
I'd make it toggle conc
if you make it use concentration, then suddenly rage makes con saves and ends early if you fail
if you make it have a macro.ce custom concentration then it will toggle it offf I think
or worse casew, add the toggle macro to it
If it were my game, I'd put an effect macro on rage, on creation, that is simply a chat message to everyone: "Hey delete conc on this barb cause lawl"
rage already has a macro on it so you can just append on the end using the same already defined variables to pull off the toggle effect, make sure you await the toggle
Have you set the OnUse Macro to 'ItemMacro' (case sensitive) and 'Before Attack Roll'?
dfreds CE gives you a proper toggle bane effect in a compendium
that was the issue, thanks!
actually easier solution @narrow saddle if you have effect macro, do an on creation effect macro on rage to just delete conc
you already own the ae, so theres no point in leveraging midi or dfreds
let effectNameFallBack = "Shield Master" //Define the name of your shield master feat
let effectName = actor.effects.find(e => e.label === effectNameFallBack); // Find the effect with the specified name
if (effectName) { // Check if the effect was found
await effectName.delete(); // Remove the effect
ui.notifications.notify(`Removed ${effectNameFallBack} effect from ${actor.name}.`); // Show a notification with the name of the removed effect
} else {
ui.notifications.warn(`${actor.name} does not have ${effectNameFallBack} effect.`); // Show a warning if the effect was not found
}
change Shield Master to concentration
I have EM for Chris' module.
Put this in rage's on creation field in effect macro, change the name
if you don't like the notifications umI think you can just delete them
to remove them take out all the ui lines and then after the effect.delete line follow up with a singular }
to close out the if statement
this will only work as an effect macro as I'm not defining actor, instead just leveraging an EM helper
at the current state, the attack continues normal as soon as the choice is made. I will see, if I can learn some more to make it actually react to the result.
Just testing it now.
HEADS UP
This thread's member limit has been reached - no additional users may join this thread.
If you are not active here, consider leaving the thread to make room for others in the short term.
This is the time to establish an official auxiliary server for Midi-QOL automation
I will pin links in this thread and the dnd5e thread for said server, please let me know.
@gilded yacht I want to alert you specifically, as your preferences/input are important here.
Could just archive the thread and make another so that all the lost content is still searchable within dnd5e. That will more quickly remove the dormant users and make room.
i'd like to find a more permanent solution
so with the removal of this thread, its not safe to talk about the module in the other 3 threads yes?
this thread hasn't been removed yet, and just as any other module, once domain specific knowledge is needed, we'll point to the appropriate aux server
It seems it's high time for this to be dealt with once and for all ๐
this was always a solution for the non midi users
Foundry Gearheads could be a solution, if tposney doesn't have the time to deal with it completely.
it already exists, its not going to effectively divert traffic away from the other channels. this was a more effective method imo
it will when instead of pushing here, we push to the other server
just like every other large module
We do really need a Midi server separate to Foundry so that folk who really really hate Midi can choose not to join it.
every other large module is allowed to be talked about in the other channels
and midi is as well, then we point to this thread for the best help
just happens to be midi does so much, basically anything midi needs to go in a specific midi context
furthermore, when its contained within foundry's channels, we'll punt immediately
notice how DDB and any ripper module is handled? help is provided until stuff gets weird, then moved
I asked in DND5e about the concentrating solution, that you have provided for me Moto, and was told to come here because I use Midi for concentration automation.
I mean I'm here, so I won't ship them off to another discord, the whole reason for ddb and levels getting shipped is cause no one knows the solution
and you dont need to ๐ moderators are here for redirecting
maybe just give a role to the midi helpers so they can create a thread so it doesnt drown out the channels?
helpers can create threads already
Honestly it's not gonna be particularly elegant. There are plenty of Midi users that will happily offer advice in #dnd5e or #513918036919713802, and that will generate a lot of posts which can drown out other queries. The question becomes do you ban talk of it altogether? Draw an arbitrary line somewhere?
Id just archive this thread and make a new one, cause ultimately this was never about us, it was about the other users who didn't want us there
no one is banning talk ๐ฉ all day every day, moderators see a convo drift, and nudge to a better location
It's also an unusual case of telling a mod to get it's own discord, as opposed to the creator wanting to create one ๐ค
despite what you may think, this was all to make sure midi users get the best help
A nudge is a polite way of saying, talk about that somewhere else
ok, but I'm honestly shocked the anti midi people aren't chiming in lol cause this is gonna be real apparent to them shortly that they didn't want this solution lol.
We are just recognizing that the level of support needed for this module has outgrown all of the considerations that we have reasonably made to accommodate it.
We aren't banning talking about midi, we aren't expecting everyone to move over, we are just saying that the needs of that community have outgrown what we can reasonably provide, in being consistent with how we handle all other modules here.
Well I don't imagine the thread will go anywhere, but it's not that useful for new people
anyone anti-anything here will be (as has been) addressed
You 100% percent have that backwards. This thread was not created out of spite, it was made so that there was a clear place for users to receive support, due to the high demand for it.
I'm all for this change, I'm just looking down the road at the obvious implications in #macro-polo #513918036919713802 #modules and #dnd5e when a broom can't be employed and I offer a solution to someone in them. I really don't think the usuals in those channels are going to like the uptick in midiqol conversations.
you can let the mod team worry about that ๐
The way I see it, it would be the same as MATT or BW: Sure, you can ask in #dnd5e or #513918036919713802 , but you'll be directed to the appropriate servers pretty quickly. And knowing that the detailed help is more likely to be found there, the regulars will soon move over and the occasional midi question here won't cause too much trouble.
Sure, but the difference there is that Ripper and monk don't have people like me hanging out on this server ๐
It's not even close to the first time modules and systems made their own servers to manage support of them.
I genuinely am always lost with MATT so I never even try to help with those questions lol
Where do you go when you need help with it though?
CPR general discussion probably but I don't think Chris necessaruily wants to become the tech support for midi
For MATT?!
If its a macro I'd probably ask chat gpt/macro polo.
I don't use matt
I use an avatar and fire my traps from that with the override key pressed
I don't really think I have many problems with midi itself atm, its almost always macro related now
One ... Function. MidiQOL.trapworkflow and Note Macro ๐
there is a trapworkflow?? whaaat? ๐ต
I thought that was deprecated when trigger happy went bye bye lol
I use inline roll commands and an avatar actor with all my traps on them set as my assigned actor
this way I don't have to make a thousand macros and can just browse my avatar for a suitable trap to reuse
You will be surprised by how many things come along if you just type MidiQOL. or DAE. in console
if anyone does go my route, beware that inline roll commands does not like the tinyMCE editor so unassign yourself from your avatar during prep, and only assign yourself to the avatar in live sessions
when you try to edit a journal with an inline roll command on it, it will error out if you use TinyMCE.
that is where trap premades with TA & MATT come into play ๐
its due to how the image is made on the button
yeah all that seems really clunky
I just filter my avatar, find the trap that fits and put the command in
but maybe it works for you and thats fine, I just felt that it was alot of work to do macros or matt compared to just using midi+an avatar
I also do not like real time movement in dungeons, I have players who do not behave well with real time movement
All good. Not gonna kink shame here ๐
I am just a sucker for animated traps ๐คช
Oh I have animations but they are triggered by me, not my players who then claim they didn't mean to move somewhere
Ah, I see. Yeah... My players learned the hard way "you wildly drag your token around and play video game? you better be ready to reap what you sow" xD
Anyway, BTT
I use monks active tile triggers for that
Player ran down a trapped corridor
Rolled 4 saves and went unconscious inside an armed trap, players did not get him and took a different path
@violet meadow Trying to learn more from your macro, is there a way to make the completeItemUse(pseudoItem) used for the curse a private roll?
Never had this issue with removal, although if you're trying to remove conc after a failed condition within on. It does have some timing issues. Midi does offer a concentrating check and removal pre-built in.
You can add in a wait for 500 - 1000 on apply depending on server latency and it should see it fine
more of a style choice, its easier to just manually delete after everything is confirmed than to have automations end thanks to misclicks
I have been using the automation of concentration removal since forever.
Using it with NO + Damage Card and for the most part no issues.
Some macros might throw the workflow off but let's see the next iteration of workflow undo, for which tposney has worked out the concentration kinks ๐ช
Private roll? ๐ค
Or GM whisper?
You should be able to inject a change of rollType or something
I don't remember it off the top of my head, but can take a look when I am home
I know overtime does rollType
GM whisper would be more appropriate. Was trying to see, how to hide the curse part from the other players, but could not find (or more likely, lets face it: did not understand) in the midi wiki
Not something that I remember using before tbh
But you could change the message type
Like the chat message drop-down
Check the function and the midi code. It should have some indication of the parameters you can pass to it
Or ask in macro polo for a parameter when using the item.use()
MidiQOL will pretty much respect that
okay. will do. Thanks!
it is possible to create a macro or effect for automatic warding bond?
this is the spell
I'd suggest the warding bond in midi samples but its kinda old and may not be functional anymore
is it on the compendium?
I actually messed up, I was thinking of abjuration ward, warding bond is probably totally functional
okay gonna look at it
Yeah I think it was working fine last I checked.
I clopied for a MidiSRD version I was working on
I'm trying to get this Item Macro to roll the 'Eruption' item whenever these fists roll an 8 on the bludgeoning damage. I can't seem to get it to do so.
const eruptionData = game.items.getName("Eruption").toObject();
const pseudoItem = new Item.implementation(eruptionData, {parent: actor});
const results = args[0].damageRoll?.dice?.find(d=>d.flavor?.toLocaleLowerCase()==="bludgeoning")?.results.map(r=>r.result);
const res = results.includes(8);
if (res) await pseudoItem.use();```
I've got a problem, where midi only automates attacks for self targeted rolls..
I assume the Fiery Fists always deal bludgeoning?
Aye, they do
And I guess the Eruption is an effect the fists have on a max damage roll, yes?
Yup!
Share a screenshot of the console log of the relevant roll
Does results get you what you need as it is defined?
Nothin' in the console. I'll try log out the results
Nope, nothin' in the logs.
const eruptionData = game.items.getName("Eruption").toObject();
const pseudoItem = new Item.implementation(eruptionData, {parent: actor});
const results = args[0].damageRoll?.dice?.find(d=>d.flavor?.toLocaleLowerCase()==="bludgeoning")?.results.map(r=>r.result);
const res = results.includes(8);
if (res) await pseudoItem.use();
console.log(res);```
Not getting anything from this either.
console.log(results);
const eruptionData = game.items.getName("Eruption").toObject();
const pseudoItem = new Item.implementation(eruptionData, {parent: actor});
const targetRolls = [8];
const results = args[0].damageRoll?.dice?.find(d=>d.flavor?.toLocaleLowerCase()==="bludgeoning")?.results.map(r=>r.result);
const res = results?.some(r=>targetRolls.includes(r));
if (res) await pseudoItem.use();```
@violet meadow @narrow saddle @strong yew care to test this for me? It now maps ammo types to weapons, I have added a dark mode boolean at the top โ it should also be less annoying, if there's only one ammo left it will switch to it automatically and not present the dialog. Will leave the positioning thing for @short aurora's module since they can save window position in settings
I just did some tests
const results = args[0].damageRoll?.dice?.find(d=>d.flavor?.toLocaleLowerCase()==="bludgeoning")?.results.map(r=>r.result).includes(8);
does resolve to true or false accordingly. What is your ItemMacro Evaluation set to?
Good point. You need to have the dice roll results in, before executing this macro
So After Damage Roll at least.
I will sometime tomorrow. But I believe in you so ๐
that 24 hr deadline was weighing on me ๐
Amazingly brilliant.
I tested it with a longbow and two types of ammo, arrows and arrows +1.
Then added crossbow bolts to the inventory and those didn't show up as an option for the Longbow. ๐
Just trying to motivate people ๐
great! i've only really tested with crossbows and longbows, since we don't use firearms etc โ but don't see why it wouldn't work
@covert mason Try this and set the Evaluation to "After Active Effects":
console.log(args)
const hasMaxRoll = args[0].damageRoll?.dice?.find(d=>d.flavor?.toLocaleLowerCase()==="bludgeoning")?.results.map(r=>r.result).includes(8);
if(hasMaxRoll) {args[0].actor.items.getName("Eruption")?.roll()}
(quick'n'dirty. could be heavily sanitized, though ๐ )
Also unlike the previous version, if there is only one type of ammo available, you don't get a choice of one type of ammo. You just get what is available. ๐
@gaunt python@violet meadow
So this is embarrassing. I hadn't even turned on the On-Use macro, let alone set it to "After Damage Rolls"

Pardon me while I sit in the Corner of Shame โข๏ธ
Been there done that ๐

Look for Moto's initials under the bench ๐
See, as I still have much to learn, shall we consider this an exercise instead? ๐
Which brings me to my question: I cut the roll Eruption part short and skipped the pseudoItem part to just do a item.roll(), assuming the actor owns the item.
I guess the other way is if the item does not exist?
I'd intended to do it so the actor doesn't need the Eruption feature on their sheet.
I didn't want to clutter up the features.
Ah, I see.
how can i make a keen sense that works? it gives advantage on perception checks
im trying midiqol-flag advantage per but it doesnt work
It is an "item" you create only in memory
It's incredibly useful!
Wrong key
That is performance
prc
oooh that explains a lot
Neat. And is there any differences with that and .use() vs .roll()?
Try CONFIG.DND5E.skills in console
The way you pass the parameters in each one and .roll() will be deprecated sometime in the future
ah good to know. Gonna start checking my macros then, because I believe there are more than one that uses .roll() ๐
Also .evaluate() for Rolls instead of .roll()
Oh misread that
CompleteItemUse will be better most of the cases as MidiQOL will take care to wait for all the workflow to finish before continuing
https://gitlab.com/tposney/midi-qol#notes-for-macro-writers
Scroll down a bit for the midi function
Probably in the options syntax
You could probably bind an ammo selector with a shift key on the weapon.
Since ranged weapons don't tend to have versatile damage
Oh yeah I was thinking what key would be suitable and that makes a lot of sense, if midi doesnโt mind
I can send you the lib wrapper for the item use ammo selection.
It wouldn't mind. In the workflow under roll Options has the boolean for it
Yeah donโt remember at all now
I also asked if we can hide roll cards with item roll but cannot. So guess just delete it
Since if you variable out the last promise, it gives you the final workflow
Yeah you could delete it by the args[0].itemCardId easily, as a GM though, or socket it through as a player
Players can delete chat cards they own
Ah then easier
So shouldn't be an issue.. At least in my game they have been able to
๐
We did find out out if you blank out the id, it will 100% override the item stats
I had issues where if the previous item had No damage roll, you couldn't add one afterwards
The id of the message?
Id of the item
_id = "" worked but gave an error. Think latest midi fixes the issue
Cause without that it would say damage roll is not possible with this item
It was to save the dialog's position for next time you open it, right? If you don't want to wait, you can put the settings on the macro document by setting a flag with the window information and load it through the macro.
We should immortalize that moment lol its somewhere back there.
OH boy:
#1010273821401555087 message
Oh how I've grown?
I did consider that. I guess it could be an optional Boolean at the top also, I figured it was bad practice for a macro to be setting its own flag on an actor or user ๐คทโโ๏ธ
Macro's flags are set in a separate scope, so I'd say it's acceptable/expected. Can I steal your CSS with credit for the module? I've started, but I'm intending to design some basic GUI for all the stuff coded into the macro, so still no eta on when the module itself will be available for general consumption. >_>
GUI is the devil's work
Good to know, is there somewhere I can learn about flag scope? Or best just to ask in macro-polo? And yeah go for it, steal away. Tbh I could have used more foundry classes and color vars so it would play nicer with ui mods but Iโm shooting from the hip here mostly haha
You can definitely ask the gurus in #macro-polo and they will know more, I just recall that you set flags in scopes, and without a module, when you set one, it has to be in world scope. I tried finding the doc on the website, but no avail.
Ah cool, makes sense. Thanks!
Hello friends!
I want my "undead" enemies to take damage every time they are healed. How can I set it up?
With this thread reaching it's limit for the number of participants, the time has come to create a midi discord server which will happen soon (TM). I'm looking for suggestions for the server name.
Some more context is needed.
Is this the ability of a player? Is it always active or not?
Should all undead be damaged when someone casts healing spells on them?
My bad. Let me clarify. In some RPG games, if you try to heal an undead creature, it instead takes damage equal to amount of health it had to regenerate. I want to introduce this mechanic in my campaign.
So if you target an undead with a cure light wounds for instance it gets damaged instead of healed.
That would probably need a world script hooking on the midi predamageroll and changing the healing damageType to another damaging one
I want to make a stackable effect that does one point of damage/rd and subtracts one from all attack/save/skill rolls. What are the codes/flags that are used for damage over time and roll penalties?
Before my time, but I noticed that Minor-QOL graduated to MIDI-QOL. Is this something you intend to carry on with? Major-QOL one day? If so Iโd advise against calling it anything โMidiโ. Even this thread is much bigger than just that module. Iโll have a think ๐
I see. I do not think this will be necessary then. Not that important.
I just saw "healing" in "Damage Vulnerabilities" tab, and thought it could be it. But it did not work .
FoundryQOL
TMI? Timโs Module Imaginarium?
FML - Foundry Miidi Limitless
Could probably make a case for absorption flag for healing to work the other way around or something and damage instead ๐ค
Automation by Tposney
I almost wonder if that already exists
I mean I think not
I think I will just manually change token HP. I do not plan to have many undead enemies in my campaign. But thanks โค๏ธ
Foundry Unlimited Basic Automation Research (FUBAR)
I have to say this makes a lot of sense
we need "society" added at the end
Vulnerability to healing means you take twice as much healing.
This gives me ideas
or Society of Notable Automations forFoundry Unlimited (SNAFU)
Foundry VTT's community is home to a number of awesome developers and creators, many of which have their own communities to offer support for their modules, systems, and content.
Development Partners
Module/System Developer Servers
Death Save
Foundry Twodsix
Grape Juice's Modules
Iron Monk's Modules
Iron Moose
KaKaRoTo's Modules
Zhell's Script Emporium
Moohammer - WFRP
Mr. Primate's Modules
Pathfinder 2e Game System
Sandbox Game System
TyphonJS' Modules
theripper93's Modules and scripts
Content Creator Servers
Long names and all
I'd say Tposney's Modules is a nice safe conservative name, he does have other complicated modules like potentially a renewal of Trigger happy, and DAE
- so, how do I make a stackable effect for one point of damage per round?
I inclined to suggest anything that implies the server is about general foundry QOL or automation is not ideal. There are many great modules that enhance automation which are not midi and it would be presumptuous to have a name that implies to be all encompassing. It does seem that the standard is author/system and then modules.
I mean based on that list it should just be -- yeah that ๐
Could also ask those other adjacent discords if you wanted to merge or something too
sorta how jb2a does things
In most cases the actual server name doesnโt correspond to that list
The ones I joined in that list do lol
Whatever you decide on I'll support it though
in more ways than one
tposney's midi verse
Midiqol Cinematic Universe
Should probably get buy in from a moderator here who can help you manage the channels well since the guys here are quite professional.
Thatโs pretty much gearheads, no?
I've been yelled at in the past for having the effrontery to use the word midi in the module title when it does not have anything to do with music - I can see that causing issues when people are searching for a discord server.
There is probably a lot of midi music software on the git sites lol
The moderators here are very good, but I can't see them taking time to setup/suggest/administer another server - when they already have more than enough to do. However there are certainly openings available for those who want to volunteer to moderate/setup the midi-qol server.
such a shame that you can't rename a server
You can (fortunately)
ChatGPT answer to further prove what tposney said before.
Yes, I am familiar with the MidiQOL module for Foundry VTT. It is a third-party module that adds MIDI functionality to the Foundry Virtual Tabletop platform. This module allows users to play MIDI files within the platform, as well as trigger MIDI events using macros. The MidiQOL module provides a variety of options for configuring and customizing MIDI playback, including the ability to control volume, tempo, and instrument settings. It can be a useful tool for enhancing the atmosphere of a tabletop game or for providing musical cues during gameplay.
oh then in that case, have you talked to the other midi adjacent discords to see if they'd be willing to take on the task? CPR seems to be the most popular, gearheads I left mainly due to inactivity.
That sounds like just kicking the ball down the road, if those servers blossom bigger :p
lol, was midiqol actually midi on september 2021?
Whoโs in charge of gearheads? Put Tim on the board and call it a day? The traffic will ramp up if this is closed down
Considering tposney is the dev and the qol originated from your game, maybe just posneyQOL or something?
Chatgpt must be filtering to make me feel good - this is what I got
Overall, MIDI-QOL enhances the Foundry VTT experience by automating repetitive tasks, providing one-click actions, and offering convenient features that improve the flow and efficiency of gameplay. It has become a popular tool among Foundry users for its ability to enhance the quality of life during tabletop role-playing sessions.
But ChatGPT has been known to lie and make stuff up.
Whatever you decide I'll help out just as I always have been but I'm not that great at discord shennanigans, I manage my own discord for my 5 players but I offload the managemnt to one of my players lol.
I think you have the beta where its learning live details about the world
It does make sense for it to be a dev server, as Moto mentioned, DAE gets shooed here too
True I do.
tposneys poseysโข
If you are looking for themes or ideas on how to make it look, I really like CPR's discord, very solid setup
I wouldn't bother splitting your modules out, just a nice simple general discussion, and then give helpers the ability to make threads to help divert traffic into a quieter format to prevent too much spam.
Gearheads is already pretty much the perfect setup for midi and dae
I like CPR's github linkage and his issue tracker/feature request
Ah true
then again, tposney doesn't use github
Not exclusive, can be both, but I do think it should be new
Let people "rejoin" a new server instead of absorbing whatever those users have set up for an existing server, and realistically tposney definitely should get official owner status
https://docs.gitlab.com/ee/user/project/integrations/discord_notifications.html gitlab notifications should also work like githubs
Yeah I was reading about that.
then again, midi does kinda have about 200 issues outstanding so maybe not link its issue tracker hehe
or maybe do, then the helpers can help clear some
I'm game for helping out with the Discord but have only a modicum of experience
Lead a guild discord of like 40 max in an mmo level
but I think Foundry started as that so y'know
need more hands
just have more hands
I need to walk some dogs (before they eat the sofa), but will pick up on my return
The only valuable thing I can supply is lots of time online and good knowledge of the module. If it wasn't for foot-in-mouth-itus, I'd probably fit as a good moderator.
Lmk if you want a hand
Of all the discords yours is by far the coolest looking and very functionally helpful.
Then again yours targets just one module
How do these look for roles?
I'm good but what are each role exactly lol.
Tposney is top as dev, blue would be other mod devs, purple is moderator, orange is helpers, yellow and green are something else?
Owner sorcerer supreme
Guardian moderator
Sage developer
Adept helper
Patron supporter
Apprentice member
i think the roles are good names but that order seems odd
The order is off ... Discord failed me
as it does on mobile
im assuming it would be sorcerer supreme, guardian, adept, sage, apprentice, patron, based on the colors. Though i'd put sage above adept and patron above apprentice
Is there a midi Patreon?
no I think its patron as in the actual term patron
That doesn't really clarify things for me, haha
patron would be a user who contributes to the community vs a user who comes for help with it
I think I'd be a patron probably whereas Truth would be a member
That sounds like the proposed "Adept" role.
Patron would be maybe for supporters (Kofi and whatnot)
Adept is more like what chris and bugbear and krig are
I mean, bugbear added little summaries, and Adept is "helper" while Patron is "supporter."
I parade as a helper but I'm more like wildmagic sorcery, half the time I'm right and half the time I'm a potted plant
tposney does have a kofi, but they should maybe add a patreon so we can (easier) moneyguilt him into developing
"Supporter" is like... giving tposney money.
I'd call that role, room for potential but no immediate impact on the community setup
Avoiding moneyguilt is, I think, a very sensible reason not to have one XD
probably why his kofi is buried anyway lol
the patron/patreon thing can be handled down the road we can just placeholder it for now. Roles look good, I think the ranking of roles is important so that the right color shows on the user though
my take on it:
๐ด Sorcerer Supreme - owner (red)
๐ Guardian - moderator (orange)
๐ก Sage - developers (is green, should be yellow)
๐ข Adept - someone that's contributed in some informational/helpful way, but doesn't qualify as an above role (is yellow, should be green)
๐ต Patron - some sort of monetary support, connected by whatever platform (is purple, should be blue)
๐ฃ Apprentice - regular member (is blue, should be purple)
Why change the colors though? Its not like any other similar discord mirrors it.
rainbow
That pretty much is the list yeah
though, there might be a need for a distinct "admin" role, for the person(s) that would have actual control over the server, since they would have more permissions than a moderator. Would either be inserted between owner and moderator, or the sorcerer supreme role could be both owner and admin
The downside of having names like that is that it won't be inherently obvious what all roles are. A potential workaround would be like an Index channel that would detail the purpose of each role (like my Destiny 2 clan has) but would be better (imo) if the names were more specific
For example, the only obvious role from that list would be the last one, the other names are bad
that's fair, the naming scheme should probably be brainstormed more, but in terms of what types of roles are needed
Or it could go the simple route of having role names that indicate their purpose, as many servers including this one do ๐
It's informative ๐ง
Short is simple. Simple is sweet
,ClockworkD&D,D&D Like Clockwork, Automated for the People,FoundryVTT Automation Alliance,D&D Automatons Guild, Adventures in Automation, FoundryVTT Autoplay Arena
Midi: Interactive Dungeon Interface, Midi: Inspired D&D Innovation
i did the same thing
Or tposneys Foundry modules ๐
I was attempting to cast thundershock
But its not going away after casting
Using Midi QOL
Not sure why
And now the spell wont work at all with Midi QOL
Now im stuck with this icon
No damage application or saving throws
All AOE SPeels seem to break
Regarding MidiQol and a stand alone discord server @gilded yacht
Keep it simple, keep it safe!
Nothing wrong with just simply -
MidiQol by TPosney
Keep it to invite only!
Also consider @scarlet gale method and keep members simple -
- Developer (gods)
- Testers/Helpers/Moderators
- Regular Bods
Last thing make sure that folk in number 2 are spread out from around the world.
Australia/US/Europe would cover it.
Iโd be willing to help from the UK, Iโm not the most knowledgeable but Iโm pretty good at netiquette ๐ and signposting ๐
ANy help fixing AOE Spells?
There an error message in console?
Inclined to agree with this, keep the roles simple
Picking up where I stopped yesterday. I am looking to make the chat message of a CompleteItemUse a whisper to the player and the gm while the rest of the item macro can be public.
From what I found and understand, I have the result of the midi call and therefore the ItemCardId which I can then use to filter game.messages and make an update to it altering the whisper array.
Am I missing something, or is this the way?
I'm inclined to a small set, Sorcerer Supreme (admin) , Guardian (moderator), Sage (helpers who do stuff), adept everyone else, supporter (those who have provided financial support). I don't think there's currently a need for a developer role as there's only one developer.
Do what you think is best and what works best for you to manage.
Currently you can pass a rollMode in the options argument to completeItemUse, so if that would work for your case putting completeItemUse(item, {}, {rollMode: "gmroll"}) or whatever should work.
Awesome! Exactly what I needed and so much easier than to update the message ๐
Absolutely happy (delighted) to have help. @violet meadow has kindly been helping, but I know nothing about discord and what best practice for setting up might be.
My Nephew has come to stay with us, he is from Brisbane, I was just showing him how the set up is and how much I was paying to Ko-Fi and he said when you convert to AUD that is nothing, so I have increased my payment to Ko-Fi ha ha ๐
You are most kind and your nephew is a star ๐
I am not sure if this is the right place to ask but I don't see any channel for DAE. I am having an issue with an OverTime effect that doesn't appear to be firing. Can anyone assist?