#MidiQOL

1 messages Β· Page 80 of 1

dark canopy
#

redirect question, but yes -- this is the channel for working with midi macros

tepid dock
#

Ive got a bit of an issue with a macro for a homebrew ability, and it runs off a homebrew resource. Its supposed to ask for an amount of Holy Power use, then consume that amount from the tertiary resource value, then wait an amount of rounds equal to the resource quantity used, then does more damage the more resource that is used. However it keeps stopping after asking for the amount of Holy Power the player wants to spend. The description of the item is below, along with the file for the macro itself. Although I am using it with 'Item Macro' on the feature itself. I use Midi, ItemMacro, DAE, and most other automation modules. Using it in DND5e, but any assistance would be appreciated.

short aurora
#

Having a quick read through, seems to me like you just edit the damageDice const you mentioned. Item's spell level is in args[0].castData.castLevel. What kind of scaling are you looking for?

brazen bronze
short aurora
#

feels like the syntax is a crime against someone but my brain say it work

dark canopy
#

is cast level a string or number?

short aurora
#

number

dark canopy
#
const ... = `${args...castLevel}d6`
#

a "template literal" or "string literal"

short aurora
#

I wasn't aware you could use string literals when doing math as well

dark canopy
#

everything inside the ${ } is evaluated as a JS expression

#

so you can do anything in there, the result of the expression is converted into a string

short aurora
#

Aah, thanks, I've pretty much only thought of it as "fancy string concatenation"

brazen bronze
#

And if i'm getting "cannot read properties of undefined" error that means I need to assign castLevel first?

dark canopy
#

it means that likely, either args is empty, or args[0] does not contain castData

#

assuming its coming from that line, of course, and not somewhere else

short aurora
#

Yeah, how are you executing the macro? It uses args so I am assuming it's a macro to be executed by the item rolled

brazen bronze
#

yep, ItemMacro

dark canopy
#

ItemMacro alone does not have an args argument

#

that is solely provided by midi executing the itemmacro and inserting that argument

short aurora
#

I'm not a prime Primate importer user, so I'm not familiar with the setup. Do you run said ItemMacro either through an effect or the item itself with midi on use macro?

brazen bronze
#

Did it with item itself, should I try onUse?

short aurora
#

Uuuh, brain fizzle, can you show me a screenshot of how you've set it up?

dark canopy
#

character sheet hooks in the item macro options need to be turned off to function with midi

short aurora
#

If you get an error when rolling the item, you must be triggering the macro somehow

short aurora
#

Can you export the item and DM it to me? That all looks right and the character sheet hook thing doesn't cause an undefined args error for me.

dark canopy
#

and check item macro settings plz

brazen bronze
#

Hooks enabled, still no luck

short aurora
#

You want it off

brazen bronze
#

they were off, tried turning them on

vast bane
#

you want that off

#

item macro is a module that midi only uses for storage its own features step on midi

scarlet gale
#

Anyone here use dice so dice and know if macros with setDamageRoll make it visually wrong?

vast bane
#

generally speaking if the error report is on Itemacro, then you have something wrong with itemacro

short aurora
vast bane
scarlet gale
#

Tons of them

vast bane
#

if you give me one I can test it hehe

scarlet gale
#

Hex

vast bane
#

one that isn't a warlock lol

#

I soft ban warlocks at my table

tepid dock
short aurora
scarlet gale
#

Divine smite

tepid dock
scarlet gale
#

And not showing my addition to be roll

vast bane
#

yes they are off

#

the damage in the formulas on the weapon are wrong

#

or more accurately just different

scarlet gale
#

Hmm

#

Midi presumably makes use of the API for the combined card to show the roll

tepid dock
#

It also didn't seem to consume the resource

short aurora
#

I completely forgot where we are, you just rolled a dice and showed it with that last function there, you need midi stuff

#

I AM SURE CHRIS IS VERY HELPFUL HERE

vast bane
#

lol

#

what feature are they trying to make, is it homebrew or a published thing

short aurora
#

For the resource consumption thing, there's a superfluous resource in your actor update in the update holy power section

scarlet gale
#

@gilded yacht Is there anything that can be done about workflow.setDamageRoll and dice so nice. It looks like it's doing the dice so nice roll before macros finish their workflow modifications

vast bane
#

yeah I even have the do not spoil setting on and it still is a mismatch but I personally don't care if they mismatch

scarlet gale
#

I don't use dice so nice personally

vast bane
#

I only use it for the sound effects on 1's and 20's

scarlet gale
#

But I've had some people message me about it in relation to my module

short aurora
short aurora
# tepid dock Sure that would be great!

Here you go. I deleted the message outputs you had originally made yourself and put the flavor message into the damage only workflow. It outputs an auto hit message due to the nature of that workflow, unsure if that can be suppressed, but does generate a damage workflow. While dreading the answer, are you aware this wont work timing wise in actual combat? It has a timeout function for real lifeβ„’.

tepid dock
#

Shows a weird damage card of my DM portrait still though, but the other Midi damage card worked.

short aurora
#

"after an amount of rounds equal to the amount of Holy Power", that after there is based on real life seconds

tepid dock
#

I just let it sit and it rolls on its own... darn

short aurora
#

I know it's possible but honestly not the best method of doing so. Can anyone pitch in here and help GamesAndCheese with doing damage with a feature x rounds later?

violet meadow
short aurora
#

That's not even a new fancy flag, I was expecting startling innovation πŸ˜„

short aurora
molten solar
#

You just put the duration right there when you make it

short aurora
#

I thought effects also counted as changes to other actors and had to be a GM thing

violet meadow
#

Yeah, does it change while the effect is active or something?

short aurora
#

Nope, just creation, but if that's ok, it's much easier

molten solar
short aurora
#

It is targeted, yes

molten solar
#

Have EM update its own duration lmao

#

(/s?)

violet meadow
#

But you are applying an effect anyways to a target via MidiQOL/DAE, so that part is already done, no?

short aurora
#

To simplify, the feature is spend x of resource, deal xd6 damage to a target after x rounds

violet meadow
#

OK create the effect then with a MidiQOL socket

short aurora
#

chest pain

violet meadow
#

Or update the effect before sending it out

#

That will be done on the feature's duration that will then pass the Effect to the target

#

Back to MidiSRD πŸ‘‹

dark canopy
#

or via warpgate if easier!

#

(boils down to the same operation -- shunting to an owner who does the action)

violet meadow
#

Having fun with the shorthand warpgate example you shared Mr. Badger ```js
static async rayOfEnfeeblement(args) {
const { actor, token, lArgs } = MidiMacros.targets(args) ?? {};
if(!actor || !token || !lArgs) return ui.notifications.error("Something is wrong in the macro of the Item rolled; Notify GM");
const mutName = "debuff str";
const thisToken = token.document;
if (args[0] === "on") {
const findStrWeapons = (item) => item.abilityMod === "str"
const toShortHand = (shorthand, item) => {
const parts = item.system.damage.parts;
const versatile = item.system.damage.versatile;
const formula = item.system.formula;
shorthand[item.id] = {
'system.damage.parts':[[floor((${parts[0][0]})/2),parts[0][1]]],
'system.damage.versatile':floor(${versatile})/2,
'system.formula': floor(${formula})/2
}
return shorthand;
}
const hasMutation = (tokenDoc) => {
const stack = warpgate.mutationStack(tokenDoc);
return !!stack.getName(mutName)
}
const thisActor = thisToken.actor;
const weapons = thisActor.items.filter( findStrWeapons );
const entries = weapons.reduce( toShortHand, {} );

        if (hasMutation(thisToken)) await warpgate.revert(thisToken, mutName);
        await warpgate.mutate(thisToken, {embedded: {Item: entries}}, {}, {name: mutName, comparisonKeys: {Item: 'id'}});
    }
    if (args[0] === "off") await warpgate.revert(thisToken, mutName);
}
#

I just butcher everything to 1/2 damage and let MidiQOL handle the rest πŸ˜„
It just works even when halving a formula like 1d6[acid] πŸ’ͺ

#

But I just realised that overrides on the Actor bonuses are not in there 😩

dark canopy
#

that's great πŸ‘

#

overrides on actor bonuses? πŸ€”

violet meadow
#

AEs giving bonuses to mwak damage for instance

dark canopy
#

ahhh

violet meadow
#

yeah I have been looking at my screen for way too long...

dark canopy
#

follow a similar pattern used in toShorthand (or just lay out the data in place) and add to the ActiveEffect embedded key πŸ‘

#

the mutating goblin example on the wiki being a good ref

#

once you start seeing warpgate as just something that takes a bunch of lego blocks of data, the process of creating that data becomes more generic and easier -- common algorithms like reduce are really strong when used with warpgate

violet meadow
#

oh yes will do, even though can be done differently with Midi. Good fun though!

dark canopy
#

whatever the best tool for the job would be

#

with the small caveat that a single warpgate mutation is transmitted as a single socket and can be awaited on the requesting client now!

short aurora
#

I'm unable to make Midi run macros from effects each turn, testing with just this in an ItemMacro run by an effect only shows me args when they're either on or off, did I miss some development here?

console.log("###### Args ######");
console.log(args);```
violet meadow
#

The each will be run on the GM's client

short aurora
#

I'm a dumb dumb, I had disabled times' up by accident, thanks!

tepid dock
#

Thanks @violet meadow @dark canopy @molten solar and @short aurora I am going to attempt some of the above discussion suggestions

short aurora
#

I'm experimenting with the Midi sockets right now for better insight, if you don't end up finding a solution, I might tackle it later.

For the time being though, I can't seem to run removeEffects through the socket? Some of the samples have it, but maybe they're just outdated?

undefined. "removeEffects" is not a function.
#

Bloody see registered in socketlib though...

scarlet gale
#
await MidiQOL.socket().executeAsGM('removeEffects', {'actorUuid': actor.uuid, 'effects': [effect.id]});```
broken wolf
#

Was this for my question about the spell? if so, where do i see this menu?

vast bane
#

and its a + symbol on the duration tab if you have them all

broken wolf
#

these are all mods?

vast bane
#

yep, pretty core to midi builds

short aurora
broken wolf
#

mmkay so have dae and SC (shared compendium?)

#

just got times up, lets check it out

#

hmm not seeing anything different in the details tab with times up added, is that SC for shared compendium or a different module? @vast bane

tepid dock
# short aurora Thanks, the syntax was buggered in my attempts.

Not sure if this could be helpful but here is a macro for a different ability with similar functions for custom resource use associated to rounds used.

const options = Array.fromRange(actor.system.resources.tertiary.value, 1).reduce((acc, n) => {
  return acc + `<option value="${n}">${n} Holy Power</option>`;
}, "");
const content = `
<form class="dnd5e">
  <div class="form-group">
    <label>Amount of Holy Power to use:</label>
    <div class="form-fields">
      <select>${options}</select>
    </div>
  </div>
