#MidiQOL

1 messages ยท Page 10 of 1

vast bane
#

its archived but functioning in v10 I know from a conversation with another user and I use it

covert mason
#

Looks like I'm getting a similar issue. It's telling me I still have no charges

violet meadow
vast bane
#

I don't know how to handle abilities that work close and at range other than to make 2 items, bugbear may know better, hes my goto for guru stuff

violet meadow
#

you can use a macro to differentiate

vast bane
#

I suppose you could just make it a melee weapon with a long reach like Thorn Whip

violet meadow
#

what do you need it to do?

vast bane
#

Its causing false disadvantage flags in melee

marsh crescent
#

Importing is sometimes not enough, sometimes you might need to go in to a skill/ability/feature and modify it slightly to make it work in game.

frosty mesa
#

I went through and enabled everything except DF's mods. That was it.

vast bane
#

I don't know the full feature list of Damage Log, but if its core functionality is that card in your snippets, midi can do that card(and did right below it)

frosty mesa
#

Oh is that what the grey box was?

#

I saw a formula but didn't know what it was doing lmao

vast bane
#

the damage chaser card for midi on the DM side is that thing with the button and the equation

#

buttons

#

I can't dual launch my foundry session cause I have a 16mb application open, but there is a way to setup midi so that the player sees their attack workflow card, and then a similar card to that Damage Log right after it, but the DM won't see that card, instead they see the normal DM damage card. And it basically makes Damage Log redundant afaik

#

if you are interested in trimming redundant modules is all I'm saying

frosty mesa
#

Yeah this is my first real experience with foundry on the DM side. I've been at this for like 10 hours ๐Ÿ˜‚

vast bane
#

well the Moderators would always chime in and say a new user should not jump head first into the deep end of the pool(midi qol) but I did, and I survived, but that could be why your learning process is long here fwiw.

marsh crescent
#

Just keep it simple. Use Foundry as a battlemap. Add some modules that you think that your players would enjoy.

naive zenith
#

Edge case Moto

vast bane
#

I think the problem is he's in the middle of the proverbial pool and really doesn't matter at this point which way they go

#

I will say @frosty mesa one pitfall I fell for early on was trying to watch youtube videos to learn, Foundry changes so often that the entire module loadouts on streamers how to videos wind up being 2-3 versions too old and defunct. So you really do need to watch the release dates on any tutorial videos, if they are more than 2 months old they are almost entirely obsolete, even Baileywiki lol. I kinda feel bad for the folks writing tutorials and readme documents for foundry.

frosty mesa
#

Oh yeah I learned that pretty early when trying to understand what all the descriptions mean for Midi

#

Got a video from six months ago that looks totally different than what it is now lmao

vast bane
#

Tposney's readme doc for midi is pretty rock solid though

#

readme's in general are good across the board, its the video tutorials that wound up throwing down the wrong paths until I caught on that foundry changes so fast that you have to look at when the videos were made.

gilded yacht
#

@dense rune. Here's a chill touch (does not do the hit point gain blocking), but does the undead checking/disadvantage stuff. There's no macro, just activation condition and a flag. The flag expression is awful, but 10.0.12 will let you replace it with

targetId === "@token"
violet meadow
#

Oh I like it "workflow.targets.values().next().value.id === \"@token\"",

gilded yacht
#

It was a bit of pain to setup, but the flags being evaluated when checked to is very convenient.

vast bane
#

I did the hp gain blocking with an AE using the DR flag, and setting it to 999 for the special duration

gilded yacht
#

That would work, you might also be able to do di healing

vast bane
#

I can't remember if I was suppose to post an issue on that or not lol, I think midi is missing healing as an option for either DR or the DI condition

#

I forget which one works and which one needed a change

violet meadow
#

di healing is what I do for the Chill touch macro

loud portal
#

Within an ItemMacro, I have it prompt the user for a value and act accordingly, but I need to limit by an ability mod of the caster. How do I pull the ability mod of the caster while in an ItemMacro?

vast bane
#

yeah DR is the one missing healing as an option

#

checking now, yeah I did DI not DR

gilded yacht
#

I'll have a look at Damage Reduction for healing.

vast bane
#

actually I see it there, I swear I remember actually requesting from you something about healing but I'm misremembering

gilded yacht
violet meadow
#

the isDamaged expiration condition I think Moto

#

for healing

vast bane
#

Yeah, I need to write that down cause I never made that issue on his github

#

is that actulaly midi or dae?

#

or does it not matter when submitting the issue to him?

scarlet stump
#

Is there a way/what syntax should I use to multiply or divide damage using effects? If I pick the alldamage flag for example it automatically adds a "+" symbol so it doesn't work with a * 0.5 value

violet meadow
vast bane
#

asterisks do really strange stuff in the bonus fields

scarlet stump
violet meadow
#

Is this a reaction like what happens with Uncanny Dodge for example?

scarlet stump
#

No it would be a fixed amount based on armor type or other features most likely. I wanted to leverage the automated calculations to use % based DR so that is automatically scales at all levels

violet meadow
#

You could create an advancement scale in the class and reference that in the DR flag probably

scarlet stump
#

I also wanted to create a "weakened" conditions that halved all the damage inflicted (I use it a lot with group/horde type enemies after they are reduced to half hp or less) so I guess I'll check in #macro-polo to see about a script, thanks ๐Ÿ™‚

violet meadow
scarlet stump
#

Ok weakened should be an effect/toggleable condition. It gets applied when the midi-qol wounded condition does using dfreds built in logic so that's easy as you mentioned. The effect should be the equivalent of multiplying all the damage inflicted by 0.5 (attacks, spells, etc).

#

The other thing I would like to do is add something to, IE: a piece of heavy armor that reduces all incoming damage by 33%

violet meadow
kind cape
#

Both should be doable with a world script that uses the MIDI hooks ๐Ÿค”

#

First one could also be done with a warpgate macro on the effect, but a hook is almost certainly cleaner

violet meadow
kind cape
#

Oh right, forgot about on use, yeah that's even cleaner

violet meadow
#

Yeah actually for the half damage thingy I have already something made. Just need to find it...

scarlet stump
#

Ah nice ๐Ÿ™‚

kind cape
# scarlet stump The other thing I would like to do is add something to, IE: a piece of heavy arm...

I've almost gotten this to work, with one problem.. Midi does not seem to respect any changes I make to the workflow damage ๐Ÿค”

Hooks.on("renderItemSheet5e", (app, [html]) => {
    if (app.document.data.type !== "equipment") return;
    if (app.document.data.data.armor === undefined
        || (app.document.data.data.armor.type !== "light"
            && app.document.data.data.armor.type !== "medium"
            && app.document.data.data.armor.type !== "heavy"
            && app.document.data.data.armor.type !== "natural")) return;

    console.warn("App", app);
    console.warn("HTML", html);

    const header = document.createElement("h3");
    header.innerHTML = "Special attributes";
    header.className = "form-header";

    const formGroup = document.createElement("div");
    formGroup.className = "form-group";

    const label = document.createElement("label");
    label.innerHTML = "% Damage Reduction";
    formGroup.append(label);

    const formFields = document.createElement("div");
    formFields.className = "form-fields";

    const inputField = document.createElement("input");
    inputField.type = "text";
    inputField.name = "flags.world.damageReductionArmor";
    inputField.placeholder = "0-100";
    inputField["data-dtype"] = "Number";
    inputField.value = app.document.data.flags.world.damageReductionArmor ?? "";
    formFields.append(inputField);

    formGroup.append(formFields);

    html.querySelector(".details").append(header);
    html.querySelector(".details").append(formGroup);
});

Hooks.on("midi-qol.preDamageRollComplete", (workflow) => {
    console.warn("Workflow", workflow);
    let [target] = workflow.targets;
    let reduction = target.document.actor.itemTypes.equipment
        .filter(item => item.data.flags.world !== undefined
            && item.data.flags.world.damageReductionArmor !== undefined
            && item.data.data.equipped)
        .map(item => item.data.flags.world.damageReductionArmor)
        .sum();
    if (reduction <= 0) return;

    console.log("Target reduces damage by " + (workflow.damageTotal * (reduction / 100)));

    workflow.damageTotal -= workflow.damageTotal * (reduction / 100);
    if (workflow.damageTotal < 0) {
        workflow.damageTotal = 0;
    }
    return workflow;
});

First bit adds a new "special attributes" section to the bottom of details of armors, where the % reduction can be set. Second bit is supposed to read that flag and calculate total reduction, which it does, but MIDI seems to ignore what I change in the workflow ๐Ÿค”

Also this still needs to account for unequipped armor, forgot to add that in.. (EDIT: Fixed, now accounts for that)

lean holly
#

Have you had a chance to look at this?

#

@gilded yacht Has something changed in the way midi handles total? This macro worked a month ago, (my player hasnt summoned his spirit in that long).

violet meadow
kind cape
#

On which object? ๐Ÿค”

violet meadow
#

I think you need to hook on midi-qol.preDamageRoll

The passed workflow is "live" so changes will affect subsequent actions. In particular preAttackRoll and preDamageRoll will affect the roll about to be done.

#

let me try to find an example I had made.

kind cape
#

Problem is, I need to know what was rolled to be able to reduce the damage

vast bane
#

Is there no way to modify damage resistance in the game and add it to items as an additional boost to DR?

#

So that if you wear X armor your DR goes up by X percent?

kind cape
#

DR in MIDI is flat only

violet meadow
#