</form>`;
const rounds = await Dialog.prompt({
  title: "Consume Holy Power",
  rejectClose: false,
  content,
  label: "Consume!",
  callback: (html) => html[0].querySelector("select").value
});
if(!rounds) return;
await ChatMessage.create({
  content: `Seraphim will last for ${rounds} rounds!`,
  speaker: ChatMessage.getSpeaker({actor})
});
await actor.update({"system.resources.tertiary.value": actor.system.resources.tertiary.value - rounds});
return actor.createEmbeddedDocuments("ActiveEffect", [{
  label: "Seraphim",
  icon: "icons/magic/control/debuff-energy-hold-levitate-yellow.webp",
  "duration.rounds": Number(rounds),
  "flags.core.statusId": "seraphim",
  changes: [
    {key: "system.bonuses.mwak.attack", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: "+@abilities.cha.mod"},
    {key: "system.bonuses.abilities.check", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: "+@abilities.cha.mod"}
  ]
}]);```
vast bane
tepid dock
queen raptor
#

I'm trying to make Versatile damage rolls work with midi by holding V. I've seen it work exactly two times and not since then. Can somebody help me understand what I'm doing wrong?

#

It's really frustrating me that I was able to make it work once and that I now can't repeat that; I'm not sure what I'm doing differently.

scarlet gale
#

Isn't it shift by default?

queen raptor
#

Neither V nor ShiftRight works, afa have been able to determine

#

Well

#

V worked twice

#

And now does not

scarlet gale
#

Screenshot the item's details

queen raptor
scarlet gale
#

Could you DM me and export of the item?

queen raptor
#

Reaching out now

scarlet gale
#

Looks like having charges is messing with it

#

Not sure why removing the charges fixes it. Maybe midi isn't respecting the key press after the use resource dialog pops up Β―_(ツ)_/Β―

queen raptor
#

I guess it must be something like that. FWIW I can keep the 3 of 9 and still have it work correctly if I don't tell it those are "Charges"

#

So the sword is satisfied with 3 of 9 something-or-others

vast bane
#

I think their issue is they are using a defunct branch of TAH to roll

molten solar
#

Events in async functions nuked by awaiting

#

That's probably it

scarlet gale
#

I imported it into my test environment with just midi and it's requirements (and my module)

#

and it still had the issue

vast bane
#

is it the sample?

scarlet gale
#

not sure

#

it's whatever they exported

#

Removed charges and the pop-up dialogue went away, and holding shift made it roll the d10

molten solar
#

The dialog is async and awaited. It will ignore what button was initially held unless saved to a variable beforehand.

scarlet gale
#

So, midi bug presumably

molten solar
#

Because the global event object moved the fuck on meanwhile

#

Yes

vast bane
#

I don't see a nine lives premade in any of the modules/links

scarlet gale
#

People can just make stuff themselves too

broken wolf
vast bane
#

simple calendar

queen raptor
#

The item is imported from DND Beyond

scarlet gale
#

test it yourself by adding charges to a versatile item

broken wolf
#

got it lemme grab

queen raptor
#

Also happy to send you the item to look at, Moto

vast bane
broken wolf
#

and then the Midi-qol Fields section with about 13 checkboxes

vast bane
broken wolf
#

oh i only have description, details and effects

vast bane
#

what are you doing

broken wolf
#

trying to add a spell

vast bane
#

to what?

broken wolf
#

im adding custom spells to use with some of the classes i added

vast bane
#

drag it from the compendium to the actors spellbook

#

ok so what does this custom spell do?

broken wolf
#

lemme post again, you responded to me yesterday lol

vast bane
#

oh I have that, isn't that a feature from monsters of the multiverse, the enchanter?

#

why do you want to automate this spell?

broken wolf
#

found it on GM Binder for the Witch

vast bane
#

this feels like a totm spell

scarlet gale
#

Seems like nothing to do

vast bane
#

that spell could just be a spell description print out to the chat

#

I guess you could put advantage.check.cha on the target expires after the next charisma check?

scarlet gale
#

I guess a midi advantage flag

vast bane
#

but I honestly wouldn't even waste time on that, its never going to get used

broken wolf
#

well thats like one of 20ish spells lol

vast bane
#

just make a basic spellcard for that and give it to the caster

broken wolf
#

similar things where its a buff or debuff until a certain thing happens

vast bane
#

its not a spell though, its a feature

scarlet gale
#

Do what moto suggested then

broken wolf
#

gotcha

vast bane
#

Pretty sure something by the same name is on one of my humanoids from motm

#

my fave monster book

broken wolf
#

i dont doubt it honestly, some of these names look familiar lol

vast bane
#

You'll sooner see a background feature get used before that thing, its got awful action economy and fast friends/charm person is better

broken wolf
#

good to know, still learning on my end lol

vast bane
#

you could duplicate the charm condition and then edit it to be alluring charm, and set a special duration for next cha check

#

assuming you have dfreds CE installed and setup right

#

lol even dfred thought it wasn't worth automating lol:

broken wolf
#

what mod gives me those tabs?

vast bane
#

you just aren't looking at the right window

#

when you make a spell that has a duration and you want to apply an effect to a target or self, you click the wrench at the top and add a new ae

#

then you see this window

#

yeah I would just click the wrench and press the plus in the next window and then close them all out

#

you don't need to set flags for that feature

#

its a totm feature/spell

dark canopy
#

this might be a good time to casually mention that being new to foundry/dnd5e AND trying to use midi at the same time will cause a lot of confusion and frustration

broken wolf
#

for sure, definitely shouldnt have let them run custom classes lol

dark canopy
#

you dont need midi for custom classes πŸ™‚ in fact, its likely easier without

vast bane
#

honestly the people who go that route have never stuck around past the first few sessions in my experience

broken wolf
#

oh im just importing so much extra really

vast bane
#

they are character makers not character players

broken wolf
#

idk i happen to like the Cook class, not a bad background character i can play as an npc

dark canopy
# broken wolf oh im just importing so much extra really

this is more general #dnd5e stuff, so i'll leave it with this: Learning foundry, imo, is best done as a group on the struggle bus. If a player wants to bring in a custom class, having them also be involved in creating the needed content will go a long way for learning foundry. (my group is using some homebrew classes, at char level 18 without midi and our combats rarely last more than a half hour)

vast bane
#

yeah but if they have midi dnd5e lessons aren't going to help them

broken wolf
#

yeah, one of them wants to import the witch spells but doesnt know how, so i am trying to learn how to do it so i can show her

dark canopy
#

just say no to importers, build the content yourself

vast bane
#

You'd have to make them all from scratch

#

even if you had an import for it, it wouldn't work with midi

#

you have to make them

#

or drop midi and go back to #dnd5e

broken wolf
#

yeah, thats what brings me to here to ask how to make the spells (when i say importing i mean me literally adding the stuff to foundry)

vast bane
#

show us others and we can help but that charm one is kinda weak and pointless to make automated

broken wolf
#

fair point, looking at them they seem very straight forward, just remember its active

#

actual spells

vast bane
#

does anyone else have midi srd installed, the fork?

#

can you import and edit charm person and tell me what the drop down says in the effect on it?

#

like what is the condition its set to apply

vast bane
# broken wolf

macro territory, honestly I now strongly stress that you should just say no to these players

broken wolf
#

i still cant find those tabs you mentioned, the only wrench i have on the create spell is for DAE

vast bane
#

click the wrench, with NEW set in the drop down, click the + button to the right

#

in the new window you have the tabs

#

that flaming skull cantrip is going to be a pain in the ass to make or get made for you

#

You could just tell them it has to be necrotic not a choice and then its an easy build

#

strangulation is a simple make

#

nothing you have shown has warranted an active effect by the way

broken wolf
#

sorry im still not seeing what you're talking about with the wrench

vast bane
#

I'm starting to lean in badgers direction for suggesting you uninstall midi lol

broken wolf
#

or maybe im missing something lol

vast bane
#

show me the top bar of your items

broken wolf
#

items? im still talking about spells

vast bane
#

items in foundry is not the same thing as items in dnd5e

#

but to humor you, show me the top bar of your spells

broken wolf
vast bane
#

click the wrench

#

when you do, click the + in the next window

#

then click the edit icon to the right of what you just added

#

active effects are meant for things that last a while

#

if the spell is instant, then you don't make ae's on the spells

#

your charm thing is a feature, not a spell

broken wolf
#

i literally mentioned all i had for a wrench was DAE lol

#

could have saved 10 minutes

vast bane
#

did you find it?

broken wolf
#

yeah

vast bane
#

for the record you can also edit and add ae's in the effect tab of an item(foundry term)

#

The dnd5e guys would tell you not to edit active effects on the actor fyi, you also shouldn't make items on the actor either imo

broken wolf
#

how does midi & foundry handle turns? like if an effect lasted one minute, would i input that as 10 turns? (6 seconds per turn)

vast bane
#

I think you would be better served by talking with your players and asking them to run a lesser campaign/oneshot/multishot with just core vanilla stuff so you can get used to foundry

#

I personally am meticulous with my items with durations, I set their duration in seconds AND rounds, but you can also leave it blank as DAE will auto populate the duration for you if theres a duration on the ITEM

#

in the details tab of the item if duration is properly filled out the ae will populate with its seconds/rounds if you have DAE and midi enabled

broken wolf
#

yeah i was looking at that and wondering

vast bane
#

however, if you are in combat, dae only populates rounds, and if combat ends before it expires, it never expires and you have to remove it, thats why I populate both

#

also having a grasp of vanilila can help you figure stuff out cause you can just plagerize midi srd

broken wolf
#

yeah when i asked the spell question initially i didnt know it was a midi thing, they sent me here

vast bane
#

like that strangulation is basically a con save for damage, so something like thunderclap, or thunderwave would be similar

broken wolf
#

thought i was still doing base foundry

vast bane
#

who told you to install midi?

broken wolf
#

i do like midi however so def not uninstalling, but will probably shy away from the complex stuff unless its something i gotta have

#

i was watching videos on mods and saw it and liked it

vast bane
#

if you are homebrewing, thats the complex stuff lol

broken wolf
#

i like the auto rolling, how it tracks advantage/disadvantage, flanking etc

#

didnt know it was THIS complex when i downloaded it, but still like it

vast bane
#

there are easier rollers

#

ready set roll for instance just throws two dice and lets you decide after the fact

#

alot less setup that way

#

but you can't use midi with it

inner mulch
#

New to foundry and transferring a game im running currently to foundry from roll 20. Im kinda just figuring out problems as they come. Right now im trying to automate the summon undead spell. But my specific issue right now is the festering aura. I simply cannot figure out how to setup the effects to apply poison within 5 ft at start of actors turns. Any help or tutorials would be much appreciated

spring dove
#

So, I'll help you, and others here can help you even more, but I'll give you the single best advice I got when I transferred my game to foundry from roll20 last year.

100% automation is the path to madness.

Foundry can automate a lot, but trying to make it do everything will inevitable break other things, will cause a lot of things to happen you don't intend, and in your quest to automate all the things, you'll end up spending far, far too much time fiddling with it only to get a mediocre result.

Automate what is the most time consuming, most annoying, and most often forgotten, but if something can be done in a couple clicks, keep it manual.

Anyway, on to helping you with your issue.

#

@inner mulch Do you have Active Auras module?

inner mulch
#

Yes

violet meadow
#

I wouldn't use Active Auras for that.