@kind cape try something like ```js
workflow.setDamageRoll(await new Roll(workflow.damageTotal * (reduction / 100)).evaluate())

kind cape
#

๐Ÿค”

#

Happens when I pass in a straight number to new Roll()

#

God damnit, need to make it explicitely a string for new Roll to not whine -_-

violet meadow
#

ohhh yes

kind cape
#

That seems to work ๐Ÿ˜ฎ

#

So here is a functional macro for it @scarlet stump

Hooks.on("renderItemSheet5e", (app, [html]) => {
    if (app.document.data.type !== "equipment") return;
    if (app.document.data.data.armor === undefined
        || (app.document.data.data.armor.type !== "light"
            && app.document.data.data.armor.type !== "medium"
            && app.document.data.data.armor.type !== "heavy"
            && app.document.data.data.armor.type !== "natural")) return;

    const header = document.createElement("h3");
    header.innerHTML = "Special attributes";
    header.className = "form-header";

    const formGroup = document.createElement("div");
    formGroup.className = "form-group";

    const label = document.createElement("label");
    label.innerHTML = "% Damage Reduction";
    formGroup.append(label);

    const formFields = document.createElement("div");
    formFields.className = "form-fields";

    const inputField = document.createElement("input");
    inputField.type = "text";
    inputField.name = "flags.world.damageReductionArmor";
    inputField.placeholder = "0-100";
    inputField["data-dtype"] = "Number";
    inputField.value = app.document.data.flags.world?.damageReductionArmor ?? "";
    formFields.append(inputField);

    formGroup.append(formFields);

    html.querySelector(".details").append(header);
    html.querySelector(".details").append(formGroup);
});

Hooks.on("midi-qol.preDamageRollComplete", async (workflow) => {
    let [target] = workflow.targets;
    let reduction = target.document.actor.itemTypes.equipment
        .filter(item => item.data.flags.world !== undefined
            && item.data.flags.world.damageReductionArmor !== undefined
            && item.data.data.equipped)
        .map(item => item.data.flags.world.damageReductionArmor)
        .sum();
    if (reduction <= 0) return;

    console.log("midi-qol armor expansion | Target reduces damage by " + (workflow.damageTotal * (reduction / 100)));

    workflow.setDamageRoll(await new Roll(workflow.damageTotal * (1 - (reduction / 100)) + "").evaluate())
    return workflow;
});
violet meadow
#

@lean holly can you add a console.log(damageRoll) after line 12 or something, below this const damageRoll = lastArg.damageRoll;, run the macro and post what that logs in the console?

and also await the MidiQOL.applyTokenDamage function call

gilded yacht
#

Heads up - just released midi 10.0.12 with support for the new damage resistance/damage immunity/damage vulnerability (and dae 10.0.8 - also required). midi 10.0.12 will **NOT ** activate if your dnd system is not 2.0.3 or later.

kind cape
#

No more updates for V9 midi I suspect? ๐Ÿฅน

gilded yacht
#

Only bug fixes, not new features. Latest is 0.9.82 released today.

0.9.82

  • Fix for "isHit" special duration expiring whenever the character takes damage (i.e. cure wounds spell).

0.9.81

  • Fix for templates not being removed on concentration timed expiry.
kind cape
#

Dang, guess I will have to look at upgrading to V10 soon. Its understandable tho

gilded yacht
#

I'm running my game in v10 now (2 sessions so far) and it's been pretty good. First session (3 weeks ago had a few oddities) last session (Saturday) was pretty solid.

violet meadow
#

My next session will be v10. Drag ruler might be the only thing missing right now

vast bane
#

there is that fork for drag ruler

kind cape
#

I really do want to upgrade for other reasons as well, but ATE, AA and Drag Ruler require a patch that isn't verified yet, and ASE does not look like its getting updated so need to replace those spells with custom macros. And 5eHelpers seems to also be dead ๐Ÿ˜ฆ

gilded yacht
#

It seems that quite a lot of the breaking changes now come from the dnd5e changes rather than foundry itself - and the dnd changes seem to come with little warning - or I'm just not looking in the right place.

violet meadow
#

@gilded yacht MidiQOL 10.0.12 doesn't seem to get installed. DAE is up to 10.0.8 and Dnd5e 2.0.3 ๐Ÿค”

#

Uninstalled and tried to install again, but I end up with .11

lean holly
gilded yacht
violet meadow
vast bane
#

does foundry v10+midi look significantly different in appearance to players?

gilded yacht
#

The chat cards can be quite different for the players

vast bane
#

and dnd5e's new stuff, if I'm using vanilla sheets, will the players notice?

gilded yacht
#

Probably not - the traits display on the sheet is the same, it's only when edited that it's different.

violet meadow
gilded yacht
#

@violet meadow Have a look at the chill touch in 10.0.12 - I think it's reasonably neat.

violet meadow
#

oh will do. just bugged my instance when trying to use both Perfect Vision and Elevated Vision for some testing in v10 ๐Ÿ˜„

lean holly
#

This is why I think something changed within midi.

violet meadow
violet meadow
violet meadow
lean holly
#
[{โ€ฆ}]
0
: 
actor
: 
Actor5e {overrides: {โ€ฆ}, _preparationWarnings: Array(0), armor: null, shield: Item5e, _classes: {โ€ฆ}, โ€ฆ}
actorData
: 
ActorData {_id: '5HE64AdGKzusZPhi', name: 'Kappa-liam', type: 'character', img: 'DDimport/Kappa-liam.jpeg', data: {โ€ฆ}, โ€ฆ}
actorUuid
: 
"Actor.5HE64AdGKzusZPhi"
advantage
: 
false
attackD20
: 
undefined
attackRoll
: 
undefined
attackTotal
: 
undefined
bonusDamageDetail
: 
undefined
bonusDamageFlavor
: 
undefined
bonusDamageHTML
: 
undefined
bonusDamageRoll
: 
undefined
bonusDamageTotal
: 
undefined
concentrationData
: 
undefined
criticalSaveUuids
: 
[]
criticalSaves
: 
[]
damageDetail
: 
[]
damageList
: 
undefined
damageRoll
: 
undefined
damageTotal
: 
undefined
diceRoll
: 
undefined
disadvantage
: 
undefined
event
: 
PointerEvent {isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, โ€ฆ}
failedSaveUuids
: 
['Scene.OfsGZ0jMIdTTHTlj.Token.LpROcNqyhtVs7Jyw']
failedSaves
: 
[TokenDocument5e]
fumbleSaveUuids
: 
[]
fumbleSaves
: 
[]
hitTargetUuids
: 
['Scene.OfsGZ0jMIdTTHTlj.Token.LpROcNqyhtVs7Jyw']
hitTargetUuidsEC
: 
[]
hitTargets
: 
[TokenDocument5e]
hitTargetsEC
: 
[]
id
: 
"FSkpo04NvRiYXm39"
isCritical
: 
false
isFumble
: 
false
isVersatile
: 
false
item
: 
{_id: 'FSkpo04NvRiYXm39', name: 'Summon Wildfire Spirit', type: 'feat', img: 'systems/dnd5e/icons/skills/yellow_04.jpg', data: {โ€ฆ}, โ€ฆ}
itemCardId
: 
"2Sb3IGj2LU9E56il"
itemData
: 
{_id: 'FSkpo04NvRiYXm39', name: 'Summon Wildfire Spirit', type: 'feat', img: 'systems/dnd5e/icons/skills/yellow_04.jpg', data: {โ€ฆ}, โ€ฆ}
itemUuid
: 
"Actor.5HE64AdGKzusZPhi.Item.FSkpo04NvRiYXm39"
macroPass
: 
"postActiveEffects"
otherDamageDetail
: 
[]
otherDamageList
: 
undefined
otherDamageTotal
: 
undefined
powerLevel
: 
undefined
rollData
: 
{abilities: {โ€ฆ}, attributes: {โ€ฆ}, details: {โ€ฆ}, traits: {โ€ฆ}, currency: {โ€ฆ}, โ€ฆ}
rollOptions
: 
{advantage: undefined, disadvantage: undefined, versatile: false, critical: false, fastForward: false, โ€ฆ}
saveUuids
: 
[]
saves
: 
[]
semiSuperSaverUuids
: 
[]
semiSuperSavers
: 
[]
speaker
: 
{scene: 'OfsGZ0jMIdTTHTlj', token: 'RL5kW5GaDeurKUJb', actor: '5HE64AdGKzusZPhi', alias: 'Kappa-liam'}
spellLevel
: 
0
superSaverUuids
: 
[]
superSavers
: 
[]
tag
: 
"OnUse"
targetUuids
: 
['Scene.OfsGZ0jMIdTTHTlj.Token.LpROcNqyhtVs7Jyw']
targets
: 
[TokenDocument5e]
templateId
: 
null
templateUuid
: 
null
tokenId
: 
"RL5kW5GaDeurKUJb"
tokenUuid
: 
"Scene.OfsGZ0jMIdTTHTlj.Token.RL5kW5GaDeurKUJb"
uuid
: 
"Actor.5HE64AdGKzusZPhi.Item.FSkpo04NvRiYXm39"
workflowOptions
: 
{lateTargeting: undefined, notReaction: false}
[[Prototype]]
: 
Object
length
: 
1
[[Prototype]]
: 
Array(0)
violet meadow
#

Yeah I mean, do you have a damage Formula on the item? Is there a damageRoll supposed to happen from somewhere else?

lean holly
#

damage happens in the original macro. Summon spirit, place area available to summon, create aoe templete where the summoned spirit hurts people, roll and apply damage, spirit appears.

#
for(let targetToken of targets){

    const save = (await new Roll("1d20+@mod", {mod: targetToken.actor.data.data.abilities.dex.save}).evaluate({async: true})).total;

    targetTokens.add(targetToken)
    if(save >= saveDC){
        saves.add(targetToken)
    }

    newChatmessageContent.find(".midi-qol-saves-display").append(
        $(addTokenToText(targetToken, save, saveDC))
    );

}

await chatMessage.update({ content: newChatmessageContent.prop('outerHTML') });

await ui.chat.scrollBottom();

await MidiQOL.applyTokenDamage(
    [{ damage: damageRoll.total, type: "fire" }],
    damageRoll.total,
    targetTokens,
    itemD,
    saves,
    { superSavers: saves }
)

await new Sequence()
    .effect()
        .file("modules/animated-spell-effects/spell-effects/fire/fire_ball_CIRCLE_05.webm")
        .atLocation(wildfireSpiritToken)
        .scale(1.75)
    .wait(150)
    .animation()
        .on(wildfireSpiritToken)
        .opacity(1.0)
    .play();

damage portion of the macro.

violet meadow
gilded yacht
violet meadow
vast bane
#

its a rule in the dmg I believe

violet meadow
#

@lean holly just DM me the exported item to take a look

lean holly
violet meadow
lean holly
# violet meadow <@285476563066028032> just DM me the exported item to take a look

I am dumb dumb, please forgive me. This was not midi's fault at all. Thank you for pointing out where is it getting damage from. I had neglected to stop the ability from syncing with the beyond importer. That caused the damage formula on the feature to be erased. Which in turn cause the macro to break because there was no damage formula.

unkempt cypress
#

Hi guys, I need a little help.

Because of an item a npc has 1d10 bonus to initiative

#

how can I configure this effect?

#

this ad a random 1d10 1 time but no every combat

violet meadow
vast bane
unkempt cypress
#

oh

#

i ll try

#

nope

vast bane
#

maybe do custom instead of add and then the brackets?

unkempt cypress
#

In the moment I put the brackets the dice roll and the bonus change to the result

kind cape
#

[[]] means "evaluate once and save" so thats not what you want

violet meadow
#

You need to create an ability to add that before combat I would imagine. What's the feature you want to emulate?

unkempt cypress
#

its just a homebrew item passive

#

+1d10 bonus to initiative

violet meadow
#

v9 or v10?

unkempt cypress
#

9

violet meadow
#

Couple of ideas that would need some sort of macro ๐Ÿค”

The most clean solution would be if @gilded yacht could maybe add an optional Midi flag to add a bonus like +1d8 to initiative rolls ๐Ÿ˜„

vast bane
#

You can do it with advantage reminder if you use MTB or Requestor

#

requestor and MTB turn intiative into a ability roll you can see advantage/normal/disadvantage on, and advantage reminder will show there(and you can do manual situational bonus')

violet meadow
#

But this means that the player will need to roll initiative from a hotbar macro

vast bane
#

no don't do that, change how your table does initiative

#

install MTB, click your request roll, select initiative and hit request

#

The hook from yesterday is always playing now instead of on max heal rolls...

#
Hooks.on("midi-qol.RollComplete", function (workflow) {
    if (workflow.damageDetail.filter((detail) => detail.type === "healing").length == 0) return;
    if (workflow.damageRoll.dice.filter((roll) => roll.results.filter((result) => result.exploded !== undefined)).length == 0) return;

    AudioHelper.play({src: "hakuna_meow02.ogg", volume: 0.7, autoplay: true, loop: false}, true);
});
kind cape
#

I might have made a dum dum, lemme check

vast bane
#

Well this is a bummer, I could have sworn it was working yesterday

#

you don't need to check for exploded, if its possible to check for max dice rolls in healing that'd work too

kind cape
#

Exploded should be easier to check for

#

@vast bane

Hooks.on("midi-qol.RollComplete", function (workflow) {
    if (workflow.damageDetail.filter((detail) => detail.type === "healing").length === 0) return;
    let dice = workflow.damageRoll.dice;
    let explodedDice = dice.filter((die) => {
        return die.results.filter((result) => {
            return result.exploded ?? false;
        })
    });
    if (explodedDice.length === 0) return;

    AudioHelper.play({src: "sounds/dice.wav", volume: 1, autoplay: true, loop: false}, true);
});
#

I think I might have introduced a subtle bug to it at some point, can you try this version with your own sound?

vast bane
#

went to test it and my world is hanging on load so dealing with that now first apparently

vast bane
#

Is this hook ok to use with worldscripter module?

violet meadow
#

yes. you can also just type that in the console when you want it

#

Reload and its gone

unkempt cypress
#

its posibble to add condition immunities to effects?

vast bane
#

type just CI and it should auto complete what you seek

#

in the left field

unkempt cypress
#

๐Ÿ˜ฎ

#

thanx uwu

kind cape
vast bane
#

its a dnd5e flag that you want, so starts with data

unkempt cypress
#

i didnt know that ci means that XD

vast bane
#

only 2 initial one that confuses me constantly is the two different DR's

covert mason
#

@violet meadowOne thing I'm noticing with the curse macro you worked on yesterday. Whenever my players use it, they get no dialogue popup to heal an extra target.

#

Seems to pop up for me, though.

spring dove
#

I cannot for the life of me figure out why this macro is running twice and apply the condition twice to the target

violet meadow
spring dove
#

That feels like what's happening, but I can't figure out how to get it to only apply corroding once

violet meadow
violet meadow
violet meadow
# spring dove

Check your MidiQOL settings => Workflow settings => Workflow tab. There is an entry towards the top about auto applying CE conditions. What's it like for you?

spring dove
#

Apply CE, if absent apply item effects

covert mason
violet meadow
spring dove
#

Tried changing it to "Apply item effects, if absent apply CE" and it has the same problem

violet meadow
spring dove
#

thanks for the tip, I'll try it

unreal vector
#

I'm trying to make a weapon that does more damage to charmed targets.

Could I add damage to the other field like for a dragon slayer weapon using @raceOrType".includes("dragon") in the roll other damage setting?

celest bluff
# covert mason I've given everyone ownership of the macro, and still no luck.

My personal take on the spell failure would be, can create a temporary item on the caster for the healing portion or use either complete item use to rewrite and roll it or update the temp healing item with warpgate and roll it. Within that item, you'd have it give a dialog whom to select to heal with the damage dealt. Just sucks it happens on the enemies turn.

#

Overtime should let you let run macros on it

violet meadow
#

I am a bit lost between versions right now, but there might be a way to use @target directly to check for the effects on them.
It might be a v10 thing though

acoustic jasper
#

with a new Chill Touch I can select a "type" for the effect to work ( details.type.value === "undead" ). Can I insert a token name instead? For example if Paladins Aura gives disadv to all enemies against his allies (but not against him)?

violet meadow
#

The activation condition by itself cannot be passive. It needs to be connected to an item roll

vast sierra
#

as an aside, Active Aura's not updated for v10 yet...

violet meadow
#

If now you would like to use this "Paladin Aura" as a feature that would affect creatures in a specific radius and "curse" them for some time, you can use targeting with Midi against Enemies in a specific radius

#

Correct, should have mentioned that Active Aura's not officially updated for v10 (but there is a working fork)

#

OK @covert mason lets see what's going on. Hit me with the latest version of the macro, as I cannot keep track easily ๐Ÿ˜„

violet meadow
#

I wonder if in Janner's case, triggering a Requestor's request might solve the issue

celest bluff
#

well each damage it deals, they pick someone to heal

celest bluff
#

One way to do is to store the item uuid with a midi flag on the active effect. Then you can reference the flag when needed and roll the item on the actor.

#

Overtime I think generates a workflow

#

Else you can reference the chat history

violet meadow
violet meadow
#

Alright, give me 5 to make sure I grab the correct id for the player

celest bluff
#

Can use that or make an item

vast bane
#

@gilded yacht With the sunsetting of dnd5ehelpers in v10, do you have any plans on picking up some of the automation it provided like reacharging on X-6 stuff, wildmagic surge, Lair/Legendary stuff, and regeneration features?

violet meadow
covert mason
violet meadow
#

Just try with more players connected to make sure I didn't mess up the whisper... It shouldn't but ๐Ÿคท

covert mason
#

It's a shame it doesn't like the RPG UI I use, but heyho. Not the worst thing ever

vast bane
#

Zhell is very responsive to feedback on his modules if you put in an issue on his git I bet you he'd be responsive

#

Is it not possible to have a reaction prompt after the attack roll but before the damage is applied like how shield works?

violet meadow
#

Reaction Damaged does this. What are you looking for?

#

Ah wait

vast bane
#

Will it override a hit to miss?

violet meadow
#

nope the Reaction can though

vast bane
#

hmmmm, I thought it wasn't let mecheck

#

well shit, I dunno what didn't cause it to pop up the first time I tried it but yeah, reaction is doing it

#

No wait I see the problem

violet meadow
#

Maybe you had already used the reaction for the round

vast bane
#

The problem is you can't see the roll

#

it prompts you and you have no idea what the roll was, I believe raw, you can see the roll

#

or maybe I'm misunderstanding that

violet meadow
#

You mean something like add a 1d4 to your AC as a reaction?

vast bane
#

oh DSN shows us actually

#

No, the prompt for shield(and other reactions) comes before the attack is displayed in chat

#

but DSN shows the dice rolled so there is that to cover up the flaw

violet meadow
vast bane
#

so as long as the setting for DSN spoiling rolls is on, then shield can be properly sussed out whether you need to use it and whether its worth using

violet meadow
#

There are options as to what to be shown for the reaction

vast bane
#

Man its crazy how even this far into midi I still get shown shit that was right in front of my nose I had no idea existed lol

#

I had that drop down set, but I take it the checkbox above enables it

#

Yeah its not working, is it not compatible with merged cards?

#

(DSN still fixes this on its own as the dice totally spoil the roll)

#

wait I think its cause attack roll total can't be calculated yet...

#

Yeha its the Merge cards/condensed setting messing with this

#

if you have that setting off, the attack roll is shown to the defender, if its merged, it sits undisplayed till the damage is done

#

but again, DSN actually catches this problem and solves it accidentally

#

In a way, DSN is actually the legit way cause the player is not suppose to know the modifiers involved, just what the roll was anyway.

violet meadow
#

๐Ÿค” I for sure cannot follow that right now as its too late ๐Ÿ˜„

vast bane
#

Also reactions that boost saving throw modifiers to prevent failing a save don't work right in reaction either. It just flat out does not do anything with spells like fireball or sacred flame.

covert mason
#

I'm trying to automate this, but regardless of whether the target saves or not, it still applies the healing. I used this macro from another spell I found in this server.

async function wait(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); }
const lastArg = args[args.length - 1];
if (lastArg.hitTargets.length === 0) return {};
let actorD = game.actors.get(lastArg.actor._id);
let tokenD = canvas.tokens.get(lastArg.tokenId);
let target = canvas.tokens.get(lastArg.hitTargets[0].id);
let healingType = "healing";
let damageTotal = Math.floor(lastArg.damageTotal / 1);
let damageRoll = new Roll(`${damageTotal}`).evaluate({ async: false });
new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, healingType, [tokenD], damageRoll, { flavor: `(${CONFIG.DND5E.healingTypes[healingType]})`, itemCardId: lastArg.itemCardId, damageList: lastArg.damageList });
let targetList = `<div class=\"midi-qol-flex-container\"><div class=\"midi-qol-target-npc midi-qol-target-name\" id=\"${target.id}\">hits ${target.name}</div><div><img src=\"${target.data.img}\" width=\"30\" height=\"30\" style=\"border:0px\"></div></div><div class=\"midi-qol-flex-container\"><div class=\"midi-qol-target-npc midi-qol-target-name\" id=\"${tokenD.id}\">heals ${tokenD.name}</div><div><img src=\"${tokenD.data.img}\" width=\"30\" height=\"30\" style=\"border:0px\"></div></div>`;
await wait(500);
const chatMessage = await game.messages.get(args[0].itemCardId);
let content = await duplicate(chatMessage.data.content);
const searchString = /<div class=\"midi-qol-hits-display\">[\\s\\S]*<div class=\"end-midi-qol-hits-display\">/g;
const replaceString = `<div class=\"midi-qol-hits-display\"><div class=\"end-midi-qol-hits-display\">${targetList}`;
content = await content.replace(searchString, replaceString);
await chatMessage.update({ content: content });
await ui.chat.scrollBottom();```
gilded yacht
vast bane
#

I understand that overtime could probably handle regeneration probably, and your legendary resistance item works great, but lair/leg actions and the recharge are the things that break my heart that are gone in v10.

loud portal
#

I am looking to add the effects to a Spellguard shield, how do I grant an effect where the actor has "advantage on saving throws against spells and other magical effects, and spell attacks have disadvantage against" them? I found I can add a custom damage resistance of 'magic-resistant' which would do the first half, but I'm not sure for the other. I assume both are flags, I just can't pin down which ones

vast bane
#

the magic resistance flag+ the two rsak/msak flags for (grant)disadvantage

loud portal
# vast bane

That is exactly what I was looking for, thank you!

vast bane
#

I've been known to mistake grant and regular advantage flags, I think thats the right set lol. My thin brain does not know how to evaluate the two sets for which one I need most the time.

stray temple
#

No animations and no damage application with midi

vast bane
# stray temple

oh have you tried find the culprit and just used the bare minimum modules to see if maybe a module is doing it?

stray temple
#

Yes it is midi...

vast bane
#

I wonder if its because there is no value in the length field on the item...which is weird cause its Instantaneous so there should be no need for length...

stray temple
#

If I go bare bones automated animations and sequencer it works

vast bane
#

set it to 0 minutes

stray temple
#

Will try

gilded yacht
# stray temple Will try

There's a problem with the custom damage resistance of the target, midi expects that to be an empty string if there are none and it's undefined/null which it shouldn't be. I'll put a guard for that case in 10.0.13 (and I don't need the item after all).

scarlet stump
violet meadow
violet meadow
kind cape
kind cape
scarlet stump
#

thanks again!

violet meadow
#

Might also need some math floor or ceil in the damage roll calculation

kind cape
#

I was kinda betting on MIDI taking care of that, but I did never test if it did ๐Ÿ˜…

celest bluff
#

heh to get around the versioning,

const version = Math.floor(game.version);
let effect = tactor.effects.find(i => (version > 9 ? i.label : i.data.label) === "whatever");
#

gotta hand out stuff from v9 > v10

solid mountain
#

Is there a way to add cumulative exhaustion from an effect?

#

(midiqol + dae + DF conditions)

#

As in each time it hits it increases exhaustion with 1

scarlet stump
#

you can use this with dfreds, replacing the condition with the proper exhaustion level. It'll also autoremove previous levels of exhaustion from the token automatically due to hidden dfreds mechanics:

let uuid = token.actor.uuid;
let hasLvl1Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination I', uuid);
    let hasLvl2Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination II', uuid);
    let hasLvl3Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination III', uuid);
      let hasLvl4Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination IV', uuid);
      let hasLvl5Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination V', uuid);
      let hasLvl6Applied = await game.dfreds.effectInterface.hasEffectApplied('Contamination VI', uuid);
        if (!hasLvl1Applied) {
          await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination I', uuid });
        } else if (!hasLvl2Applied) {
            await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination II', uuid });
          } else if (!hasLvl3Applied) {
            await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination III', uuid });
          } else if (!hasLvl4Applied) {
            await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination IV', uuid });
          } else if (!hasLvl5Applied) {
            await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination V', uuid });
          } else if (!hasLvl6Applied) {
            await game.dfreds.effectInterface.addEffect({ effectName: 'Contamination VI', uuid });
          } else {
            console.log('Nothing to do!');
          }
//if used as part of an item with On Use Macro, change line 2 with the following one to contaminate the caster:
// let uuid = args[0].actorUuid;
// or with this one to contaminate the target:
//let uuid = args[0].targetUuids[0];
//}
opaque current
#

Heh, I have basically that set up with CUB

solid mountain
#

I'm trying to figure out something interesting for a plague dragon breath attack.

#

Your solution might work very well, with exhaustion or like a con penalty or something.

scarlet stump
#

oh also this condition has 6 levels instead of 5, so remove that part

#

If you need this to work in aoe you have to add a for loop like this one:

// or with this loop to contaminate aoe targets:
for(const targUuid of args[0].targetUuids) {
  //Put your code here
  }
// targUuid is the UUID of the individual ones
celest bluff
solid mountain
#

I'll have to make it sorta manual though, since as far as I know Active Auras isn't updated for v10

opaque current
#

There are PRs that work apparently.

solid mountain
#

Another question, I notice that if you decrease CON value via an effect it wont affect hp.

#

Is there a way to do that? Or am I missing something, it SHOULD lower the max hp right?

celest bluff
#

nope

kind cape
#

Theoretically yes, it should lower it, but there is no automation for it

celest bluff
#

You could write a calculation for and warp gate it, would be the safest way

kind cape
#

Using an AE could work, especially if it's just a short lived effect, but it has some issues (no way to adjust max while the effect is active). So using warpgate is better

celest bluff
#

Unless you wanna do a like -1d4 to max hp or something, then DAE is fine

#

make sure to wrap in -[[1d4]]

#

else if there's an update to the actor it'll stack again

solid mountain
#

That could work.

#

Just give the character -2 to con and -1d4 or something to max hp.

#

And stack it for each hit.

molten solar
#

If you use an effect to deduct from the con mod, just warpgate the entire thing tbh

#

read current max hp, current con value, character level,, make a calculation, and then a warpgate update

#

Warp Gate can stack.

solid mountain
#

Yeah, could work. I might try that.
Although I'm trying to keep my workload low since it's "just" one fight. But then again... learning by doing.

#

I need to sort the fight into phases too.

kind cape
#

Well a -2 to con is always a -level to max, just FYI

#

Of course since it could be -1 & -1 a macro is probably needed

solid mountain
#

Can you do a -@something.something.level ?

#

Instead of [[1d4]] thing

molten solar
#

@details.level is the character level

solid mountain
#

would it restack on an update as crymic said?

molten solar
#

Or more appropriately for a macro, actor.system.details.level

molten solar
#

If it doesn't involve dice, I don't see any issue

molten solar
#
const target = /* however you get the target actor of this thingamajig */
const effect = target.effects.find(e => e.getFlag("world", "con-down"));
const stack = effect?.getFlag("world", "con-down") ?? 0;
if ( !stack ) {
  await target.createEmbeddedDocuments("ActiveEffect", [{
    icon: "steve.webp",
    label: "Ouchies",
    "flags.core.statusId": "steve",
    "flags.world.con-down": 1,
    changes: [
      {key: "system.abilities.con.value", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: -2},
      {key: "system.attributes.hp.max", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: -1}
    ]
  }]);
} else {
  await effect.update({
    changes: [
      {key: "system.abilities.con.value", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: -(2 * (stack+1))},
      {key: "system.attributes.hp.max", mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: -(stack+1)}
    ],
    "flags.world.con-down": stack+1
  });
}
const {value, max} = target.system.attributes.hp;
await target.update({"system.attributes.hp.value": Math.clamped(value, 0, max)});
#

Tested it. Works great. Modifies con value and max hp and sets the current hp as well.

vast bane
#

Now do it in v9 ;p

#

I'm just kidding btw

covert mason
molten solar
violet meadow
#

Shouldn't need many changes.

data instead of system in the keys and updates and also change to ```js
const {value, max} = target.getRollData().attributes.hp;

#

Only thing worth mentioning, is that it needs to be executed by a GM account or someone with permissions to alter the target.

mossy oak
#

Hello! new to foundry and wanting some automation as a DM I'm trying to enhance some features I'm going to use. But I've encountered a problem with DAE + Midi-qol. I'm trying to obtain an effect toggled by the use of an ability. The effect per se should do nothing, I only need it to be active to track the duration with DAE.
As in the screenshot, once rolled the effect remain inactive. only once I've managed to get it work but I've lost it somehow.

violet meadow
#

and effect suspended

violet meadow
#

I end up using the getRollData() whenever possible to avoid the need to change the system to data.data

mossy oak
violet meadow
mossy oak
#

for sure! will do right now

violet meadow
#

@gilded yacht MidiQOL v10.0.12. This error pops in console, when you roll, from an actor on the sidebar, an item that has Target Self WITHOUT a token present on the scene.

The issue is not that it doesn't roll, but the error displayed is thrown off for some reason.

As @mossy oak uncovered I think that the error displayed should be something along the lines:```js
export async function getSelfTarget(actor) {
if (actor.token)
return actor.token.object; //actor.token is a token document.
const speaker = ChatMessage.getSpeaker({ actor });
if (speaker.token)
return canvas?.tokens?.get(speaker.token);
throw new error("Could not get a target for self");
}

gilded yacht
violet meadow
#

@gilded yacht I have this item that uses the DAE.onUpdateTarget method. In v9.280 Foundry, DnD5e 1.6.3, MidiQOL 0.9.81, DAE 0.10.32 and ItemMacro 1.8.0, it doesn't work, but I am certain it was working on some previous versions.

Something off maybe when checking for (it actually monitors data.attributes.hp.value) ```js
else if (lastArg.tag === "onUpdateTarget") {//do stuff
}