I would use an OverTime effect triggering a macro to roll an Item (MidiQOL.completeItemUse) that would do the damage to targets 5 | ft | enemies

spring dove
#

Can be done either way. I highly recommend OverTime, it's an extremely powerful tool. But it does have a learning curve.

broken wolf
#

would midi be the mod to track aoe field effects? i.e., token steps into aoe and something triggers?

inner mulch
#

Also does overtime have visuals?

vast bane
violet meadow
vast bane
#

CPR might actually have that spell

spring dove
short aurora
#

I'm getting some validation errors when trying to create an ActiveEffect with MidiQOL and I can't figure out if it's me or Midi, anyone can spot what's wrong? I'm trying to create an ActiveEffect with a flag with an itemMacro in it, so the effect can run said itemMacro upon expiry. This below creates visually, but errors with a 'Item5e model validation error: item5e.name and item5e.type may not be a blank string' and does not run said macro, despite it looking like it's there.

// Create the active effect as a "countdown"
  const holyPowerSpent = 3;
  console.log("#### HIGH ENERGY CREATING THE EFFECT ####")
  console.log(args)
  const effectData = {
    changes: [{key: "macro.itemMacro", mode: 0, value: ""}],
    label: args[0].item.name,
    origin: args[0].item.uuid,
    icon: "icons/svg/aura.svg",
    duration: {"seconds":`${holyPowerSpent * 6}`},
    flags: {
        "dae": {
            "itemData": {
                "flags": {
                    "itemacro": {
                        "name": "Created ItemMacro",
                        "type": "script",
                        "scope": "global",
                        "command": "console.log(\"###### Args ######\");",
                        "author": "RvG7ixWXicSPF67m",
                        "_id": null,
                        "img": "icons/svg/dice-target.svg",
                        "folder": null,
                        "sort": 0,
                        "ownership": {
                            "default": 0
                        }
                    }
                }
            }
        }
    }
};
await MidiQOL.socket().executeAsGM("createEffects",{actorUuid:args[0].hitTargetUuids[0], effects:[effectData]})```
dark canopy
#

what is the validation error?

short aurora
#

Name and type is supposedly blank somewhere

dark canopy
#

you are creating an item with the itemData object? (this is my ignorance talking, bear with me)

broken wolf
#

so one of the spells im adding, Bone Spikes (basically Spike Growth with a smaller radius and different dmg) does foundry naturally take into account the aoe left by the spell? like if a player moves into it, will the system make them roll the check, etc. and if foundry natively doesnt, how could i apply this?

just tested the spell Bone Spikes and Spike Growth and the first parts of the spell work (initial dmg/roll) but both spells have additional effects should a target move within,into or out of the aoe space, nothing occurs when i do this in game

short aurora
# dark canopy you are creating an item with the `itemData` object? (this is my ignorance talki...

This is the function ripped from the code in typescript, I know not if this is itemData, I'm using midi for this for the GM socket function essentially

export async function createEffects(data: { actorUuid: string, effects: any[] }) {
  const actor = MQfromActorUuid(data.actorUuid);
  for (let effect of data.effects) { // override default foundry behaviour of blank being transfer
    if (effect.transfer === undefined) effect.transfer = false;
  }
  await actor?.createEmbeddedDocuments("ActiveEffect", data.effects)
}```
inner mulch
#

This all started because i wanted to automate summoning which i have now got.

dark canopy
short aurora
#

No, the effects I looked at, generated by an item with an itemMacro in it, seemed to store said itemMacro in flags, so I was trying to create an effect with said flag

spring dove
# inner mulch Yes

Ok. so if you set up this OverTime effect on your monster, and set up the Active Aura like this, I believe that should work. You can set your own saveDC= or you can put a token attribute value in there.

dark canopy
#

(maybe you are looking for Effect Macro)

short aurora
#

^console dump of one of the effects applied by item rather than macro

dark canopy
#

and now i'm out of my depth πŸ˜… sorry

short aurora
#

πŸ‘ All good, gave me an avenue to pursue

broken wolf
vast bane
#

midi squashes them all into one if you use multiple statusEffect keys

broken wolf
#

havent touched anything in midi for this yet, just copied the spell setup as its very similar to Spike Growth (dmg, radius), asked in dnd5e and they sent me here

#

but noticed that spike growth, blade barrier, etc all have similar hiccups, those secondary effects arent triggering

vast bane
#

midi doesn't do aoe placed templates, active auras or template macro does

broken wolf
#

got it, thanks
so it probably wouldnt be midi thats making Bone Spikes require an attack roll then im guessing? didnt see any fields for Spike Growth that i had checked that should be but theres no roll to hit on that spell

sacred raptor
#

Question
My Gm was looking for a way to hide the damage numbers when his npc's take damage or heals , so instead of the number popping up it just says damage or healed. is this something Midi can do ?

vast bane
#

no, but core can turn that off

sacred raptor
#

ok tks

broken wolf
#

@vast bane using the flaming skull spell i linked before, decided necrotic fits better cause theres enough fire spells i think

#

not sure what buttons id remove, but id like to not make that mistake lol

vast bane
#

lol

#

I wanted you to make an attack and show me what it looks like in chat

broken wolf
#

Ohhh hold up

vast bane
#

that item is also not even setup right

broken wolf
#

If it’s the range I fixed it

vast bane
#

blank blank creature, 90 blank feet

#

suppose it should be 1 blank creature

broken wolf
#

got it

vast bane
# broken wolf

go to the Dm and player tabs of midiqol and stop removing buttons

#

you are removing the buttons that you could be using to popout and reuse attacks for

#

the effect transfer button could also be left on, and same with saves I think

broken wolf
#

this one?

vast bane
#

honestly I think you'd be best served uninstalling midi

broken wolf
#

not happening, is this what you're referring to "removing buttons""?

#

think thats what youre referring to

#

hmm seems i had apply item effects off by default

#

ahh i see what you mean by pop out now, this could work

light sleet
#

bro how the fuck did i just realize your profile is moto moto from Madagascar

broken wolf
#

damn, that is him isnt it lol

vast bane
#

midi damage automation doesn't like reused buttons that aren't finished

broken wolf
#

I see, I turned them off earlier cause I didn’t want people to roll from the chat box but if it functions better with it on its no big deal

#

When I installed the mod the apply item effects was off, is this something I’ll be wanting?

tepid remnant
#

Hey, having a bit of a weird issue and its been basically impossible for me to narrow down. Sometimes when rolling an attack, damage just doesn't roll. There's no errors in the log and its not consistent at all. Just wondering if anyone else has run into the problem and found a fix.

#

Predominantly happens to PCs if that helps.

vast bane
tepid remnant
#

Yeah that's what I was thinking but it happens to me sometimes too and I definitely know I'm pressin the right button haha. When I hit it again, it often works the second time around

light sleet
#

i think one of the things that was happening to me and the damage was they had a reaction or something and it wouldnt do anything until the reaction passed

tepid remnant
#

Could they be triggering a reaction on their own sheet when rolling an attack? The things they were fighting did not have any fancy reactions but pretty much all of them do

#

But I also feel like they'd say something about a reaction prompt popping up

vast bane
#

reactions only trigger prompts for the victims

broken wolf
#

progress! everything working as it should except for the attack roll for the aoe which shouldnt be happening when the spell is cast.
Update, all figured out now, Fireball was the spell i should have used as the template, needed to change the action type to saving throw, now it works like other aoes spells

#

and ill just do the pop out thing you suggested for now until i learn more about making macros @vast bane
thanks for helping!

vast bane
#

what is the spell?

broken wolf
#

it was bone spikes from earlier, i had it set to other as thats what spike growth was and it was causing a roll

#

looked up fireball and fireball has it as a saving throw spell, tested it and its worked since, casted it about 30 times now as im tweaking whats shown in the log

#

is there a way to update the dmg actually taken if the save is successful for the players to see? i get the GM box that shows me, but if im a player, it looks like i did 10 dmg when really it was 5

vast bane
#

I don't know what your snippet is but I'm guessing theres a macro going on?

#

thats not an attack roll

#

you rolled 10

broken wolf
#

That’s the damage roll actually

#

The card I see shows the dragon took 5 dmg

#

I disabled the attack roll so that’s no longer an issue, was curious because I see the actual dmg, 5 because it passed the check and only takes half of the 10 in pointing at

#

I guess I could always tell them but was curious

hot flower
#

Anyone know if there is a single document with the whole API documentation? Like a massive google doc or something?

#

V10 API I mean,

rigid kindle
#

I asked over in #macro-polo but was pointed over here. I'm looking to trigger an action when a token with a DAE effect misses an attack roll. This can quite easily be done by having the effect expire on attack Hit (with integration of Midi), but I'm having trouble finding a way to do it on a miss. Am I missing something obvious?

vast bane
vast bane
violet meadow
sleek bone
#

So I got a hold of this module (And it is active) yet I don't really see / get how it is suppose to help me out. It does not seem to "separate" the damage. So when the Monk who is suppose to only deal +2d6 Radiant damage with his spear when said spear is buffed (By as I said; adding an effect which gives a +2d6 Radiant on MWD) - It still tries to apply that damage to his unarmed strikes (Which are also MWA) there is no "separate" card for the bludgeoning and radian damage portions as it's all MWD. I figured maybe I had some settings wrong by default with the Advantage Reminder but yeah as you can see; it does not really have a lot of options for me to work with, any clue what I might be doing wrong?

short aurora
short aurora
#

I think Moto's suggestion was then to use Advantage Reminder to remind people to do it themselves manually. If you have an effect that's only supposed to hit one item, I think a macro (specifically Warpgate) would be your best bet for automating. You can tie that macro to an effect for duration purposes, I can see if I can find one of my old and repurpose them for you, give me a mo

solid mountain
#

I've tried this solution of yours for a similar thing. But I'm not getting it to work. Is this still working?

short aurora
# sleek bone Yep.

I couldn't find my example, but honeybadger was kind enough to show me an example of a Warpgate mutate back in v9. It's cloning an item for its' data, removing a quantity (because my guy was dual wielding the same weapon fuck him), adding a new damage part and name to show it's been enchanted and then mutate the item. Maybe you can use this to develop further? I'm not on v9 so I can't test anything from back then

let swordData = token.actor.items.getName("Scimitar").toObject();

//remove 1 sword from the stack
const newQuantity = swordData.data.quantity - 1;

//modify the quantity to 1
swordData.data.quantity = 1;

//add poison damage
swordData.data.damage.parts.push(['1d6','poison']);

//change name (ensures its not overwritten)
swordData.name = `Poisoned ${swordData.name}`;

//clear out ID so we do not UPDATE anything
//note: badger hates this and will try to improve
delete swordData._id

//craft updates
const updates = {
    embedded: {
        Item: {
            [swordData.name]: swordData,
            Scimitar: newQuantity > 0 ? {'data.quantity': newQuantity} : warpgate.CONST.DELETE,       
        }
    }
}