In v10 the same item works OK, after a small change in the ItemMacro to use `lastArg.updates.system.attributes.hp.value` instead of `data`


edit: hmmm I might have messed something up big time with this one... Trying to figure it out now
molten solar
dense rune
#

Hi! I'm trying to understand the "workflow" object that it's returned when using a Hook on a midi event. How can I copy this recursive object into my clipboard/file so I can inspect the attributes in an easier way?

(I'm looking for the targets of the actor that triggered the "midi-qol.preAttackRoll" in the workflow object)

violet meadow
#

console.log(workflow) in the hook should log it in console

dense rune
#

yes! I already did that but it's difficult to navigate through all the properties in the console that's why I want to export/copy that object to an actual editor so I can look for the attributes I need

#

the problem is that it is a recursive object so it's not possible to copy("golbal_workflow_variable") in the console

violet meadow
#

I have always been using console and or going through the actual files to do that and never occurred to me doing a copy paste to an external editor

short aurora
#

Same, turned on debug messages, of course I could just have read it from the repo... ._.

violet meadow
#

Don't know if that is possible between tbh (the copy paste of an object from console)

dense rune
#

you can copy to the clipboard an object as long as it's not recursive

#

hehe

violet meadow
#

aslfdjalflajhf

#

yes to that ๐Ÿ˜„

dense rune
#

Anyway, actually my real problem is that I can't get the targets of the actor which triggered the "midi-qol.preAttackRoll" event.

#

Looks like the target variable is empty... ๐Ÿ˜ฆ

#

any ideas? Maybe I'm looking in the wrong place

#

If actor A targets actor B and attacks with weapon X, the workflow object should have actor B information (at least token information) right?

violet meadow
#

yes afaik. v10?

dense rune
#

v9

#

I'm not brave enough to migrate to v10 yet hahahahaha

violet meadow
#

That's with just a plain ```js
Hooks.on("midi-qol.preAttackRoll", (workflow) => {
console.log(workflow)
})

dense rune
#

!!!

violet meadow
#

Do you have a target option defined on the item?

spring dove
#

Does OverTime have the ability to apply a macro CE

spice kraken
#

Yeah

violet meadow
spice kraken
#

Just use macro.CE in a different effect below the OT

spring dove
#

Yeah I have, but when OT removes itself, it's only removing the OT effect, not the associated macro

spice kraken
#

Can you show how you have it setup?

#

Can you show the whole OT

violet meadow
#

Can you try statusEffect?

spring dove
#

oh heck

#

thought it did, hold on

dense rune
spice kraken
#

Also use override, not custom for the OT

spring dove
spice kraken
#

remove the last ,

spring dove
#

saveRemove=true ?

spice kraken
#

and remove the applyCondition

violet meadow
#

Try setting 1 | | creature in the target

spice kraken
dense rune
spring dove
#

Comme sa?

violet meadow
spice kraken
#

Make sure you're in combat

#

Also to be safe, make the scene active

spring dove
#

It is, yep. And looks like that worked, thank you!

spice kraken
#

That last comma needed to be removed cause with it, you're saying hey, I'm adding 1 more thing, and because you aren't it breaks

spring dove
#

I swear I learn more here than I ever did in college

dense rune
violet meadow
#

oh lol

dense rune
#

My bad ๐Ÿ˜… thxblob

violet meadow
#

dont kill your loyal test subjects

dense rune
#

Happens too often facepalmpicard

kind cape
#

@dense rune This chonked piece of code can be used to output the entire structure of the workflow. BUT. Its a chonker, usually 20+MB ๐Ÿ˜…

function refReplacer() {
  let m = new Map(), v= new Map(), init = null;

  return function(field, value) {
    let p= m.get(this) + (Array.isArray(this) ? `[${field}]` : '.' + field); 
    let isComplex= value===Object(value)
    
    if (isComplex) m.set(value, p);  
    
    let pp = v.get(value)||'';
    let path = p.replace(/undefined\.\.?/,'');
    let val = pp ? `#REF:${pp[0]=='[' ? '$':'$.'}${pp}` : value;
    
    !init ? (init=value) : (val===init ? val="#REF:$" : 0);
    if(!pp && isComplex) v.set(value, path);
   
    return val;
  }
}
    console.warn("Workflow", JSON.stringify(workflow, refReplacer(), 4));
violet meadow
#

20+ MB ๐Ÿค•

kind cape
#

Yeah ๐Ÿ˜… But at least its nicely formatted! ๐Ÿ˜‚

dense rune
#

thank you

#

hahahahahah

#

Btw I almost managed to fully automatise the Spirit Totem thingy, do we have a community repo for macros?

spring dove
#

Let's say you have a torch. It lasts 1 hour. And let's also say it's important in your games to track time and resources used. Is there a way to preserve an item's time spent if they end the effect of that item before it expires?

kind cape
#

That sounds.. Difficult.

spice kraken
#

I would just have them keep track of that manually

violet meadow
#

DAE on/off could do that too.

spring dove
#

Could you walk me through this step by step?

#

The DAE

violet meadow
#

Unfortunately not right now.

spring dove
#

no worries, I'll try to figure it out

violet meadow
#

I can write something for that when I have some time tomorrow maybe

spring dove
#

That'd be awesome

violet meadow
#

To be honest I never deal with torches and food in my games. As long as the players donโ€™t overdo it by forgetting their basic needs from time to time, I am fine

spring dove
#

Yeah we do. We track time and days pretty rigorously. In part because this is a survival campaign, but also because encumbrance is an important part of balance in our games.

lucid barn
#

toll the dead from midiqol (v10) is wrong... rolling d8**+**d12 when the creature is not at full HP . Is it to be expected from the macro? Thanks

spice kraken
#

Isn't it 1d8 if not damaged, and 1d12 when damaged?

molten solar
lucid barn
spice kraken
#

I think? Working rn so I can't check

#

Plus I'm on v9 so can't check the v10 version

lucid barn
#

lvl 5, two dices.. I imagine it's because of the cantrip scaling, and the macro isn't working well with it.

spice kraken
#

What happens when you remove the scaling val

lucid barn
spice kraken
#

you could make 2 different scale values and reference those in the macro

lucid barn
spice kraken
#

Can you show a screenshot of the macro where it rolls the damage

lucid barn
# spice kraken Can you show a screenshot of the macro where it rolls the damage
try {
    if (args[0].macroPass === "preDamageRoll") {
        const target = await fromUuid(args[0].targetUuids[0]);
        const needsD12 = target.actor.system.attributes.hp.value < target.actor.system.attributes.hp.max;
        const theItem = await fromUuid(args[0].uuid);
        let formula = theItem.system.damage.parts[0][0];
        if (needsD12) 
            formula = formula.replace("d8", "d12")
        else 
            formula = formula.replace("d12", "d8");
        theItem.system.damage.parts[0][0] = formula;
    }
} catch (err) {
    console.error(`${args[0].itemData.name} - Toll The Dead ${version}`, err);
}```
spice kraken
#

Now I don't know JS at all nor macros but can you test something. replace both d8s with @details.level and attack another PC that has full hp

#

On v9 the scaling is working without any changes

lucid barn
spice kraken
#

ยฏ_(ใƒ„)_/ยฏ

violet meadow
lucid barn
#

thansk anyway o/ @spice kraken

molten solar
#

When is that macro executed and why don't you just execute the roll from a clone if the regular item does not work?

#
const {value, max} = game.user.targets.first().actor.system.attributes.hp;
const formula = value < max ? "1d12" : "1d8";
await item.clone({"system.damage.parts": [[formula, "necrotic"]]}, {keepId: true}).use();

ยฏ_(ใƒ„)_/ยฏ

violet meadow
#

The formula should have the full cantrip scaled damage, no?

molten solar
#

No ๐Ÿ™‚

violet meadow
#

ah so then there is the issue

spice kraken
#

Would that macro account for scaling?

molten solar
#

Just set it to scale as a cantrip and leave the field empty

#

and declare item somehow I guess.

#

With 70+ lines of DAE and Midi code /s

hot flower
#

i just took out the damage in the cantrip scaling and it works great now.

violet meadow
#

I am trying to figure out why I never had that issue ๐Ÿค”

hot flower
spice kraken
#

are you v9 or 10

hot flower
#

v10

violet meadow
#

Yeah I think that the v10 Toll the Dead incorrectly adds the scaling dice in the scaling field. v9 left it blank @gilded yacht

violet meadow
stoic seal
#

@celest bluff I was wondering but do you perhaps have Spirit Shroud set up for midiqol with the choices to choose a damage type on the spell?

celest bluff
stoic seal
celest bluff
#

I'll see if I got time today to make it

stoic seal
#

Thank you!

spring dove
violet meadow
#

If not get it ๐Ÿ˜„

Then on the torch create an (D)AE and in the details page of it you will see the Effect Macros dropdown menu.

Get the macros that Zhell wrote into their respective places (effect creation and effect deletion) and rejoice ๐Ÿ˜„

molten solar
#

I assume you have module(s) taking care of the actual effect creation?

#

If the effect is transferred from the item immediately when added to the actor, adding an 'on create' macro will be pointless.

violet meadow
#

I mean let's all hope as we are in MidiQOL.

Just make the item target Self in the 3rd box, so that it will create the effect on them when rolled!

spring dove
#

What is the module called, babe?

celest bluff
#

You can also use the same method with DAE

spring dove
#

well I know I have DAE

celest bluff
#

DAE also provides a set flag

spring dove
#

I'm still pretty new to this. If you have time, I'd ask you to walk me through it

#

So I'm in DAE, and I make a new effect on the item. Where do I put the macros Zhell wrote?

molten solar
#

You don't. ๐Ÿ™‚

spring dove
#

See how little I know?

molten solar
#

You need some entirely different macros. The above were written for Effect Macro.

spring dove
#

Ok

molten solar
#

A module by the name of Effect Macro.

spring dove
#

I'll go install that. Any incompatibilities I shouldn't cross streams with?

molten solar
#

Does the system you use support Active Effects?

spring dove
#

It does not. The only module close to that name is Active Auras

molten solar
#

It does.

#

Which means Effect Macro is compatible.

#

It ain't got no damn incompatibilities. ๐Ÿคฃ

spring dove
#

๐Ÿ˜ฉ

dense rune
spring dove
#

ah, you authored Effect macro

#

Alright, I've got effect macro

#

Do I put these macros in Item Macro?

dense rune
#

Hey! Really quick question, so I'm trying to ask the player before the workflow goes on but it seems that the workflow will not wait for the user. (I'm trying to mimic the reaction pop up with a dialog) Any ideas about what I should do?

Here is the code:

/* 
Hawk Spirit

The hawk spirit is a consummate hunter, aiding you and your allies with its keen sight.

When a creature makes an attack roll against a target in the spirit's aura, 
you can use your reaction to grant advantage to that attack roll. In addition, 
you and your allies have advantage on Wisdom (Perception) checks while in the aura.
*/

Hooks.on("midi-qol.preAttackRoll", (workflow) => {
    console.log(workflow)

    let totemActiveTokens = game.actors.getName("Unicorn Totem Actor").getActiveTokens();

    if (totemActiveTokens.length > 0) {
        let totemActiveToken = totemActiveTokens[0]

        let tokensAroundTotem = MidiQOL.findNearby(null, totemActiveToken, 30, null)

        let tokenIdsAroundTotem = tokensAroundTotem.map(token => token.data._id)
        let tokenIdsTargeted = Array.from(workflow.targets).map(token => token.data._id)

        let filtered = tokenIdsAroundTotem.filter(value => tokenIdsTargeted.includes(value));

        if(filtered > 0) {
            displayReaction(workflow)
        }
    }
});

function displayReaction(workflow) {
    let dialog = new Dialog({
            title: "Hawk Totem Passive",
            content: `Do you want to grant attack roll advantage to ${workflow.actor.name}? (Cost: 1 Reaction)`,
            buttons: {
                yes: {
                    icon: '<i class="fas fa-bolt"></i>',
                    label: 'Select',
                    callback: () => {
                        workflow.advantage = true;
                    }
                },
            },
        }
        ).render(true);
        
    dialog
}
molten solar
dense rune
short aurora
dense rune
#

I've already tried with async and await (that was indeed my first try) but the behaviour is the same

spring dove
#

comme sa?

dense rune
#

Does MidiQOL have something to mimic the reaction pop up behaviour? (Where the roll is paused until it gets the answer from the player?)

spice kraken
#

Yeah

#

Optional settings

dense rune
dense rune
spring dove
#

@molten solar do I need to change any of these settings in the item details?

molten solar
spring dove
#

OH yeah, sorry I meant other than that. As in, when the hour is up, will it self delete with the "destroy on empty" check, or do I need to set charges or anything

kind cape
#

@dense rune Dialogs use callbacks, the easiest way to do this is probably to create a promise outside, then resolve it in the dialog. Then you can await the promise to wait for the user to do something

dense rune
# kind cape <@255775562071670785> Dialogs use callbacks, the easiest way to do this is proba...

That was my first attempt, didn't work hehe... Is this what you mean?

async function displayReaction(workflow) {
    let dialog = new Promise((resolve, reject) => {
        new Dialog({
            title: "Hawk Totem Passive",
            content: `Do you want to grant attack roll advantage to ${workflow.actor.name}? (Cost: 1 Reaction)`,
            buttons: {
                yes: {
                    icon: '<i class="fas fa-bolt"></i>',
                    label: 'Select',
                    callback: async () => {
                        workflow.advantage = true;
                    }
                },
            },
        }
        ).render(true);
    })
    await dialog;
}
molten solar
kind cape
#

Close, without having an editor open, so this may not even run, but something like this:

function displayReaction(workflow) {
    let dialog = new Promise((resolve, reject) => {
        new Dialog({
            title: "Hawk Totem Passive",
            content: `Do you want to grant attack roll advantage to ${workflow.actor.name}? (Cost: 1 Reaction)`,
            buttons: {
                yes: {
                    icon: '<i class="fas fa-bolt"></i>',
                    label: 'Select',
                    callback: async () => {
                        workflow.advantage = true;
                        resolve(this);
                    }
                },
            },
        }
        ).render(true);
    })
    await dialog;
}
spring dove
#

does midi do that

molten solar
#

Question for the audience.

kind cape
#

Nope, but Times Up does

covert mason
#

I've noticed that the Warding Bond spell in the Midi sample items doesn't seem to work with NPCs.

dense rune
spring dove
#

How or where is the effect for the macro you wrote storing its time used? Cuz when I delete the effect and then use the torch again, it still shows 3600 seconds

#

I'm sorry guys. I feel like I'm being too difficult.

molten solar
#

invisibly

spring dove
#

Do I delete the effect to stop it, or use the torch again?

molten solar
#

Deleting the effect stores the remaining time on the item called "Torch"

#

creating the effect retrieves the stored value and sets the effect's duration accordingly

spring dove
#

Right, so, when I delete the effect and use the same torch again, it's still showing 3600 seconds.

#

on the actor

molten solar
#

Did any time pass?

spring dove
#

about 2 minutes, yes.

dense rune
spring dove
#

I have simple calendar

molten solar
dense rune
#

and is the time active in simple calendar?

spring dove
#

yes

molten solar
#

6 seconds per round

dense rune
#

yes yes but I mean if the torch is running out it will be because of simple calendar not because of real time passing by

#

right?

molten solar
#

Question for the audience.

vast bane
# spring dove

If you are using a base torch from dnd5e you need to edit the torch so it doesn't nuke everyone in the aoe lol. Midi+vanilla torch is a hilarious interaction.

spring dove
#

It's ticking off seconds, but reeeeeeeally slowly. I let it wind for about a minute, deleted the effect, used the torch again, and it has 2 seconds expired

molten solar
#

Happy to announce it's not mine or Effect Macro's fault lol

vast bane
#

managing torch and oil time is a level of micromanagement that is just too tedious to manage, torches cost like copper, all I care about is hand management.

spring dove
molten solar
spring dove
#

Right. Spending weeks away from a source of supplies while in the wilderness or far underground. Resource management, especially light resources, is key

vast bane
#

I'm running Dungeon of the Mad Mage, and that was one of the first things I threw out cause it dragged badly

molten solar
#

Aaaaanyway

spring dove
#

lol

molten solar
#

Consult your time management modules.

spring dove
#

hmmmmmmmmm

#

Do I have these macros backwards lol

molten solar
#

Deletion has the setFlag and creation has the getFlag

spring dove
#

So with a bit of testing

#

Starting with torch off, then turning on:
effect on actor reads 3478
after 1 minute: (turning back on to check time) 3477

Starting with torch on, then turning off:
effect on actor reads 3477
after 1 minute: 3477

dense rune
kind cape
dense rune
#

oh yeah of course I have warp gate, another amazing module let me try that!

short aurora
# dense rune doesn't work (the flow does not stop), but thank you! I will keep looking for a ...

I played along with fotoply's suggestion and your code, I only removed the conditional for ease of use for testing. This works for me.

Hooks.on("midi-qol.preAttackRoll", async (workflow) => {
    console.log("I triggered!")

    let totemActiveTokens = game.actors.getName("Unicorn Totem Actor").getActiveTokens();

    if (totemActiveTokens.length > 0) {
        let totemActiveToken = totemActiveTokens[0]

        let tokensAroundTotem = MidiQOL.findNearby(null, totemActiveToken, 30, null)

        let tokenIdsAroundTotem = tokensAroundTotem.map(token => token.data._id)
        let tokenIdsTargeted = Array.from(workflow.targets).map(token => token.data._id)

        let filtered = tokenIdsAroundTotem.filter(value => tokenIdsTargeted.includes(value));

        /*

        if(filtered > 0) {
            await displayReaction(workflow)
        }
        */

            await displayReaction(workflow);
        // force true of above for testing 
    }
});

async function displayReaction(workflow) {
    let dialog = new Promise((resolve, reject) => {
        new Dialog({
            title: "Hawk Totem Passive",
            content: `Do you want to grant attack roll advantage to ${workflow.actor.name}? (Cost: 1 Reaction)`,
            buttons: {
                yes: {
                    icon: '<i class="fas fa-bolt"></i>',
                    label: 'Select',
                    callback: async () => {
                        workflow.advantage = true;
                        resolve(this);
                    }
                },
            },
        }
        ).render(true);
    })
    await dialog;
}
});```
dense rune
#

(I use warpgate for spawning the totems hehe)

dense rune
dense rune
kind cape
#

Oh yeah, forgot to add that ๐Ÿ˜…

short aurora
#

Welp, I mindlessly just added that, so used to throwing await and async everywhere if shit stops working >_>

dense rune
#

I'm not used to javascript promises I need to read about this hahaha

#

thank you so much to both of you :3!

kind cape
#

Its because you made displayReaction async to allow await in it, then it will be run in parralel so you need to await the new function as well

dense rune
#

yeah so await makes everything synchronous and async makes it parallel

#

makes 100% sense hahaha

#

(now)

#

Now I just remembered that this is a world-script and I need to find out the way to only show the dialog to the caster of the totem ๐Ÿฅฒ

kind cape
#

Check user ID vs a stored one ๐Ÿ˜‰

dense rune
#

1 week for 1 spell ๐Ÿฅฒ

kind cape
#

There is a reason I didn't bother making hawk automatic ๐Ÿ˜‚

dense rune
#

and you were DAMN right

#

but I'm close now I have to finish it

dense rune
#

is there any method to show the dialog just to one specific player?

molten solar
spring dove
#

Ah, maybe that's the issue. Will this tick down seconds outside the combat tracker?

molten solar
#

Do you have a module that makes time pass outside of combat, given that combat is the only core mechanic that advances time?

#

(at 6 seconds per round)

spring dove
#

simple calendar, yes.

molten solar
#

and is Simple Calendar updated for v10?

short aurora
dense rune
short aurora
dense rune
#

๐Ÿฅฒ thank you Krig

#

Amazing photo avatar btw

kind cape
spring dove
dense rune
spring dove
#

Right now, it seems that it is removing 1 second from the torch's duration for every minute that passes in game. I've checked simply calendar's settings, and it is definitely set to 1 second = 1 game second

kind cape
dense rune
#

OH!!!!!

#

I GOT YOU NOW

short aurora
#

Oh yeah, that's much easier, you already got midi doing all the communicating

dense rune
#

how can I get the user running the hook/macro

#

?

kind cape
#

game.userId

dense rune
#

mama mia

#

amazing

#

thank you I'm going to try right now

#

I'm still avoiding socket API -> 10 out of 10 happy foundry coder

sudden crane
dense rune
#

I will surely do

#

What is ddb importer

#

oh dnd beyond importer

#

okay

#

of course I mean, I don't want anyone wasting one week of their life as me so I will happily share the thingy

scarlet gale
#

Is there a good way to "capture" when an actor is rolling save? I want to mess with the save using the midi-qol workflow, but I don't want to have the attacking creature have the macro, but instead the saving one.

molten solar
#

Hooks.on("dnd5e.rollAbilitySave", (...args) => console.log(args))

#

Core system hook as of v2.0.0.

scarlet gale
#

But where would I put that to make it run?

#

A world script?

molten solar
#

Yes

spring dove
#

I'm starting to think simple calendar doesn't actually advance game time, it is simply a tracker on its own

molten solar
#

The 'on create' macro should be amended to this btw, I didn't take negative or zero remaining duration into account.

const torch = actor.items.getName("Torch");
const remaining = torch.getFlag("world", "remaining-duration");
const seconds = remaining > 0 ? remaining : 3600;
await effect.update({ "duration.seconds": seconds });
molten solar
#

Does this change?

kind cape
spring dove
#

Not while I'm watching it lol. If I advanced the combat rounds, that number ticks down by 6 seconds, yes. If I just enable/delete the torch while combat is not happening, it actually doesn't seem to do anything unless a whole minute has passed.

molten solar
spring dove
#

I checked that, and no lol. It's advancing normally, 1 real second = 1 game second

scarlet gale
#

Give the saving person advantage depending on class features they have

molten solar
spring dove
#

meh, it's super small

#

consider during combat, it's not updating at all.

#

until I tick over a round, then it's just one 6 second advance

molten solar
#

OK, can check another way

kind cape
molten solar
#

be out of combat so SC ticks time

#

tell me if there's spam (one message per second)

spring dove
#

Just a tick every second

molten solar
#

Well alright then. It advances time. At one second per second.

spring dove
#

oh neat

scarlet gale
#

I can't see any obvious way to do that.

spring dove
#

how do I turn off that hook lol

molten solar
#

F5

spring dove
#

lol

vast sierra
#

Only half paying attention, but isnt it a setting in simple calender for how much time passes in game, vs real time? looks like they have it set up 1 for 1? ๐Ÿคทโ€โ™‚๏ธ

kind cape
#

Could also do Hooks.off("updateWorldTime", 782) ๐Ÿ˜›

spring dove
#

thanks fotoply

kind cape
#

(The number is output when you start the hook)

scarlet gale
#

My plan was to scan the message in the item description and change the workflow.

kind cape
scarlet gale
#

Yep, was just reading that when I asked

kind cape
#

This should output the current workflow into console when a save is rolled in response to an item

scarlet gale
#

I just couldn't figure out where that hook thing went

#

Makes sense

spring dove
#

@molten solar @vast sierra

scarlet gale
#

I'm actually a bit surprised midi-qol doesn't have it's own way to handle this built-in.

#

Since there are tons of features that give advantage on saves depending on the description.

spring dove
#

I find there are so many situations and contexts that change adv/disad that it's easier to just prompt for it.

#

esp as a DM since a lot of those are fiat

kind cape
#

It handles condition immunities fine, as well as advantages on saves vs magic, but there are few features with advantage on saves that include a specific condition

spring dove
#

midi does track if you are supposed to have adv/disad in a lot of ways. When your player is prompted, what midi thinks you should have is highlighted in orange, but they don't have to click it.

vast bane
spring dove
#

uh

molten solar
#

We have already established that it advances time.

spring dove
#

you want the full or compact view

scarlet gale
#

Does it? Maybe it's just not doing it when I have fast rolls on

vast bane
#

there was a long standing issue with simple calendar where the earlier versions would not properly update to the new fork line that everyone uses so some folks wind up thinking they have an updated SC when its really 8-10 months old

kind cape
vast bane
#

easiest way to spot it is to either show us what it looks like or tell us your version

spring dove
#

@scarlet gale This is what it looks like to my players. The barby just used reckless and made an attack, so midi is giving him adv. He doesn't have to click adv, but the player knows he should have adv in that situation because of the highlight (and that he knows he used reckless, but a lot of things people forget, like being restrained giving you disad on attacks etc)

scarlet gale
vast bane
#

If you aren't fast forwarding, I highly recommend Advantage reminder even without setup, it highlights ALOT better than default midi

spring dove
#

So midi has a few flags to give adv/disad or grant adv/disad to anyone interacting with said actor that has an effect with that flag. You could set up an effect that activates with your chosen context.

celest bluff
scarlet gale
#

The issue comes down to needing this for a save not an attack roll

#

Attack rolls can just be done with midi-qol flags

spring dove
#

it can be done for saves too

spring dove
vast bane
#

there is also a flag for magic resistance even

scarlet gale
#

Is there a flag for poison condition advantage?

celest bluff
#

mixed should accept module controls which change times, such as about time.. though not sure about v10

opaque current
#

Does Times Up help

vast bane
celest bluff
#

so overall who is the macro or condition being placed on? the attacker or target?

#

there is no flags for specific saving throw advantages for conditions

scarlet gale
#

I don't see a resistance section for conditions

vast bane
scarlet gale
#

Long story short

celest bluff
#

you can write a world script to correct this though

scarlet gale
#

See above

#

That's what my solution was

#

And just alter the workflow

#

by scanning the item description

vast bane
#

I just use adv reminder

celest bluff
#

can scan the item for active effects

scarlet gale
#

I was thinking that too

scarlet gale
celest bluff
#

then can add an active effect on the target to give them advantage on saving throws

spring dove
#

@vast bane This is what Simple Calendar looks like, in expanded and compact view. It's super handy

celest bluff
#

you can also create an actor on use macro on them, if they have some sort of racial feature

scarlet gale
#

Can the onuse thing catch making saves?

#

While I could edit every feature on creatures that apply conditions

#

I'd rather just have one catch all

spring dove
#

@molten solar wanna know something infuriating? If I advance the day with simple calendar, it definitely wears out the time on the torch to 0

vast bane
#

is that old SC guys?

celest bluff
#

sure whichever method you prefer

vast bane
#

What is your version of simple calendar?

spring dove
#

2.1.27

molten solar
#

can it do that?

spring dove
#

yeah

celest bluff
#

supposed to be 5 seconds

vast bane
#

eh you are 3 versions behind me but you are over the hump of the break so you just haven't updated in a few

spring dove
#

I tried fixing it by setting the update to .1 seconds and that did not work

spring dove
vast bane
#

oh wait, I'm behind you lol math this early in the morning

spring dove
#

oh lol

vast bane
#

youmust be on a v10 branch

#

I think alo another way to catch anyone on the broken old branch is the icon for SC will be a blank plug vs the new SC logo

spring dove
#

ok, @molten solar hilariously, that is now advancing the torch counter, but the clock is ticking by 5 seconds every real second lol

molten solar
#

Okay

spring dove
#

oh my god

molten solar
#

Confirmed: SC cannot do math.

spring dove
#

I set it back to 1:1

#

and the torch macro is working now

celest bluff
molten solar
spring dove
#

Will do!

#

I can modify that macro for other timed effects too, like oil in a lamp lasting for 6 hours, or etc

molten solar
#

Yep. Easily.

kind cape
#

@scarlet gale Are you on V9 or V10?

scarlet gale
spring dove
#

oooooooh I see what's going on with the clock updates, @molten solar. If the character sheet is open, the time for an effect does not tick down unless you're in combat. You have to close the sheet and reopen it for the time to update. When I was testing your macros, I was just switching between the effects tab and the inventory, never actually closing it.

molten solar
#

Yeah the label updates with actor or effect/item updates

vast bane
#

Alot of entities in the Ui are like this, where they require certain things for updates

spring dove
#

I did not know that

#

This whole time it was me. I was the dingus.

vast bane
#

Knowing is half the battle!

molten solar
#

This is why I like having an off-sheet panel to show the effect durations

vast bane
molten solar
#

Both ๐Ÿ™‚

violet meadow
#

WHAT THE HECK PEOPLE? 3 hours away 1000 msgs?

vast bane
#

I can't remember why but I purposely put a postit on my monitor saying to keep dfreds EP disabled due to bugs, I really need to keep better notes.

molten solar
vast bane
spring dove
#

Oh, simple calendar also does reversing time too. If I go back in time, it adds to the torch's effect. Can you add a line to not let the effect go above 3600 seconds?

molten solar
#

They were stuck with me. I didn't want to leave. They were miserable. It was great.

vast bane
vast bane
spring dove
#

yeah I know

vast bane
#

Is there a way to freeze an npc in time? Say I have a BBEG thats prepped with a bunch of prebuffs like shield of faith or death ward, can I somehow freeze their timers? So SC doesn't expire them?

molten solar
spring dove
#

sure

molten solar
spring dove
#

On creation:

const remaining = torch.getFlag("world", "remaining-duration");
const seconds = remaining > 0 ? remaining : 3600;
await effect.update({ "duration.seconds": seconds });```

On deletion:
```const remaining = Math.max(0, effect.duration.remaining);
const torch = actor.items.getName("Torch");
await torch.setFlag("world", "remaining-duration", remaining);```
vast bane
#

oh wait, I can't test it, live world, players have stuff going

#

I'll fiddle later when I'm done with this prep sequence

violet meadow
#

backup the world, play with it, test and put it back ๐Ÿ˜„

vast bane
#

nah I got a fiddle world I can load, but I'm elbows deep in a monster automation project

molten solar
#

Delete:

const remaining = Math.clamped(effect.duration.remaining, 0, 3600);
const torch = actor.items.getName("Torch");
await torch.setFlag("world", "remaining-duration", remaining);
violet meadow
spring dove
#

Yeah, can you not just keep him out of the scene until he's relevant, then drop him in?

vast bane
molten solar
spring dove
#

Thanks zhell

molten solar
#

it was getting too big for my own world script lol

short aurora
violet meadow
#

The fancy one?

molten solar
vast bane
#

I think I disabled effects panel when I was dealing with an insidious bug with perfect vision but wound up just flat out disabling PV entirely as the dev tried 3 times to clear the bug for me but it just kept coming back each week we played. I felt like a burden so I stopped using it. It would throw an error that included a bunch of modules but ultimately it was PV's error and I took stock of what it gave me and whether I could live without it and proceeded accordingly.

violet meadow
#

I still am not using PV... I might need to check the fuss about it at some point ๐Ÿ˜„

vast bane
#

and I just lost track of what modules were wrongly named in those errors and never re-enabled them.

#

I loved its drawings feature for some map effects but it does NOT like my druid players wildshape macro setup(that you two made for me lol)

molten solar
#

I think most people use PV for proper darkvision.

vast bane
#

whenever my druids shapes are on the map it would throw these crazy 5 module named errors whenever she did anything

molten solar
#

(which is now core in v10)

vast bane
#

Midi being one of them andit would break the entire midi workflow

violet meadow
#

Thought that ironmonk did something that would benefit you, not? something about award exp?

vast bane
molten solar
vast bane
molten solar
#

strange.

vast bane
#

It would only happen with her wildshapes, and her wildshapes were uniquely built by me and summoned via that really ugly frankenstein warpgate centirc macro you and bugbear built along with me. So I took stock and just decided to give the dev a break from it since its very likely something I did stupidly with her sheets or the macro.

#

the error only shows PV, but what the bug would cause is a cascade of other errors after that one with other modules till I realized turning off PV would clean up the rest of the modules errors.

violet meadow
#

refresh on an already destroyed token ๐Ÿค”

vast bane
#

He pushed out fixes for me specifically but it would keep coming back each week, break that players workflow in midi, shed basically start playing in vanilla dnd5e till I would disable PV every week.

violet meadow
#

So the wildshape warpgate macro, was spawning a new token for her and hiding the normal one or somehting?

vast bane
#

We don't need to troubleshoot it though, just reminiscing. I make do, its dungeon of the mad mage, everything is lightless. now anyway

#

Yes it was hiding the actual druid token under the wildshape

#

I like this cause of synergy with MTB and other reasons

#

While its true a druid can't mess with their inventory while they are shaped, meta wise, I still wanted to be able to, so I needed her token out for some things since wildshaping messes up inventory management

violet meadow
#

Were you doing something to the user permissions too or do i remember something else? Actually that would be #modules or something so I will drop it (here at least) ๐Ÿ˜›

vast bane
#

we don't need to bother him again, the guy wrestled with it for 3 weeks and it was a headache.

#

We are ok ๐Ÿ˜‰

#

I only recently realized that warpgate summons don't require permissions set on the original, so I've been slowly fixing my setup to account for this specially with the summons that are shared between me and the players.

gilded yacht
violet meadow
molten solar
#

Convenient use of the lack of data.

violet meadow
#

Indeed! Nice one

broken horizon
#

@molten solar @spring dove can you sum up what the issue was with Simple Calendar? It should be working correctly in terms of advancing game time but if there are bugs I need to fix them ๐Ÿ˜

vast bane
#

The solution was, reopen the sheet to see the change in ae's durations after time has transpired, or use another module that shows live updates to durations.

broken horizon
#

Ah ok thanks for summing that up!

magic tartan
#

Hi, @gilded yacht. I noticed two typos/overlooks at Midi 0.9.82:
Missing dot at https://gitlab.com/tposney/midi-qol/-/blob/master/src/module/workflow.ts#L932

let effect = this.item.actor.effects.find(ef => ef.data.label === this.item.name + " Template");```
2) Missing *data* at https://gitlab.com/tposney/midi-qol/-/blob/master/src/module/workflow.ts#L934
```js
const newChanges = duplicate(effect.data.changes);```
gilded yacht
scarlet gale
#