await warpgate.mutate(token.document, updates, {}, {name: "Applied Poison"})```
solid mountain
sleek bone
short aurora
violet meadow
solid mountain
violet meadow
#

Do you attack with a RWAK weapon?! πŸ€”

#

Just tested, works for me

solid mountain
#

Hmm, I guess something else is interfering

violet meadow
#

Quick check that it is actually set to a Ranged Weapon Attack in the details page of the Longbow.

I keep changing them to test various things and forget them, so you never know πŸ˜›

solid mountain
violet meadow
#

Do you set it up directly as a babonus on the Radier?

solid mountain
#

I've tried both directly on the raider and on an item on the raider...

#

I guess it could be some other module interfering or something like that.

violet meadow
#

At this point, I am testing with MidiQOL 10.0.33 and Babonus 10.4.6
If you are on these versions check with Find the Culprit and if nothing, ping Zhell in #dnd5e

solid mountain
#

Oh wait... I just randomly got it to work.

#

Not sure what I changed, but it seems to be working now. I must have done something.

#

Thank you for your patience. This was a clever solution!

violet meadow
#

good sir, did you try turning the router off and on again?

delicate quartz
#

Is there any way to set resistance to all damage for a round using an active effect and midiQOL?

#

Never mind, found it.

feral kestrel
#

Is it possible to auto roll healing for a spell whilst maintaining Auto Roll Damge = Never in Player settings for MidiQol?

rigid kindle
sudden crane
#

@gilded yacht Hi, really like the new target token on use macros. But do you think it would be possible to move the call for isDamaged before the damage is applied? For example after the call to preDamageApplication on use macro?

https://gitlab.com/tposney/midi-qol/-/blob/v10/src/module/utils.ts#L729
If you think that isDamaged should stay there, maybe then add a new one that would be called before the damage is applied ?
There are some cases that a feature could prevent damage. In this case it needs to be called before the damage is applied but after effective damage has been computed. Because someone could be hit but immune to the damage so it would not be damaged, and in that case the feature should not trigger

broken wolf
broken wolf
violet meadow
#

And @gilded yacht further to what @sudden crane mentioned, .33 is really close to being able to conditionally apply (dis)advantage to saves too.

The isSave trigger seems to be a tad late to impose that on the workflow though, as the dnd5e.preRollAbilitySave Hook has already been triggered by that point.

If there could be a trigger for needsSave or something like that, triggered when the rolled item.hasSave is true, would allow for a quick ```js
//NOTE TO READERS: NOT YET IMPLEMENTED.

//to give advantage on Saves when the attacker is a Demon.
const { options: {token:defenderToken, actor:defenderActor }, actor:attackerActor } = args[0] ?? {};
if (!attackerActor || !defenderToken || !defenderActor) return;

if (attackerActor.system.details.type?.value === "demon" ||
attackerActor.system.details.race.includes("Demon"))
Hooks.once("dnd5e.preRollAbilitySave", (actor,config,abilityId) => config.advantage = true})

solid mountain
broken wolf
broken wolf
hot flower
# scarlet gale Of foundry?

Yeah. I wanted to feed it to gpt-4 so it would have the latest api to help me write macros and a module I’m working on. Currently gpt-4 only has data up to Sept 2021.

spice kraken
#

I can say with 99.99% certainty gpt macros won't work and if you try and ask for help in #macro-polo they're just gonna scrap it and create it from scratch

dark canopy
#

pleeeeeaaasseeee do not waste your time with chatgpt and anything technical

spice kraken
#

It's basically only useful for what you can google and get right away anyways

#

So in short, not foundry related macros

dark canopy
pliant matrix
#

Do you have any suggestions on how to create an effect to replicate the rogue's evade effect?

"Beginning at 7th level, you can nimbly dodge out of the way of certain area effects, such as a red dragon's fiery breath or an Ice Storm spell. When you are subjected to an effect that allows you to make a Dexterity saving throw to take only half damage, you instead take no damage if you succeed on the saving throw, and only half damage if you fail."

spice kraken
#

You wanna use the super saver flag

#

flags.midi-qol.superSaver.dex | Custom | 1

pliant matrix
vast bane
#

I've been burned too many times by macros messing up inventory of the players so I don't ever run modification macros of items anymore

#

If you don't fast forward, then you can setup situational bonus modifiers in the popouts like this, when you click the button it directly adds the dice into it:

#

Very macro lite for the people who don't know how to write macros and no danger of lost data or messed up items

broken wolf
#

looking to input the Misfire rule Mercer created for gunslinger, was told midi would be the right tool for this

"Misfire. Whenever you make an attack roll with a firearm, and the dice roll is equal to or lower than the weapon’s Misfire score, the weapon misfires. The attack misses, and the weapon cannot be used again until you spend an action to try and repair it. To repair your firearm, you must make a successful Tinker’s Tools check (DC equal to 8 + misfire score). If your check fails, the weapon is broken and must be mended out of combat at a quarter of the cost of the firearm. Creatures who use a firearm without being proficient increase the weapon’s misfire score by 1."

spice kraken
#

I just use the chat description flair. As simple as it can be

vast bane
#

yeah I'd use AR and IRC for that

#

thats alot of macro for something easily handled by the player

sleek bone
# vast bane this is precisely why I said to use AR and don't fast forward, then you can put ...

Having hopped onto Foundry now to try this - What you now have shown bellow is exactly the kind of thing I would consider to be "the optimal solution" (Due to it being no easy / direct way to just add the effect to a single item outside of macros) but I did not have a clue that the flag for adv-reminder was even a thing, but now that I see / get that it all checks out perfectly πŸ˜„ Sorry about clearly then not understanding what you were on about, sometimes what should be simple details goes past me πŸ˜–

vast bane
#

some of AR's keys are not auto completed by DAE

#

Kaelad hasn't submitted the newest ones

broken wolf
spice kraken
#

Moto, can you grab a screenshot, not at my pc

vast bane
#

the problem with gunslinger is honestly similar to Rexx's problem

#

you can only put ae's on actors and affect actors and the gun jam is weapon specific

#

thats a whole rabbit hole I would never go down

broken wolf
#

yeah i figured that would be an issue, whats this chat description flair thing, sounds like a good alternative

vast bane
#

I'm not a fan of description usage in midi cause most players hide descriptions by default cause alot of stuff are walls of text

#

I really wish dnd5e would allow enriched text in the damned flavor field

violet meadow
broken wolf
#

for one gun its 1, 2 for the other, thats it

#

not doing anything more than basic pistol and musket

vast bane
#

this is why I don't like utilizing descriptions in my game lol:

#

the barbarian attacks 3 times and spams 20 miles of text yey

violet meadow
broken wolf
#

could that be put into like an item that could be looked up instead for my situation? specifically the misfire rule and how it works

#

yeah

violet meadow
#

give me 5

vast bane
#

if its a, if you roll this or lower, apply this ae then you could put all the IRC buttons in the description for dfreds CE and have it apply a ce

broken wolf
#

the secondary effects on needing to repair, the attack missing, that i can do manually if necessary, but if its too complicated thats fine

vast bane
#

IRC being inline roll commands

#

but heres the problem, ae's are actor wide so if the gunslinger has 3 guns, hes affected on all 3

broken wolf
#

so if one breaks, they all would?

vast bane
#

If you start modding items with macros shit gets weird fast in midi

broken wolf
#

then maybe like something they can click on and open describing the specific trait would be enough

vast bane
#

If I had to host for a gunslinger, I would put a message in the attack saying HEY, if you roll this or lower your guns jammed dont continue

#

Maybe add another message that is apply if said number is rolled that is just a message on all popouts saying that Gun B is jammed currently

#

and then have an action item that unjams gun B removing the ae

violet meadow
#

shit wrong reply...

broken wolf
#

lol

vast bane
#

wait till you get to the point of having to reload guns

violet meadow
#

where did that message go...

broken wolf
#

well im wanting to add Reload as well lol

#

but i think thats a simply thing i could adjust on weapon properties

violet meadow
#

@digital lagoon I saw your message πŸ˜„
It's a trap πŸ™€

vast bane
broken wolf
#

so like Reload 4, on the properties of the weapon itself and just tell them

digital lagoon
vast bane
#

suddenly their 6 shooter has 9 bullets in the chambers

#

and it turns into the gun from who framed roger rabbit

violet meadow
vast bane
#

The good news about reload macros is that zhells probably made it 20 times in #macro-polo

digital lagoon
#

β€œYou can play a gunslinger until you run out of bullets in your first chamber. After that you class convert to a pistol-whipper because I don’t want to figure out how to reload.”

… I need to make a spoiled inept rich gunslinger who throws his guns away every time he empties them and goes to buy new ones.

broken wolf
#

sounds like Bert from Tremors lol (actually not sure on the Bert lol)

violet meadow
#

Go reload yourselves

MidiQOL reload weapons with the Loading property.

Create an Item as you want it for the reload, probably a feature and make sure that you Target: empty | empty | Self in its details tab.
Add a MidiQOL macro onUse ItemMacro | After Active Effects and copy paste this in the ItemMacro.

const weapons = args[0].actor.itemTypes.weapon?.filter(i=>i.system.properties?.lod && i.system.uses?.value < i.system.uses?.max);
if (!weapons.length) return ui.notifications.info("No weapons to reload");

const options = weapons.reduce((acc, a) => acc += `<option value="${a.id}">${a.name}</option>`, ``);
const content = `<div class="form-group"><label for="pickWeapon">Pick a weapon to reload.</label><select       name="pickWeapon">${options}</select></div>`;

const id = await new Promise((resolve) => {
  new Dialog({
    title: "Reload Weapons Dialog",
    content,
    buttons: {
      confirm: {
        icon: '<i class="fas fa-check"></i>',
        label: 'Confirm',
        callback: (html) => { resolve(html.find('[name="pickWeapon"]').val()) },
      }
    },
    rejectClose: false
  }).render(true)
});
if(!id) return;
const weapon = args[0].actor.items.get(id)
await weapon.update({"system.uses.value":weapon.system.uses.max})
vast bane
#

I don't think you can do empty anymore, I think its none now but I'm being pedantic

#

Some alternative rules have them roll an acrobatics check to see how many bullets they reload

#

but I know macro polo has made that one

broken wolf
#

interesting, thanks

#

i think ill just add the Misfire rule description as a feature the players can look at if they have a question lol, much simpler

dark canopy
#

or rather, keeping unimportant information hidden in the chatlog

vast bane
dark canopy
#

or macro it, but yea, just pointing that out -- quite useful

vast bane
#

The flavor field shows always regardless of settings, but it doesn't allow enriched text

#

if we could utilize that field for modules like IRC then it could expand the cool tricks an AR/IRC user could do

rigid kindle
vast bane
#

So in the above discussion about gun jams you could make a feature that unjams the gun and have the message in the popout have a button that is [[/rollItem Unjam]] and if the item "Unjam" exists on the actor they will roll it

hot flower
dark canopy
#

right tool for the right job πŸ™‚ im glad its useful -- also a pretty neat module overall

hot flower
#

it needs a lot of work, the module. and no, the rules aren't 100% accurate all the time. What I'd like to to is figure out how to style the chat output to look like monsterblocks or spell blocks.

#

here's the sample output when I asked for "fireball" ```Fireball is a 3rd-level evocation spell that creates a burst of flame that spreads around corners. The spell has a range of 150 feet and affects all creatures within a 20-foot radius sphere centered on a point the caster chooses. Each creature in the area must make a Dexterity saving throw. On a failed save, a creature takes 8d6 fire damage, or half as much on a successful one. The spell ignites flammable objects in the area that aren't being worn or carried. The spell can be cast using a spell slot of 4th level or higher, increasing the damage by 1d6 for each level above 3rd.

violet meadow
#

Misfire for @broken wolf WITH Warpgate module.

Not exactly use Tinker Tools to fix, but a take on making an Ability Check (INT) against a DC of 8 + misfire score to "repair".

On the Item create a MidiQOL onUse ItemMacro | After Attack Roll

const misfireScore = 1; //change this between 1 and 2 or whatever you need.

const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if (!actor || !item || !tokenUuid ) return;
const tokenDoc = fromUuidSync(tokenUuid)
if (!!d20AttackRoll && d20AttackRoll <= misfireScore) {
  Hooks.once("midi-qol.RollComplete", async () => {
    const updates = {
      embedded:{
        Item: {
          [item.name]: {
            name: item.name + " (destroyed)",
            flags: {"midi-qol":{onUseMacroName:"[postActiveEffects]ItemMacro"}},
            system: {
              ability:"int",
              actionType:"abil",
              target: {type:"self"},
              damage: {parts:[],versatile:""},
              formula:"",
              save: {ability:"dex",dc:8 + Number(misfireScore),scaling:"flat"}
            }
          }
        }
      }
    }
    await warpgate.mutate(tokenDoc ,updates,{},{name:"boom gun"}); 
  })
}
if(!d20AttackRoll && this.saves.size > 0) await warpgate.revert(tokenDoc,"boom gun")
dark canopy
#

look how CLEAN IT IS

violet meadow
#

This will change the Item from a weapon to an Ability Check.
Granted, it is not a Roll Tinker Tools but an Ability Check