So I'm using the Hooks.callAll("midi-qol.preCheckSaves", workflow) to adjust what tokens are getting advantage on a save. But the preCheckSaves doesn't seem to have a populated list of tokens that have disadvantage, such as gaining it from a set flag.

#

Am I just using the wrong hook to do this on?

dusk jungle
#

is About Time still required at all for for midiQOL? i've just upgraded to v10, doing a bit of a cleanup as i re-enable modules

vast bane
#

The only thing I keep mixing that module up with is if it adds more options in special durations in the active effect duration tab. So disable about time and see if you are missing any?

scarlet gale
#

Turns out that list just is for displaying if they have disadvantage or advantage, it doesn't actually give them it.

dusk jungle
spice kraken
vast bane
spice kraken
#

Oh shoot

#

I misread that

#

Times up does what I mentioned

#

I don't have about time but that's cause I let simple calendar expire AEs out of combat (which has about time integrated)

vast bane
#

How do I make midi roll this automatically, I have to constantly click the button:

#

auto rolling other is not a thing?

violet meadow
#

With activation conditions on for other formulas in midi, it should be auto rolling, by putting true in the activation condition field.

#

Now if this bugs out cause there is no damage formula I am not sure as I haven't tried it

vast bane
#

About the stuff in macro polo:

I had chosen all cause I wanted this dang roll to fire before I was prompted with warpgate