dark canopy
#
 [`${item.name}`]: {

to

 [item.name]: {
#

the brackets say "treat this as a string"

#

you were taking a string, converting it to a string, and then telling it to treat it as a string πŸ™‚

violet meadow
#

Yeah! Did this change at some point? At first I had an issue with that

dark canopy
#

furthermore, as you integrate WG, stay mindful of the event system -- when used within a module, it can make some "reactive" or "long term" operations much easier

dark canopy
violet meadow
broken wolf
broken wolf
violet meadow
dark canopy
#

you can use a world macro if you dont have item macro

#

(give it the name of the macro, instead of "itemmacro")

broken wolf
#

have the item macro module installed

violet meadow
#

If ItemMacro is active in your world, on the title bar of the Item, there should be a button for ItemMacro

broken wolf
#

ahhh there we go

violet meadow
#

Make sure that in the settings of Item Macro module, the checkbox for Character Sheet Hook is NOT checked

broken wolf
#

yeah currently nothing is checked there

violet meadow
#

Copy paste the macro in there then and in the Item's details tab, at the bottom, click the + to create an entry

#

ItemMacro case sensitive

broken wolf
#

that option isnt appearing

violet meadow
broken wolf
#

there we go

#

in this case Musket, is it case sensitive? or do i leave as is in image (thinking i need to put the actual item though)

#

and then this one, if i put it at 2, will it trigger the macro on a 1 or a 2 or just the 2?

dark canopy
#

need to change the following line to accomodate "roll at or under"

#
!!d20AttackRoll && d20AttackRoll === misfireScore

to

!!d20AttackRoll && d20AttackRoll <= misfireScore
dark canopy
broken wolf
#

oh im wondering if i need to put the actual item name where it says item name or just leave it as item name

dark canopy
#

shakes head, nope, item is the Item5e object, with a name property

#

specifically, item is the item being rolled currently

broken wolf
#

so right click compendium, get name from there?

dark canopy
#

nope, dont touch that line πŸ™‚

broken wolf
#

gotcha

#

mmkay all setup i think

violet meadow
#

Yeah you don't need to change anything in the macro except for the misfireScore to accommodate easier testing 🀞

broken wolf
#

yeah only changed the === to <= and the 1 to a 2 at the top

violet meadow
#

Actually for easier testing you can change to this too πŸ˜„ js if (!!d20AttackRoll && d20AttackRoll === misfireScore) { to ```js
if (!!d20AttackRoll) {

#

whenever it's an actual attack go for the mutation πŸ˜„

broken wolf
#

so testing now and nothing happens when i roll a 2 or lower

dark canopy
#

(check console for errors)

violet meadow
#

I will be AFK for some time πŸ˜‰

broken wolf
#

@dark canopy i remember reading how to do that somewhere, one sec lemme see if i can find again lol

dark canopy
#

(and I can assist with warpgate operations, but nothing relating to the midi api)

broken wolf
#

yeah nothing happens at all in the console when i click on execute macro

dark canopy
#

you dont execute the macro directly

#

you roll the item, which executes the macro

#

(normal item macros can be done that way, but NOT if midi is involved)

broken wolf
#

yeah i did that to, trying to roll it again and see what console says

#

from rolling a 2

sudden crane
scarlet gale
#

Depending on your use-case, you can have an actor roll another actor's item locally with a synthetic duplicate of the item.

#

Actually, looking at my fire aura, it doesn't even need to be a synthetic item, you can roll it without permission issues

inner mulch
# spring dove Ok. so if you set up this OverTime effect on your monster, and set up the Active...

so what that ended up doing is applying the poison then having them test out. i cant figure out how to reverse that, test to apply the effect and then remove it at the end of their next turn. what i really need is something that explains the effect value box as understanding that would really help towards using active effects but i cannot find anything about that box, it all talks about the attribute keys.

dark canopy
#

midi flags not withstanding, as they are added by midi -- so look for its documentation regarding its specific effect keys

hot flower
# violet meadow Go reload yourselves MidiQOL reload weapons with the Loading property. Create...

curious: why did you search for the loading property and not the reloading property, since they're different.
Loading. Because of the time required to load this weapon, you can fire only one piece of ammunition from it when you use an action, bonus action, or reaction to fire it, regardless of the number of attacks you can normally make.

Reload. A limited number of shots can be made with a weapon that has the reload property. A character must then reload it using an action or a bonus action (the character’s choice).

Wouldn't it make more sense to search for the rel prop?

violet meadow
hot flower
#

i think loading is more like for crossbows, which require time and a crank, etc. to reload. reloading is like adding bullets to a chamber, which can fire quickly, no?

dark canopy
#

loading is a weapon property that says "barring exceptions, this weapon can only attack once per turn"

hot flower
#

right. I thought we were talking about pistols. I would guess if you're talking about a musket or other single-shot firearm, you'd want the loading prop, as well.

#

should be easy enough to check for proficiency as well with the weapon, since RAW says misfire score is +1 if not proficient.

broken wolf
violet meadow
#

But move these 2 lines, after the item has been declared (and delete the const misfireScore = 2;)

#

Just a sidenote, as I was developing this based on my MidiQOL settings, the MidiQOL workflow needs to be completed before the warpgate mutation takes place.
So if you are not checking hits or rolling damage automatically, you might need to actually clcik on the damage button on the chat card to make it "complete"

#

Misfire not 100% RAW πŸ˜… ```js
const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if (!actor || !item || !tokenUuid ) return;

let misfireScore = 2;
if (!item.system.proficient) misfireScore += 1; //if not proficient the misfireScore is +1 to the normal.

const tokenDoc = fromUuidSync(tokenUuid)
if (!!d20AttackRoll && d20AttackRoll <= misfireScore) {
const updates = {
embedded:{
Item: {
[item.name]: {
name: item.name + " (destroyed)",
flags: {"midi-qol":{onUseMacroName:"[postActiveEffects]ItemMacro"}},
system: {
ability:"int",
actionType:"abil",
target: {type:"self"},
actionType: "other",
damage: {parts:[],versatile:""},
formula:"",
save: {ability:"dex",dc:8 + Number(misfireScore),scaling:"flat"}
}
}
}
}
}
await warpgate.mutate(tokenDoc ,updates,{},{name:"boom gun"});
}
if(!d20AttackRoll && this.saves.size > 0) await warpgate.revert(tokenDoc,"boom gun")

#

Can someone try this?

hot flower
#

how would you change the misfire macro to automatically miss if you roll below the misfire score?

#

hah; and you just did it.

violet meadow
#

I thought the misfire score is 1 or 2 or +1 to these if not proficient

broken wolf
#

yes,for the musket is misfire 2 and then the proficiency thing, regular pistol is misfire 1

jagged plinth
#

does midi have a way of prompting damage type for chromatic orb and applying that type to the damage applied?

vast bane
#

Sources of premade stuff for Midiqol:

Midi Sample Items Compendium(comes with the module)

Midi SRD's compendiums(this is the manual install link)
https://raw.githubusercontent.com/thatlonelybugbear/midi-srd/master/module.json

More Automated Spells Items and Features compendiums
https://foundryvtt.com/packages/more-automated-spells-items-and-feats

Mr.Primates premade macros:
https://github.com/MrPrimate/ddb-importer/tree/main/macros

Chris' Premade macros:
https://github.com/chrisk123999/foundry-macros

Chris' Module form of his macros:
https://foundryvtt.com/packages/chris-premades

Activation condition examples by ThatLonelyBugbear
https://github.com/thatlonelybugbear/FoundryMacros/wiki/MidiQOL-activation-conditions-examples

jagged plinth
#

I thought there would be, but i couldn't find that list in the Pins

#

do you happen to know which compendium it's in, i've checked "more automated spells", "chris' premades", and "Midi Srd"

#

oh, it's in the D&D beyond importer

broken wolf
broken wolf
#

so im fine to keep it?

violet meadow
#

yeah

hot flower
#

@violet meadow : how would one interrupt the workflow to make it miss if the misfire score target was hit. Since RAW says on a misfire, it automatically misses. I'm thinking something like this?

let { hitTargets, d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if ( !actor || !item || !tokenUuid ) return;

let misfireScore = 2;
if ( !item.system.proficient ) misfireScore += 1; // if not proficient the misfireScore is +1 to the normal.

const tokenDoc = fromUuidSync( tokenUuid );
if ( !!d20AttackRoll && d20AttackRoll <= misfireScore ) {
    hitTargets = [ ];
    const updates = {
etc, etc... 

but that doesn't seem to be working. the target is now making the dex saving that gets added to the firearm via warpgate.

#

basically just needs to end workflow if (!!d20AttackRoll && d20AttackRoll <= misfireScore) evaluates true

violet meadow
hot flower
#

i'm just playing around with it.

violet meadow
#

You can return false in the workflow before DamageRoll

#

Try adding thisHooks.once("midi-qol.preDamageRoll", () => { return false;})

#

and then the Hook for roll complete

vague relic
#

sucks there's no obvious way it seems

hot flower
broken wolf
#

we had it working at one point, but when we adjusted for the misfire roll it stopped

hot flower
#

not sure where the roll complete hook would go, tbh. Right now, I've got it set to roll before the damage roll instead of after the attack roll.

broken wolf
#

atm all im getting is the warpgate to trigger when i make the roll, but no saving throw or item break

hot flower
#

here's my modification so far:

#
const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if ( !actor || !item || !tokenUuid ) return;

let misfireScore = 2;
if ( !item.system.proficient ) misfireScore += 1; // if not proficient the misfireScore is +1 to the normal.

const tokenDoc = fromUuidSync( tokenUuid );
if ( !!d20AttackRoll && d20AttackRoll <= misfireScore ) {

Hooks.once("midi-qol.RollComplete", () => {console.log("BOOM GOES THE DYNAMITE")});

    const updates = {
        embedded: {
            Item: {
                [ item.name ]: {
                    name: item.name + " (Misfired - Needs repair)",
                    flags: { "midi-qol": { onUseMacroName: "[postActiveEffects]ItemMacro" } },
                    system: {
                        ability: "int",
                        actionType: "abil",
                        target: { type: "self" },
                        // actionType: "other", // This is a duplicate key, please remove or rename it
                        damage: { parts: [ ], versatile: "" },
                        formula: "",
                        save: { ability: "dex", dc: 8 + Number( misfireScore ), scaling: "flat" },
                        consume: {
                            amount: null,
                            target: "",
                            type: ""
                        },
                        uses: {
                            max: "",
                            per: "",
                            recovery: "",
                            value: null
                        }
                    }
                }
            }
        }
    };

    await warpgate.mutate( tokenDoc, updates, {}, { name: "boom gun" } );
}
if ( !d20AttackRoll && this.saves.size > 0 ) await warpgate.revert( tokenDoc, "boom gun" );```
violet meadow
#

wrap the updates and warpgate mutation in the completeRoll hook

hot flower
#

as you see, i changed the consume and uses props as well so that when you roll to repair, it won't consume ammo.

broken wolf
hot flower
#

yes.

broken wolf
#

wait what now?

hot flower
#

this is how I have it set up:

#

this is for a pistol that I see as kind of a revolver

vague relic
#

guys, i figured out how to do it

#

the abandon workflow thing

#

if that's still what we're talking about πŸ˜…

broken wolf
hot flower
#

if you've got a musket or single shot pistol like a flintlock, you can give it the loading property and set it to 1 of 1 charge. And be sure it set it to use whatever ammo you have set up

#

note, i removed the item macro into a separate macro called "misfire"

#

how does it work, @vague relic

broken wolf
#

aahhh

#

i added lead balls as an ammunition for the musket, it should appear in the 2nd dropdown in resource consumption?

hot flower
#

You can also just use ItemMacro and paste the macro in the Item Macro field.

#

i separated them because I got tired of three clicks to open the macro.

vague relic
#

Define workflow, then set workflow.aborted to true

const workflow = MidiQOL.Workflow.getWorkflow(args[0].uuid);
const condition = true
if (condition) { workflow.aborted = true }
broken wolf
hot flower
#

awesome, @vague relic

#

I"m going to look at the reload macro @violet meadow posted and make it consume the right ammo as well.

#

but that's a later project.

vague relic
violet meadow
kind cape
#

What are the exact misfire rules you guys are trying to emulate? πŸ€”

broken wolf
#

@hot flower howd you get the item destruction thing on there?
and the dropdown for the 2nd resource consumption tab, mines empty when i click lol

violet meadow
#

add that after

broken wolf
#

@kind cape im trying to get as close to this one as i can

Misfire. Whenever you make an attack roll with a firearm, and the dice roll is equal to or lower than the weapon’s Misfire score, the weapon misfires. The attack misses, and the weapon cannot be used again until you spend an action to try and repair it. To repair your firearm, you must make a successful Tinker’s Tools check (DC equal to 8 + misfire score). If your check fails, the weapon is broken and must be mended out of combat at a quarter of the cost of the firearm. Creatures who use a firearm without being proficient increase the weapon’s misfire score by 1.

violet meadow
#

So we can trigger before check hits and abort then

kind cape
#

Why are we hooking roll complete then? πŸ€” If the attack is missing when we misfire we can just hook preCheckHits and abort the workflow there, then do the item mutation at the same time

scarlet gale
#

Can set fumble to true as well. Although if you have other things checking for fumbles that would be an issue

#

That will at least run more of the workflow

violet meadow
scarlet gale
#

game.user.updateTokenTargets(targets) should change the targets of a workflow if run early enough right?

violet meadow
#

preambleComplete most of the time is fine

hot flower
#

just updated the macro, @violet meadow and @broken wolf ... working well for me.

#

see the edited version up above.

broken wolf
#

gonna test now

scarlet gale
#

Not just add to it

broken wolf
#

magically i cant roll a friggin 1 or 2 now lol

#

okay theres a 1, no trigger for the saving throw

violet meadow
scarlet gale
#

Yea doing that

hot flower
#

the saving throw doesn't happen when the item misfires. It's a separate action. the macro mutates the pistol (in this case) so that when you click it again, it will roll the dex saving throw.

scarlet gale
#

Just wanted to make sure it wasn't adding, but totally changing the targets

hot flower
#

@broken wolf just messaged you a json of a sample pistol

violet meadow
hot flower
#
const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if ( !actor || !item || !tokenUuid ) return;

let misfireScore = 2;
if ( !item.system.proficient ) misfireScore += 1; // if not proficient the misfireScore is +1 to the normal.

const tokenDoc = fromUuidSync( tokenUuid );
if ( !!d20AttackRoll && d20AttackRoll <= misfireScore ) {
    // Hooks.once("midi-qol.preDamageRoll", () => { return false;});
Hooks.once("midi-qol.RollComplete", () => {console.log("BOOM GOES THE DYNAMITE")});

    const updates = {
        embedded: {
            Item: {
                [ item.name ]: {
                    name: item.name + " (Misfired - Needs repair)",
                    flags: { "midi-qol": { onUseMacroName: "[postActiveEffects]ItemMacro" } },
                    system: {
                        ability: "int",
                        actionType: "abil",
                        target: { type: "self" },
                        // actionType: "other", // This is a duplicate key, please remove or rename it
                        damage: { parts: [ ], versatile: "" },
                        formula: "",
                        save: { ability: "dex", dc: 8 + Number( misfireScore ), scaling: "flat" },
                        consume: {
                            amount: null,
                            target: "",
                            type: ""
                        },
                        uses: {
                            max: "",
                            per: "",
                            recovery: "",
                            value: null
                        }
                    }
                }
            }
        }
    };

    await warpgate.mutate( tokenDoc, updates, {}, { name: "boom gun" } );
}
if ( !d20AttackRoll && this.saves.size > 0 ) await warpgate.revert( tokenDoc, "boom gun" );```
kind cape
#

(For testing macro's I recommend getting DF Manual Rolls, its very useful for when you need a specific value)

hot flower
#

and I set it back to AfterAttackRoll for when the macro triggers

violet meadow
#

Still you aren't aborting anywhere

#

and the hook once is only to show the console log

hot flower
#

ah, i see what you mean.

#

hm. i'm just not getting this hook business.

#

where it's supposed to go.

dark canopy
#

isn't all the warpgate stuff supposed to go inside the hook callback function?

violet meadow
#

Change to ItemMacro | Before Check Hits ```js
const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if (!actor || !item || !tokenUuid ) return;

let misfireScore = 2;
if (!item.system.proficient) misfireScore += 1;

const tokenDoc = fromUuidSync(tokenUuid)
if (!!args[0].attackRoll?.dice[0]?.results[0]?.result && args[0].attackRoll.dice[0].results[0].result <= misfireScore) {
this.aborted = true;
//Hooks.once("midi-qol.RollComplete", async () => {
const updates = {
embedded:{
Item: {
[item.name]: {
name: item.name + " (destroyed)",
flags: {"midi-qol":{onUseMacroName:"[postActiveEffects]ItemMacro"}},
system: {
ability:"int",
actionType:"abil",
target: {type:"self"},
damage: {parts:[],versatile:""},
formula:"",
save: {ability:"dex",dc:8 + Number(misfireScore),scaling:"flat"},
consume: {amount: null,target: "",type: ""},
uses: {max: "",per: "",recovery: "",value: null}
}
}
}
}
}
await ChatMessage.create({content:${item.name} explodes in your face});
await warpgate.mutate(tokenDoc ,updates,{},{name:"boom gun"});
// });
}
if(!d20AttackRoll && this.saves.size > 0) await warpgate.revert(tokenDoc,"boom gun")

#

See if that does it and cleanup later πŸ˜„

#

It will say that you tried to hit yourself when it fails though πŸ˜„

#

That's why its better to Hook on rollcomplete for the mutation

#

@hot flower in the above I have commented out the Hook position

#

Yeah it isn't working with the Hook. That's what I was remembering. Aborting the workflow, will not let as reach RollComplete πŸ€”

kind cape
violet meadow
#

Cause you will be mutating the item mid workflow otherwise with some possible side effects

kind cape
#

Hmm πŸ€” True.. But since the workflow is aborted I would not expect it to make any difference πŸ€”

hot flower
#

it seems to be working ok. but yeah, it's trying to hit the attacking player. It's missing, given it's a 2, but still...

#

instead of a straight dex save, i assume it would be pretty easy, once you have the boom gun mutation, to add an activation check for possession of Tinker's Tools and only allow the dex save if they're present?

#

or are we getting just way too complicated

#

by the way, when I dropped the macro into GPT-4 and asked it what it thought of the macro, this was the response: ```This JavaScript macro appears to be for a game system that uses d20 (20-sided dice) rolls. The macro simulates the misfire of a weapon, which occurs when the attack roll is less than or equal to the misfire score.

  1. The macro first destructures variables from the current context: d20AttackRoll, item, actor, and tokenUuid. If any of these variables are not defined, the macro ends.

  2. The misfire score is set to 2, and if the item's system.proficient property is false (meaning the actor is not proficient with the weapon), the misfire score is increased by 1.

  3. The macro retrieves the token document by calling fromUuidSync(tokenUuid).

  4. The macro checks if the attack roll from args[0].attackRoll.dice[0].results[0].result is defined and less than or equal to the misfire score. If so, the macro does the following:
    a. Sets the aborted property to true.
    b. Constructs an updates object that marks the item as destroyed, sets flags, and adjusts other properties of the item (such as ability, action type, target, damage, formula, save, consume, and uses).
    c. Sends a chat message indicating the item exploded in the user's face.
    d. Calls warpgate.mutate with the tokenDoc, updates, and the name "boom gun" to apply the updates to the item.

  5. If there was no attack roll and the saves size is greater than 0, the macro calls warpgate.revert with the tokenDoc and the name "boom gun" to revert the previous updates.

The macro appears to be designed for a game using the Foundry VTT platform, and the code is written to work with the Midi-QOL module. Note that the Hooks.once part is commented out, so it won't be executed.```

#

which is... pretty good!

hot flower
#

next step would be to make it a world macro and run every time you roll an attack, and look for an AE called "misfire" with a value set to the misfire score. maybe something like this:

dark canopy
#

if you are going world script already -- might as well insert a new weapon property and misfire score field to weapon type items πŸ™‚

carmine ridge
#

hello! I'm messing around with the fog cloud spell (which increases range on upcast rather than damage). I'm stuck on how to actually change the '20 ft sphere" of the item (at level 1 cast) to a "[20 * spellLevel] ft sphere".

if (lastArg.tag === 'OnUse' && lastArg.macroPass==='preItemRoll') {
  const wf = await MidiQOL.Workflow.getWorkflow(lastArg.uuid);
  // spell range multiplies by upcast level (base 20)
  const newValue = 20 * wf.castData.castLevel;
  wf.item.system.target.value = newValue;
}```
doesn't seem to be changing the template placement on the canvas. I am  hoping not to make a worldscript for a single spell hooking to `midi-qol.preTargeting` - any pointers?
hot flower
#

Oh, yeah, i guess you could do that

carmine ridge
#

ItemMacro from an OnUse of 'Called before the item is rolled'.

kind cape
#

Then you should not need the initial if statement, unless you have other things in the same ItemMacro πŸ€”

#

With that being said, at a glance it looks correct

carmine ridge
#

there's another section to remove targets after the targeting is complete because i'm using an aura to apply the blind condition.

#

is there a method that will update the item in the worklow? debugging in the 'after targeting complete' shows no changes to the item.system.target.value have been made.

thorn lantern
#

Im trying to install this modules in foundry but can't do it, Im not sure why. Im using Foundry v9, but I should be able to install them.
Im getting:

  • Midi SRD's Compendium: "Installation failed: k is not defined"
  • More Automated Spells Items and Features compendiums: The download don't end never (I'm using the manifest to version for foundry 9 - https://github.com/jbowensii/More-Automated-Spells-Items-and-Feats/releases/tag/1.1.0)
  • Mr Primates: I can't install this, right?
  • Chris' Premade macros: Same than above.
  • Chris' Module: The 84 tag versions has the same manifest and Im getting the "Installation failed: k is not defined"

Can you help me? I want automatizate the bardic inspiration

vast bane
thorn lantern
#

Sadge

#

Thanks anyways

vast bane
#

ironically the official published midi srd should be useable by you as its v9

scarlet gale
#

Your foundry install might be out of date too

vast bane
#

but bugbears fork of it is v10

scarlet gale
#

The newest v9 should properly say it's for a newer version

thorn lantern
#

The official midi has a bardic inspiration but I can't get an "roll for bardic inspiration" or anything similar

scarlet gale
#

But otherwise yes, most of those are V10 only

thorn lantern
#

It only has a effect

vast bane
#

I have no way of helping you with v9 as I don't have an install of it 😦

thorn lantern
#

no worries

#

just wanted to know how install that modules

vast bane
#

is there a reason why you aren't updating?

#

are you a better rolls/midi user?

thorn lantern
#

I dont know what means "k is not defined" in module installation

#

Im using better roll and midi yes

vast bane
#

k is not defined was an issue with earlier v9 builds when v10 was released, they changed manfiests for modules and it is an error message basically telling you that you can't use them

thorn lantern
#

and I know my world will be broken when I update the foundry version

vast bane
#

they are for v10 foundry

thorn lantern
#

nice

vast bane
#

when and if you update you have to either ditch midi or ditch better rolls so I honestly don't think you can do anything with modern stuff, you are stuck living in that legacy build anything you install will likely disrupt that fragile setup

#

BR and midi compatibility was always a happy side benefit, the new BR absolutely cannot run with midi

thorn lantern
#

Im thinking in remove BR

#

but I still need midi

vast bane
#

how many modules do you have?

thorn lantern
#

and I dont want my world get broken until my campaign finish

#

90~

vast bane
#

I updated with 78 installed, was not bad at all but I was very very ready for it.

#

I also had a week vacation from hosting that let me do it

thorn lantern
#

so if i uninstall BR I can update safety?

#

or i have to uninstall midi too?

vast bane
#

I'm not touchin that statement lol

#

I have no idea what your world is about nor your module combos

#

backup your entire data folders and then try it /shrug

thorn lantern
#

I mean, you said BR is not working in fv10

vast bane
#

as long as you backup, nothing can harm you in trying to update

#

unless you are on a hosting service then god I have no idea

#

I dunno if they let you go back

thorn lantern
#

well, for the moment ill try to get the bardic inspiration and when i have time ill try to update

#

i host locally

vast bane
#

ready set roll is the spiritual successor to better rolls. it works fine in v10 but it cannot exist in a world with midi

thorn lantern
#

illl be fine without ready set roll nor better roll

#

im getting tired of it anyways

vast bane
#

RSR has effect transfer br didn't

dusk tendon
#

I'm trying to add a flag (to work with Midi-QOL) to one of my players' weapons. I cannot, for the life of me, figure out where to use a specific flag, let alone how to customize these flags so I can do it with other items and other effects whose automated functionality isn't completely working "out of the box". Can someone direct me to the right place or a tutorial of how to learn to venture into customization using flags?

For this specific situation, one of my players has the Crossbow Expert feat. When they make a ranged attack with an enemy within 5ft, the attack is being automated, through Midi-QOL, as a disadvantage attack (disregarding the Crossbow Expert feat). I'm trying to add the "flags.midi-qol.ignoreNearbyFoes" to said PC's hand crossbows to bypass the forced disadvantage on an attack roll.

vast bane
#

there is a key for crossbow expert

#

just try dae auto complete till you find it

#

probably nearby should get you it

vast bane
#

oh I wonder if we could use an evaluation here @violet meadow , could we make that only ring true if they have a crossbow equipped?

short aurora
#

Crossbow Expert doesn't have that restriction

#

(for what it's worth)

vast bane
#

oh nm then

#

the user should not put it on the weapon, it should be on the crossbw expert feature

vague relic
#

Can someone explain the flags.midi-qol.onUseMacroName flag to me? I'm calling my macro, but it's not calling at the right macroPass. I've tried putting macroName,macroPass in the field, but the documentation seems to explain that you just put the macro name in the field, and then do an if statement to do it at the right pass

vast bane
#

because weapons can be traded

#

that key is the same thing as an actor on use macro

#

are you using the right macropass in the ae?

#

when does your macro need to be set to?

vague relic
#

idk how to set that

#

it needs to be at preItemRoll

scarlet gale
vast bane
#

well share the macro I guess and someone can tell ya

scarlet gale
#

For example

vague relic
#

like this?
ConSaveSpells,preItemRoll

scarlet gale
#

Yep

vast bane
#

shouldn't there be a space?

scarlet gale
#

Nah

vague relic
#

that's not working for me

vast bane
#

if its not working then the macros not just preItemRoll

#

it also may not work cause you haven't applied it to the actor

scarlet gale
#

Keep in mind if it's set to item macro it'll run the item macro on the item

vast bane
#

if you never set the item to apply on equip the actor doesn't have the ae on them

scarlet gale
#

Not the feature

vague relic
#

the actor has the ae, and it's a world macro

vast bane
#

are you sure its just a preItemRoll? do you get any errors?

vague relic
#

checking the workflow, it says the onuse macro is Post Active Effects for some reason

scarlet gale
#

Edit the effect on the actor to make sure

vast bane
#

are there two macros at play?

scarlet gale
#

Workflow in console is lazy loaded by the time you see it it's done with everything

vague relic
#

wait

#

the effect was override

#

not custom

vast bane
#

could the item roll have a macro and then theres an actor one

scarlet gale
#

That would do it

vague relic
#

πŸ€¦β€β™‚οΈ

vast bane
#

shit we all do that stuff no worries

#

its why we're here

vague relic
#

ty guys

vast bane
#

now we get to watch bugbear respond to the ping in a few hours

scarlet gale
#

Assuming the item is in the evaluation options easily

#

I think the workflow is on there

#

So it would be like workflow.item.type === whatever

#

Not at PC to actually check and verify that

vast bane
#

I was gonna go after the actors data instead

#

but good point it would have to be part of the workflow

vague relic
#

my macro is still causing me issues. Earlier, setting workflow.aborted = true at preambleComplete worked for stopping the rest of the execution of the spell, but now it's not working

vast bane
#

but it doesn't matter I misassumed it was crossbows only

vague relic
#

basically it's a con save to cast a spell macro for Power Word Pain

#

trying to stop the workflow from doing anything if they fail that save

scarlet gale
#

Why even have the pass check?

#

Just have the macro execute on that pass

vague relic
#

that's from when i was trying to figure out how to do it. The documentation does it that way

scarlet gale
#

You can replace js const workflow = MidiQOL.Workflow.getWorkflow(params.uuid);

With js const workflow = this;
As well

vague relic
scarlet gale
#

Yep

#

Also

#

Origin item would just be js this.item;

#

No need to do a uuid lookup

#

Depending on the context of that effect

vague relic
#

wouldn't that be the spell currently being cast, not the item that the effect is from?

scarlet gale
#

Assuming this is an on use macro on the item and not a macro run via a DAE flag

vague relic
#

it's the latter

scarlet gale
#

Then you're good in that regard

vague relic
#

the main thing is the workflow just continuing after setting aborted to true

scarlet gale
#

Is the intent for the spell to have this check?

vague relic
#

I want the actor casting the spell to have to pass this save in order to cast the spell

scarlet gale
#

Or another effect causing them to have to make this check

vague relic
#

latter

scarlet gale
#

So the spell wouldn't always have this?

vague relic
#

This is an actor on use macro that is applied via ae. It's supposed to check when the actor rolls an item, if the item is a spell. If it is, the actor has to succeed a Con save, or the spell isn't cast.

scarlet gale
#

On use macros are good to still use this

#

What's the effect look like?

#

Could I see the details on it?

vague relic
scarlet gale
#
if (this.item.type != "spell") return```
#

Quick way to make sure it's a spell

vague relic
#

Yeah, i've got that part down, it's the abandoning workflow after failing the saving throw that I'm stuck on

scarlet gale
#
this.aborted = true``` should do it
vague relic
#

that's what I have, still no dice unfortunately

#

it's still rolling damage, and applying it

scarlet gale
#

Check to see your if statement is actually working

vague relic
#

it is

scarlet gale
#

Don't do the hook

vague relic
#

I can just tell because it's posting the chat message that happens right before this.aborted is called, and when i look at the args, aborted = true

dusk tendon
vague relic
scarlet gale
#

Cool

vague relic
#

I would like to call that hook if possible though

#

will it just break no matter what?

scarlet gale
#

Why?

#

It's the same workflow

vague relic
#

it's to stop the animation for the spell playing

scarlet gale
#

Oh

#

Ohhh

vague relic
#

ye

#

I can live with it, just would prefer it not to happen

scarlet gale
#

Try placing that after?

vague relic
#

that seems to have mostly fixed it

scarlet gale
#

I for some reason read that as hooking the midi workflow

vague relic
#

it seems like calling return on the if statement is causing the workflow to be abandoned too

#

so the spell is failing either way

#

I kinda need the return though if I'm gonna have the hook happen outside of the else statement

scarlet gale
#

Show me what you have now?

vague relic
scarlet gale
#

Put the hook after the aborted part

#
const item = params.item;```

Can be ```js
this.item```

```js
params.actor.effects.find```

Can be ```js
this.actor.effects.find```
vague relic
#

yeah, it's now just not working when they make the save?

#

I replaced the return with this.aborted = false just to put something there

#

i guess i can just invert the condition and just have an if statement

scarlet gale
#

It should be fine having rolling above the dc just do return

#

Oh actually

#

Wait

#

Shouldn't you return false to cancel

vague relic
#

i figured out what it was

#

i wasn't targeting the token

#

:))))))))))))))))))))))))))