#

I thought it was that drop down causing it to do that but I guess its the lack of true in the window

violet meadow
#

You can check the Roll other in the bottom checkboxes too iirc

#

Or is there only one for crit other?

#

I don't remember now

vast bane
#

I tried that too, its just not auto rolling

#

the only way I can pull this off is if I roll the item, and with warpgates summon on my mouse, I move over and click the other button in chat

violet meadow
#

You can grab the other Formula field in the macro, create a roll for it and do that before continuing along the execution

#

Or roll a 1d100 in the macro

vast bane
#

yeah but I'm not very good with macros and I think I'm about to settle on the bandaid fix instead

opaque current
#

Make it Utility, Other or something instead?

vast bane
#

can you do chat commands in the script?

#

I have it on other atm

opaque current
#

Yeah other other

vast bane
#

I had it on other/other formula and it was not auto rolling, trying utiliity/other now

violet meadow
#

Wait but are you auto rolling damage?

vast bane
#

only if needed

#

but its not a damage roll

violet meadow
#

Do you need it to create a message with the roll?

vast bane
#

Yeah so I can see the result

#

instead it does this:

#

I can click that button and it does the job, but I swear to god, at some point in the last hour it auto rolled it

#

I don't know wtf I did wrong

violet meadow
#

Is the roll other Formula in the midi settings for spells set to Activation condition?