#

:)

scarlet gale
#

Yea, return false should be more correct

#

Except I use a synthetic item instead of a forced roll

vague relic
#

wait okay, the whole reason things break is because I have the token targeted

#

it doesn't care if the workflow is aborted, if the token is targeted, it's getting healed

#

which i don't understand

#

but I think i can just update targets to nothing, and fix that

scarlet gale
#

That seems off

vague relic
#

I have no idea why, but that's how it's working

scarlet gale
#

Return false to cancel instead of setting to aborted

#

That should actually work as intended

vague relic
#

still healing the token

scarlet gale
#

That's very odd

#

Wish I was at my PC to try this myself

vague relic
#

clearing targets is working for now, so it's what i'll go with in the meantime

dusk tendon
#

I'm making sure the monk player in my game has automated Dodge when they use Patient Defense. To have it last until the start of their next turn, am I just applying duration to be 1 round?

scarlet gale
#

Looks right

vague relic
#

i believe that ends when the round ends though

#

I usually set the special duration as well just to be safe

scarlet gale
#

Special duration of source turn start

#

Yea

dusk tendon
#

Awesome, thanks! Man, a lot of this stuff is self-explanatory, but when I've been staring at the screen for the whole day, I miss easy stuff like that :p

vague relic
#

feel that

#