vast bane
#

yes, and I need it to stay that way, I use that a TON

#

but also this is not a spell or an attack

#

I think its a feature?

violet meadow
#

Hmm I will try it a bit later.

vast bane
#

could this be the actual problem, midi doesn't actually say it does it for features, it specifically mentions spells and attacks

#

I'm gonna make an attack version of the item

violet meadow
#

Try also adding a damage formula

#

For testing

vast bane
#
/r 1d100
const summonType = "Barlgura";
const [spawn] = await warpgate.spawn(summonType)
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()

I know this is probably lol but I tried this and yeah...didn't work

#

I swear I've tried all suggestions now, I think the only way to make this work is to just do other/other formula 1d100 and before placing the summons, click the other formula button in chat

#

When I set it to damage suddenly the item just flat doesn't roll at all and no error in console

#

if theres a damage formula in other

#

(cause no target probably)

#

OK. Guys I am all set I figured it out. It was lack of target

#

Auto rolling with self/self set now

#

as a damage formula

scarlet stump
#

what do you have to set up in warpgate for this to work? Also doesn't that cause damage to the summoner?

vast bane
#

you don't have to set anything up in warpgate and I think my animation is in the free half of jb2a, so that macro can be used to summon any sheet you want from your side bar, one of these days I'm gonna build up the courage to ask Zhell how to summon a compendium actor in that macro.

violet meadow
#

So no warning? ๐Ÿค”

vast bane
#

no warning cause I was rolling other

#

also, I really think that cause its a feature some of the midi stuff is ignoring it

scarlet stump
#

how do you select the spawn point for the summoned creature?

vast bane
#

the command that I run from warpgate starts a target thing with the mouse

violet meadow
#

warpgate magic

vast bane
#

Warpgate is pretty dope

scarlet stump
#

I've only been using warpgate as a dependency, should start using it for good

vast bane
#

but for the record thats a warpgate+sequencer macro ;p

scarlet stump
#

using both as dependencies ๐Ÿ™‚

vast bane
#

I also kinda want a macro where it does the above macro, but instead of having a fixed name, I want it to pop up a dialogue where I can type an actor name and it summons it.

scarlet stump
#

is the summonType string value the name of the actor you want to spawn?

violet meadow
#

Yes, but must be in the Actor's Directory on the sidebar

vast bane
#

I honestly don't know why theres 3 lines there

#

I sorta copied this from that really messy macro that bugbear and zhell helped me make long ago

violet meadow
#

The last line plays the effect in the spawn position iirc

scarlet stump
#

final question: where do you get the name to use with the JB2A effect for the sequencer macro? IE: the filename for that effect is MistyStep_01_Regular_Blue_400x400.webm but the macro has jb2a.misty_step.01.blue.

violet meadow
#

GO to the sequencer database on the left sidebar

vast bane
#

bottom right of every choice is the code

scarlet stump
#

ah ๐Ÿ™‚

violet meadow
#

One click in game ๐Ÿ˜„

vast bane
#

you can't see them there can you?

violet meadow
#

just hit play

vast bane
#

hmmm, I still will use mine lol

#

mainly cause they sorta better sort them on the site

molten solar
#

or just, you know, new Roll("1d100").toMessage()

vast bane
# molten solar `ui.chat.processMessage("/r 1d100")`

I knew you'd come to my rescue on that one, but for the record when I did that, I was literally throwing the keyboard out the window mad at the problem lol. I finally got it solved though thanks for the response hehe.

novel gale
# molten solar (which is now core in v10)

As I've discovered recently the core implementation of darkvision is wrong for 5e. It amplifies light everywhere on the map and not just in the Darkvision radius. PV doesn't fix this in v10

vast bane
#

but also you can change the vision setting to black and white in core I believe just the dimness is not present

#

actually...my PV is disabled, you can totally pull off dimness in core

#

I think I'm just gonna put a request into the Dice So Nice guys to see if they can add a trigger in their settings for dice explosions.

#

Since we can't get that hook to work

scarlet stump
#

Is it possible to use a formula to determine the flat dc for a save in an item's saving throw dc field? It seems to reject any input that isn't an integer

vast bane
#

thats the whole point of flat though

#

what are you making that has a formula?

scarlet stump
#

it should be something like 10 plus the target's CR

#

rounded up to 1 if below 1

vast bane
#

you wouldn't be able to get that without macro work anyway

#

so a harder creature would fail it but a goblin would easily defeat the ability?

scarlet stump
#

no it's a save that a pc would do to avoid something bad happening to them; the DC is higher the stronger the monster is

#

so it wouldn't be an attack to begin with yeah :v

#

the save is manually rolled when using the feature

vast bane
#

oh just do an attribute that has no modifier

#

then give the monster an AE that mods the spell dc with the math for CR

#

or if its for many monsters and the attribute is different for all, enable sanity and use sanity at 10 or 11

#

probably have to account for PB getting added in if we can't unproficient said item

scarlet stump
#

eh I could also simply grab the target's CR and paste the DC in chat with some HTML code to make it look snazzy since the con save is rolled right now

#

still trying to figure out the sintax for this kind of macros though...if I have args[0].target what should I add to grab the CR value? and is there a list somewhere? Asking cause for the uuid it's args[0].targetUuid so I'm not clear on the usage

vast bane
#

why reinvent the wheel, do the work on the item, and then let a roller handle it

violet meadow
#

Go through the data and see where the CR is

vast bane
#

You can also make a monk's tokenbar macro that has a DC set there

violet meadow
#

Then call it by doing the same path in the macro, but instead of using the _token.actor by using args[0].targets[0].actor

vast bane
#

Oooooh I wonder if you can intercept the monks token bar request with an item macro

violet meadow
vast bane
#

heh more theorycraft than anything, I'd just make the DC in the active effect of a spell dc mod

#

easier than getting one of you to write all the mumbo jumbo witchcraft in the item macro

violet meadow
#

is it a saving throw request?

vast bane
#

Its not my ask, its @scarlet stump I'm done with my prep for the week as of 20 minutes ago

#

I'm in the process of doing my weekly backup and then pondering installing a v10 instance

violet meadow
#

You can again open console and type game.MonksTokenBar.requestRoll

scarlet stump
violet meadow
#

it will bring up the request roll API exposed function from Monks Tokenbar

vast bane
#

monks doesn't let you do modifiers, but Requestor does!

violet meadow
#

This is a bit more tricky to read through thouth

vast bane
#

I can't view my console atm, the servers down and in a backup

vast bane
violet meadow
#

nope but it will show you the function only. I though it had some more details on how to call it properly with its parameters, but it hasn't

#

Let me check if I remember how to create a monks saving throw

vast bane
#

you can use the save macro button on the request window to get some functional syntax

violet meadow
#

yes but I need to remember ๐Ÿ˜„

vast bane
#

but I literally saked monk on his server if it was possible to add situational bonus's to the macro and he said maybe in a future version

scarlet stump
#

so I believe the CR is data.details.cr but if I try to do this I get an error...something silly I'm sure. I'm in v9
let cr = actor.data.details.cr;
console.log(cr);

vast bane
scarlet stump
#

missing a data

violet meadow
#

that way it will work in both v9 and v10 Foundry

scarlet stump
#

so it would be args[0].targets[0].actor.getRollData().details.cr;

vast bane
#

oh you know what? Its the DC value, you CAN add a modifier in monks then

#

all you have to do is do the math in the defiition above it

#

use an alias or whatever you guys call it

#

const DCstuff = cr+magic number
then in monks macro in the DC field use DCstuff

violet meadow
#

Crude example```js
await game.MonksTokenBar.requestRoll([{"token":_token}],{request:'save:con', dc: _token.actor.getRollData().details.cr + 10, silent:true, fastForward:true, rollMode:'roll'})

vast bane
#

and if it doesn't like all the fancy stuff in there, define it as a const above it right?

violet meadow
#

This will roll a CON save for the selected token and set the DC based on the selected token's CR

#

its wrong but showcases the use

scarlet stump
#

so I should definitely be using MacroTokenBar right? ๐Ÿคฃ any known conflicts? Not sure why I am not using it

vast bane
#

Though I believe dc's are 8+ fyi

violet meadow
vast bane
#

I think the benefit of monks is you can then hook off success and failure?

kind cape
#

I'm trying to figure out why we are trying to automatically adjust a DC based on a static value ๐Ÿ™ƒ CR generally doesn't change, 10 never changes, so why not just set it once per creature and be done with it?

violet meadow
#

Same with an let save = await actor.rollSaveAbility('con')

And get the let total = save.total after

kind cape
#

But even for homebrew I don't see how this makes sense, what's the end goal here?!

vast bane
#

If you are still trying to get that hook done for exploding heals, I think I'm just gonna put a request into Dice So Nice for a sound event option in their settings and call it a day. It seems too complex to get to work with a script

violet meadow
#

Use an ItemMacro whenever that specific ability is present, no matter what the monster that uses it, is probably ๐Ÿคท

kind cape
vast bane
#

nopers

#

it always explodes, like hulk, hes always angry

kind cape
#

I could have sworn it worked on my end.. ๐Ÿ™ƒ What code are you using right now?

vast bane
#

or rather it plays on regular rolls

#

oh poop let me see if its done backing up

#

I can't check atm my servers backing up

kind cape
scarlet stump
violet meadow
#

no build in save in their case

scarlet stump
#

so a monster smashes a character > that character rolls a con save with dc 10+cr to avoid effect x

vast bane
#

Seriously though, Thanks for getting me to realize how to fiddle with monks macros and modifiers that is a huge help for my homebrew crafting

scarlet stump
#

it's an ability on the character's end, not something on the monster's end

kind cape
#

Okay, so to be clear, you are using a MIDI world hook to trigger a save if a creature that is hit has a specific feature?

scarlet stump
#

no automation, it's a feature that a player can choose to use

#

the only automation I'd like is for the DC to be set dynamically based on the targeted token

violet meadow
#

(nope this should be a conversation in #macro-polo probably, but noone here to prod us to the proper channel)

scarlet stump
#

ah my bad ๐Ÿ™‚

vast bane
#

lol

kind cape
#

Targeted token being the attacker?

vast bane
#

He'll get swept back the second he sais arg

#

cause hes trying to pull a targets CR not the actors CR

#

then again hes just reading the CR not changing it, that doesn't require args right?

violet meadow
#

It can all be done with an onUse macro to be honest

scarlet stump
#

let me explain the whole process; I use ability A where a player can choose to break its own shield to prevent damage from an attack. This request is for ability B; ability B allows said character to pass a 10+attacker CR Con save when using ability A to prevent their shield from breaking

violet meadow
#

Within Midi. Like the Uncanny Dodge

vast bane
#

Hell I'd use a macro and use the charges on the item to decide if it broke or not all on one item

#

If succeed, refund charge, if fail, expend charge

#

Like bugbear said, put it all in the macro on use

#

@kind cape

Hooks.on("midi-qol.RollComplete", function (workflow) {
    if (workflow.damageDetail.filter((detail) => detail.type === "healing").length === 0) return;
    let dice = workflow.damageRoll.dice;
    let explodedDice = dice.filter((die) => {
        return die.results.filter((result) => {
            return result.exploded ?? false;
        })
    });
    if (explodedDice.length === 0) return;

    AudioHelper.play({src: "hakuna_meow02.ogg", volume: 1, autoplay: true, loop: false}, true);
});

this is the last iteration I was using, it always plays the sound even on non explodes

kind cape
#

Thats the one I could have sworn worked ๐Ÿค”

vast bane
#

let me see if merge/condense is causing it

kind cape
#

I am using merge cards