so hard

dusk tendon
#

And last question for the day before I go cross-eyed: I am using Convenient Effects to coordinate with Midi-QOL. Selecting Patient Defense and using it from the monk's character sheet just posts the card to chat, it doesn't "talk" to CE to nor apply the effects of Patient Defense (Dodge and Adv. on DEX saves). How do I make using the Patient Defense item apply the CE "Ki: Patient Defense" item/effect?

vast bane
#

on the monks item theres a checkbox to check for it to apply

#

in the details towards the bottom

#

if there isn't one, you either don't have the right versions installed or you have the dfreds synergy shut off in midi

vast bane
#

no, its higher up and says it

#

is there a language barrier?

#

what version of dfreds CE do you have installed and do not say the newest

#

version numbers of midiqol, dfreds ce, dae

#

(and foundry/dnd5e for that matter

#

You should see something like this:

dusk tendon
#

Foundry: Version 10 Build 291
DnD5e: 2.1.5
DFreds: 4.1.1
DAE: 10.0.23
Midi-QOL: 10.0.33

dusk tendon
vast bane
#

you should have those checkboxes, I wonder if this is a cache issue

short aurora
#

Those are only shown if an effect in DFred's matches case wise, I think

vast bane
#

maybe you should do ctrl F5

#

ah hah

dusk tendon
vast bane
#

yeah is there a language barier?

short aurora
#

So the name of the feature does not match the name of the effect in DFred's, you can add an effect to yours to apply DFred's if you want

vast bane
#

does the monk have different localization than you?

short aurora
#

if you don't like the name or something

dusk tendon
#

I don't know what you are asking about a language barrier. I'm fluent in English :p. And no, all of my players are in US and English as first language

short aurora
#

DFred's is called Ki: Patient Defense and wont show unless you name your feature that

vast bane
#

midi applies CE's based on perfect name matches with items rolled in chat

dusk tendon
#

Got ya, another easy fix...derp. Thanks!

vast bane
#

I had assumed you knew this detail and was wondering if maybe the user has a different language displayed like french or german

#

sometimes strange characters get used in names

short aurora
#

If you don't wanna name your feature that, you can add a key like this to add effects from Convenient Effects

vast bane
#

you can also drag and drop the CE to the item

#

you can literally drag the ce to any item thats on an actor

dusk tendon
short aurora
vast bane
#

It is, you can't drag to sidebar items

#

but you can drag to the effect tab of an item on an actor

dusk tendon
short aurora
#

Ah, you're right, it was the sidebar thing that did it

vast bane
#

I personally only use auto detect for monsters

short aurora
#

Had too many windows open

vast bane
#

all my players have their shit on them cause...well they are the stars of the show

#

you also could probably save yourself an entry in dfreds CE and just drag dodge to the patient defense

#

plus dodge will display the helper info if you use helper messages

dusk tendon
#

My CE posts a card for Patient Defense already.

vast bane
#

heh, did you duplicate dodge?

dusk tendon
#

Nope, that's direct from DFreds. I haven't customized DFreds at all.

vast bane
#

I personally whisper them by default to DM only, and then I manually reveal if the players need them cause those messages spoil names

#

I had no idea dfred had patient defense premade lol

#

Wish he would set the messages to whisper to owner instead of role based restriction

#

actually what I really wish was that dfreds utilized cub/anonymous' name hiding

scarlet gale
#

Can just do a macro.ce dodge too

dusk tendon
#

okay, one more question :p. Are there any reference guides that I can look at to remind myself of @ tags? In particular, how to have an effect use a scaling effect like "WIS mod + Monk level"

#

I think monk level is something like @classes.monk.levels ?

violet meadow
scarlet gale
#

Or look at the pins in the 5e channel

broken wolf
#

@hot flower were we ever able to get the misfire macro working properly? had to duck out for work stuff for a bit

hot flower
#

Me too. Out at tye moment.

broken wolf
#

okie dokie

broken wolf
#

Reading through the github right now and at the part with the spirit guardians spell macro created. That Active Auras mentioned in this section, that’s a mod right?

spice kraken
#

Correct

vast bane
#

spirit guardians is also already made int he samples

scarlet gale
#

There is a lot of spirit guardian macros nowadays

broken wolf
#

I know, but looking at the write up on the GitHub, a lot of this will fix other spell macros I was working on yesterday if I’m understanding it right @vast bane

#

Similar effects and all that

charred bay
#

so, i run games for friends, is there a decent master list of spells that have been automated? i found a script for Hail of Thorns, but it is a V10 and I am having trouble getting it to work.

#

i know there are paid versions

vast bane
# charred bay so, i run games for friends, is there a decent master list of spells that have b...

Sources of premade stuff for Midiqol:

Midi Sample Items Compendium(comes with the module)

Midi SRD's compendiums(this is the manual install link)
https://raw.githubusercontent.com/thatlonelybugbear/midi-srd/master/module.json

More Automated Spells Items and Features compendiums
https://foundryvtt.com/packages/more-automated-spells-items-and-feats

Mr.Primates premade macros:
https://github.com/MrPrimate/ddb-importer/tree/main/macros

Chris' Premade macros:
https://github.com/chrisk123999/foundry-macros

Chris' Module form of his macros:
https://foundryvtt.com/packages/chris-premades

Activation condition examples by ThatLonelyBugbear
https://github.com/thatlonelybugbear/FoundryMacros/wiki/MidiQOL-activation-conditions-examples

broken wolf
broken wolf
soft haven
#

Is it possible to set an activation condition for triggering if the attack exceeds AC by 5?

violet meadow
soft haven
#

Cheers, will do in a bit, thanks for the wisdom

gilded yacht
gilded yacht
gilded yacht
gilded yacht
#

I would have said no, but it is if you are using Monks Token to handle saves. 10.0.34 fixes it. However, advantage on con rolls against specific damage types is not supported, so you'd need to manually adjust.

#

I'm being dense, can you elaborate on the problem, i.e. vitality setting and what's happening versus what should be happening?

violet meadow
narrow saddle
vast bane
# violet meadow

I dunno why but it seems to effect more than just the dead status when auto dead and that setting are in play

violet meadow
#

Incapacitated, Unconscious could be too

rigid slate
vast bane
#

midi can't function without socketlib/libwrapper so that patch note doesn't really matter nowadays

rigid slate
gilded yacht
gilded yacht
violet meadow
#

Character sheet or token hud directly

gilded yacht
violet meadow
#

@vast bane Token Action Hud Core + 5e and MidiQOL + DFreds CE combo is the culprit...

vast bane
violet meadow
#

tposney is taking a look

vast bane
#

that seems weird cause I definitely ran find the culprit and still got it with just dfred/midi on

#

that bug was notoriously flagging innocent modules at fault

violet meadow
vast bane
#

The workaround for me if anyone needs it is to turn off the auto dead in midi and just turn it on in monks little details/combat details or combat booster, or live without auto dead

violet meadow
#

Probably the issue with the empty Vitality field could be triggered on some other updates too. But yeah that is valid for that usecase, until MidiQOL is updated.

#

I ended up remaking most of the MidiSRD functions and cleaning up all the Items to match the dnd5e SRD ones (with changed needed).

That's why I havent pushed the update out yet. It's been quite a lot of work πŸ˜„

#

Warpgate will be a hard dependency. No Advanced Macros needed.

vast bane
#

god it is so dangerous this bug where the custom dfreds shows in sidebar, I've now almost deleted it three times

short aurora
# rigid slate I've been trying to use game.settings.set("midi-qol","splashWarnings",false) fro...

A quick search through the code base seems to suggest it's still there, but all it does is turn off a warning if you're missing dae or a certain version of betterrolls.

if (game.settings.get("midi-qol", "splashWarnings") && game.user?.isGM) {
    if (game.user?.isGM && !installedModules.get("dae")) {
      ui.notifications?.warn("Midi-qol requires DAE to be installed and at least version 10.0.9 or many automation effects won't work");
    }
    if (game.user?.isGM && game.modules.get("betterrolls5e")?.active && !installedModules.get("betterrolls5e")) {
      ui.notifications?.warn("Midi QOL requires better rolls to be version 1.6.6 or later");
    }
  }```
#

this is about all the feedback you'll get from running it in console

broken wolf
#

@violet meadow ```js
const misfireScore = 2;

const { d20AttackRoll, item, actor, tokenUuid } = this ?? {};
if (!actor || !item || !tokenUuid ) return;
const tokenDoc = fromUuidSync(tokenUuid)
if (!!d20AttackRoll && d20AttackRoll <= misfireScore) {
Hooks.once("midi-qol.RollComplete", async () => {
const updates = {
embedded:{
Item: {
[item.name]: {
name: item.name + " (destroyed)",
flags: {"midi-qol":{onUseMacroName:"[postActiveEffects]ItemMacro"}},
system: {
ability:"int",
actionType:"abil",
target: {type:"self"},
actionType: "other",
damage: {parts:[],versatile:""},
formula:"",
save: {ability:"dex",dc:8 + Number(misfireScore),scaling:"flat"}
}
}
}
}
}
await warpgate.mutate(tokenDoc ,updates,{},{name:"boom gun"});
})
}
if(!d20AttackRoll && this.saves.size > 0) await warpgate.revert(tokenDoc,"boom gun")```

seems to work this morning without issue, even more confused cause it wasnt working yesterday lol

#

though it doesnt seem to work if the actor is using two guns with misfire, only lets one be broken at a time, dont think itll be an issue for the game, but ya never know

dark canopy
#

do they have unique names?