#MidiQOL

1 messages ยท Page 94 of 1

deep harbor
#

End a macro that is running, or end an effect that was applied by a macro?

buoyant minnow
deep harbor
dark canopy
#

What id did you get?

deep harbor
#

It's failing to find the effect by UUid.

dark canopy
#

And what is your uuid?

deep harbor
#

HeWe3AMj9YOY8n6g

dark canopy
#

No no, with the active effect open, there is a book icon on the left side title bar

#

Right click that

deep harbor
#

Ah, got it. Thanks.

#

HeWe3AMj9YOY8n6g

#

It game me the same id.

dark canopy
#

Right click

deep harbor
#

Sorry. I've been at this a long time again, and it's getting late.
I've got the json for the effect.

#

It's slightly too large to fit in a single message here.

dark canopy
#

That's ok, that's your data, basically

#

Toss that in a mutation survived like I mentioned previously and you should be good

deep harbor
#

Will that apply it as a new mutation that will need reverting later, or will it just add the effect?

#

Also, I'm not sure how to stick it into a mutation.

deep harbor
dark canopy
#

Check the mutation docs or wiki examples (mutating goblin)

#

And wg always works on tokens

deep harbor
#

Found it. I think I can figure this out now. Thanks again.

fringe crag
#

I got a Problem.
I wanted to give my PC Darkvision on effect creation and forgot to change add to override. Now I always have 120 ft Darkvision and no matter what I do it won't go away...

#

tried downgrade. tried override

deep harbor
#

Removing the effect should get rid of the 120 ft.

fringe crag
#

it is gone but not the darkvision

deep harbor
dark canopy
vagrant wharf
#

for the longsword of life stealing, will the macro work if you change the item's name?

deep harbor
#

Now I must get some sleep. Thanks and signing off.

past spade
#

Hi, I'm currently trying to implement a paralyzing poison and I just can't get it to work.
I want a consumable poison that can be applied to anyones weapon, which adds the effect of stunning a target on the next hit if they dont pass the DC.
I tried creating a consumable that passes on an effect, which executes a macro. that macro uses onUseMacro from midi to then check if its a melee attack and if it hits. the part that I don't get is how do I add the DC and the stun to the attack?

vast bane
#

There is an optional rule in midi that lets the DR's stack instead of only the highest.

scarlet chasm
#

Currently it doesnt add up correctly with Midi, both in Dr and in damage rolls. Thats my under lying problem.

shadow viper
#

Hi,

On the feature "On Use Macros" in a spell, I would like to trigger the macro when the target failed a saving throw and I can't find that in the trigger list, there's only when the actor failed a saving throw.

I tried with "Before Damage Application" + No Dam Save but even if no damage is applied, the macros was still launched.

I try to search in this channel but I didn't find a thing. Do you know how to do that?

dark canopy
scarlet chasm
#

The left one is new, to me. Okay ill try. What version is this the recent one?

vast bane
#

I'm on midi 35, also pro tip you can mouse over the token icon in the damage card to see the DI/DV/and both DR's

scarlet chasm
#

that i did not know

vast bane
#

the stuff in the item itself is for the item, your macro won't look at that, instead you should put a line like if this.save true or something return

shadow viper
#

Thanks, I'll try that ๐Ÿ™‚

violet meadow
#

What did I miss?
Only a couple hundred messages ๐Ÿ˜

vast bane
#

I know, I just kinda skimmed and ignored the 200 missed messages lol

rich matrix
#

Hey. I'm looking in the history for solutions for my problem, but what I find doesn't seems to help me. The issue is with 'Magic Items' and MidiQOL, which is seems to have a LOT of problems when run together. What is weird for me is that spells added by the item in the spellbook doesn't work at all. I click to use and nothing happens. No charges consumed, no new chat messages, etc. Console shows this error bellow. I'm kinda disappointed by the 'Magic Items' module, because it looks so good on paper. Any thoughts or suggestions?

vagrant wharf
#

is there a way to de-couple the Devil's Glaive infernal wound effect from the crit effect of Longsword of Lifestealing if both are on one item?

vast bane
vagrant wharf
#

as near as I can tell the infernal wound thing is meant to be on hit, period

#

but it keeps only applying on a crit

vast bane
#

Items with Spells is generally the way to go for v10 magic items with spells. If you need items with items, use DAE's macro.createItem. Before you drop MIM make sure you unflag the items that use it so that tidy5e doesn't get messy

rich matrix
# vast bane I'm surprised you didn't see the many times I told people not to use mim with mi...

As a matter of fact I did. LMAO. But is there any other workaround? I mean, I really liked the option to just drag the item to the character sheet and have the spells added to the spellbook, automatically consuming the charges. I remember reading that you create an innate spell cast. That works if the item has only one spell. But in my case they have several. In fact I have one item with 7, all with separate 1 use per dusk.

rich matrix
vast bane
#

its v10 only

#

the only functionality you lose is the upcast with charges, but MIM never really expended charges either so atleast with items with spells it does

#

to mimick upcasting charges make all versions of the spell:

rich matrix
#

You mean Foundry v10? That's fine to me. I'm using v10.291. And the upcast isn't really a problem for me to be honest.

#

Oh I see. If it comes to it i'll do it. For now, I'm really just want for one item, that has several ritual spells, 1 cast per spell per dusk. Shouldn't be a problem.

#

Thanks a lot

vagrant wharf
#

well is there a way to make a persistent effect, like horrid wilting or silence? that's tied to a template or area

#

or to exclude a race in the activation

vast bane
#

easy enough with active auras

#

just grab the silence or darkness from the AA compendium and edit it to your liking

#

excluding a race is going to be hard though since active auras usually wants you to disable midi(for the item)

#

and activation conditions are a midi thing

vagrant wharf
#

what if its not a persistent effect, like a fireball?

#

I pulled this from life stealing, but not sure how to segregate the component parts

workflow.diceRoll === 20 && !(["construct", "undead"].includes(raceOrType)) && item.attunement !== CONFIG.DND5E.attunementTypes.REQUIRED

vast bane
#

&& is the seperater there

vagrant wharf
#

yeah I kinda figured after glancing, but don't know how ot tell it to exclude undead/constructs from taking damage

#

or if I need to turn on activation condition true

#

!(["construct", "undead"].includes(raceOrType)) seems like the key part but I don't know how to do anything with it

vast bane
#

you could put a pre-itemroll catch macro that if the targets don't include that creature type then cancel the workflow entirely if its just a damage formula on the item

#

generally speaking I don't think any of us bother with this cause the players can sus this out

#

nobody adds a check for construct/undead to healing word for instance

vagrant wharf
#

ok but I would like to so when my boss npc uses horrid wilting amongst all its undead minions it doesn't hurt them at all, the way the spell says

#

since all of them being jumbled together is highly likely

vast bane
#

then he won't harm anyone with his ae that is the same disposition as him

vagrant wharf
#

its an aoe so its set to a template

vast bane
#

beware of warpgated in minions that show green dispositions, they are still hostile under the hood

#

can they ever harm their allies in a template ever?

#

I call this the ultimate lazy Sculpt Spells automation but you can repurpose it by removing the if statement at the start then the actors entire workflows will ignore allies. Its meant to be an actor on use

if (!token.actor.items.getName("Sculpt Spells") || args[0].item.system.school !== "evo") return;
game.user.updateTokenTargets(args[0].targets.filter(tok=>tok.disposition !== canvas.tokens.get(args[0].tokenId).document.disposition).map(i=>i.id))
vagrant wharf
#

otherwise things like fireball wouldn't work properly that hit friendlies too

#

is there some fancy version for bestow curse like there is for contagion?

#

and is there a way to have hit point max be reduced by the damage as per Harm?

hasty jackal
#

how can you add advantage to all saving throws?

vagrant wharf
vast bane
vast bane
hasty jackal
#

just advantage

dark canopy
#

(i cannot stress enough that wg is a wrapper for the core api, and little more)

hasty jackal
#

its is possible to create a feat like this
"As a bonus action your next spell does damage ignoring resistances (Fire)"

hasty jackal
#

using midi or dae

scarlet gale
#

With a macro, sure

#

I suppose you could also have the feature apply an effect that removes fire resistance, but that would require the player to target everyone with it first, then use the spell

hasty jackal
#

that would work

#

you know the flag for it?

scarlet gale
#

it's the system flag for damage resistance

hasty jackal
#

damage.resistance or DR?

#

it should be downgrade right?to target

scarlet gale
#

system.DR.value I think

#

Overwrite probably

hasty jackal
#

cant find the flag hmm

scarlet gale
#

It won't start with flag

#

system.traits.dr.value

#

actually, looks like you can only use custom on this one

#

that's annoying

#

Looks like you won't be able to go about it this way

hasty jackal
#

and for immunity?

scarlet gale
#

I can't think of an easy way to go about this without a macro at this point

#

In other news, that new midi update looks nice. That mention of magic item templates hopefully means that module can be used again.

hasty jackal
#

yeah i think its a macro, the damage immunity bypass is only for adamantine, magical and silvered

#

hmmmm

hasty jackal
#

found a way to do it but i cant find a way to cancel it on the next action

#

if i set is as one turn it waits till the creature affected ends his turn

fringe crag
#

Is this the same with as with light where I have to have like 5 flags for it to work?

deep harbor
# vast bane Items with Spells the module

I take it that Items with Spells, and Magic Items (not yet compatible), allow you to add and store spells (and possibly other features?) as part of an item, and to call them from the item?
Without them, I'd have to use DAE to create the spell on the actor and make it innate spellcasting, using a macro to track the resource usage?

#

Is Items will rollable tables also a good grab alongside Items with Spells?

scarlet gale
#

You can use ATL flags to do that

scarlet gale
#

Worth testing out

deep harbor
#

I haven't got either yet, so I can be happy with either one.
You're recommending Magic Items for the extra features?

scarlet gale
#

I wouldn't say recommend

#

Magic items module has more features

#

But it wasn't fully working with midi for awhile. Mostly due to bugs

deep harbor
#

But if I pick one and start compeniumizing from it, changing that later will be a double work.
For now, since I'm nowhere near magic items, wait and check on the new compatibility features and bugfixes later?

scarlet gale
#

Pretty much

deep harbor
#

What about the rollable tables? Is that already in Magic Items, or should I pick that one up now?

scarlet gale
#

Not sure what you mean

#

If you have a magic item that needs a roll table to pick a spell you're out of luck

deep harbor
#

There's a module called 'Items with Rollable Tables DnD5e', by the creator of Items with Spells.

scarlet gale
#

Oh gotcha

deep harbor
#

That should allow for exactly what you just said couldn't be done, assuming you can make a spell call or macro call from a table.

scarlet gale
#

Says not compatible with midi

#

So...

deep harbor
#

Ah.

#

That answers that then. ๐Ÿ˜„
Thanks for your advice.

scarlet gale
#

Having an on use macro roll from a table is simple enough

deep harbor
#

Is the darkvision on token flag ATL.dimSight?

scarlet gale
#

Sounds like it

fringe crag
deep harbor
#

Is there a way to set the spellcasting ability for a spell, from within the spell itself?
Some spells, especially racial spells, have fixed abilities.

deep harbor
wide crystal
# vast bane I call this the ultimate lazy Sculpt Spells automation but you can repurpose it ...

Would it work if I were to change the args[0].item.system.school !== "evo" bit to something else designating features? If so, are you able to advise on what the line should say?

I have a feature attack that is meant to ignore good characters, so I could use this to simply target the tokens that are meant to be unaffected before casting.

I tried looking at the activation conditions as per your suggestion, but my knowledge is insufficient to understand how to implement that.
I tried adding things along the line of "@target.details.alignment.value".includes("Good") and other iterations of it that seemed to make sense to the Activation condition field, but nothing would trigger the Other formula field.

wide crystal
violet meadow
#

Do you have the settings mentioned at the top selected in Midi?

wide crystal
#

So do you think this could work? (I can't access the server at the moment, so cant' test.

target.details.alignment?.value === "Good" || target.details.alignment.toLocaleLowerCase().includes("Good")

#

I believe they should be, but I cant' vouch for it. I'll have a look when the host starts the server up later today.

#

I just wasn't clear on how the line should be written.

violet meadow
#

When you use the lowercase function, you will need to use in the condition lowercase as well

#

So good instead of Good

#

Not sure about the data path though

wide crystal
#

A couple of days ago I asked around if anyone knows of a macro existing that would allow a spell to ignore good characters and impose Saving Throw disadvantage against evil characters (NPC and PC). Moto suggested looking at your(?) activation conditions, but I couldn't understand how they could be implemented to work this way.

deep harbor
#

What setting does global illumination need to be at for it to be considered dim light?

violet meadow
violet meadow
#

The condition will be evaluated and the flag will be applied only if true

wide crystal
#

Ohh, that's interesting.

#

I'll have a look at this approach, thank you so much.

fringe crag
wide crystal
#

It should then have Darksight as long as the feature remains in the character sheet.

#

Sorry, can't provide screenshots because I'm not the host in my server.

deep harbor
#

Then it would flicker like that. Use to macro to add the feature to the character, or a warp, and then undo it again when the feature is removed or expires.

fringe crag
#

I got it to work via DAE but it doesnt auto remove, when removing the original effect

wide crystal
#

What attribute key are you using for this?

vast bane
deep harbor
wide crystal
fringe crag
#

When checking the "transfer on actor" I need to activate it AND it doenst go away automatically

vast bane
wide crystal
fringe crag
wide crystal
#

Remove the feature from the character, clear the effect.

#

Then edit the original feature and tick that box.

#

Then try to equip it again.

vast bane
#

Pins updated for the return of Tposney and the new versions

wide crystal
fringe crag
#

transformed but no darvision without clicking the hand

vast bane
#

what is the keys on darkvision ae?

wide crystal
vast bane
#

@fringe crag you appear to have the wrong ATL keys but I can't trully see them cause you haven't shared them yet, the old v9 keys still populate in DAE

deep harbor
#

It seems that I need a module called Perfect Vision for global dim/darkness/magic darkness control.
Is there any reason this won't work, or anything I should look out for, using it alongside midi, etc.?

vast bane
#

thats your problem then, wrong keys

fringe crag
#

it works but it doesnt get removed. I'll try the once from the spell

vast bane
#

v10 caused Active Token Effects to need a rewrite and they changed the keys but the old keys are still in DAE so people can be mislead to use the wrong keys

fringe crag
#

I cant find the ones from the spell in the list. Can I just write them and they still work?

#

ah found it

vast bane
#

why would darkvision need to be removed, show me the description of change soul

fringe crag
#

because he switches between a divine sorcerer and a shadow sorcerer and the divine one doesnt have DV

vast bane
#

whats the duration then

fringe crag
#

ca 18 hours until the soul switches again

vast bane
#

change soul's target/range should be self/self and the duration in item details should be set, if its not set, then DAE needs to have the duration of the ae overridden to its duration

#

you also need times up module for effect expirations I believe

fringe crag
#

yea but shouldnt it remove too when I delete the change souls effect?

vast bane
#

technically range self isn't needed I don't think but I still do it

#

do you have adequate vision installed?

#

AV will lock DV on regardless of ae's if you have the trait on the actor

fringe crag
#

no only perfect vision

#

see it stays. The rest is working fine

vast bane
#

also you should make sure that you don't have rogue ae's when you edit owned items active effects(its in the pin)

#

I think you have a rogue ae

#

because of editing owned items

#

delete both ae's then edit change soul, and click the hand icon

#

it shouldn't be transfer on equip for the record

#

it should be blank on all the first tab checkboxes

#

but you appear to have rogue ae's

#

once you clear the two weird ae's on the actor, go to the item and click the lil hand, OR DONT if its not suppose to be transfer on equip, if it is meant to roll the item to apply, make sure theres no boxes checkd in the first tab of the item:

fringe crag
vast bane
#

I said to delete the ae's on the actor not the item >_<

fringe crag
#

๐Ÿค”

#

my bad

vast bane
#

however, do you have times up?

fringe crag
#

yea thats gone

vast bane
#

a 0 second duration ae is usually a red flag for times up being absent

fringe crag
vast bane
#

remake the ae on the item and if its roll to apply, no boxes checked on first tab of ae

#

yeah then its very definitely the pinned issue with editing owned items

#

when you edit an owned item, especially if you fiddle too much with the first tab of the owned item, you can sometimes generate multiple rogue ae's on the actors effect tab

#

the official warning would be edit all items in the sidebar, but technically if you always look at your actors effects tab after you edit owned items you should be able to always spot the rare bug, which is happening to you this moment

vast bane
fringe crag
#

still stays

fringe crag
vast bane
#

what versions of midiqol and dae are you on

#

I have a horrible feeling in my stomache that the new versions are going to be broken

fringe crag
#

didn't update the modules

vast bane
#

oh good! you haven't updated yet lol so it can't be the new ones lol

fringe crag
#

always sceptical if I have a game on that day haha

vast bane
#

it must be the way you set the item up

#

show me the ITEMS effect's three tabs

#

not the actors

#

my server just went into maintenance mode so I won't be able to help properly for 30 mins

fringe crag
#

this?=

#

all good. I got time

vast bane
#

show me the item details tab

fringe crag
vast bane
#

what is the duration of the item

fringe crag
vast bane
#

you made a permenant passive

fringe crag
#

and I cant make it that it removes the passive with the temporary effect?

vast bane
#

when you add the duration remember, you edited an owned item, look and delete the old one

#

on the ACTOR effect tab

fringe crag
#

I really hate this icon. because it would stay there for sessions

vast bane
# fringe crag

there are 2 ways to remove that from a duration effect

fringe crag
#

and even like that the effect stays when removing the other effect

vast bane
#

you could auto hide ae's in TVA or you could give that ae a transparent image

#

or no image actually

#

clear the image path on the ae

fringe crag
#

that removed the icon. But the DV stays in the normal form

vast bane
#

they have the effect on

#

why would it go away if they still have it

fringe crag
#

Because I use the "change soul" and when removing the "change soul" effect the DV should get removed too because the source is gone or not?

vast bane
#

that looks more like fog than darkvision fwiw

fringe crag
#

that's without DV

vast bane
#

this is where giving me the description of what you are trying to make is better than trying to fiddle with whats given

fringe crag
vast bane
# fringe crag

that makes no sense, if they just saw around them the fog should show

#

share the feature you are trying to make in dnd, the foundry terms and half infos are confusing me

vast bane
# fringe crag

either you have simple fog/fog of war off, or this token just had its vision setting removed

fringe crag
#

ok ok.

Change souls changes the Icon of the Character. And with that he changes from divine sorcerer to a shadow sorcerer and a Shadow sorcerer has 120ft DV from level 1. I just want to include that automatically into the change souls. And I want the DV automatically gone when he changes back to the divine one aka remove the effect

fringe crag
deep harbor
#

I'm trying to do much the same thing but for races, also using Perfect Vision to set the global illumination to dim.

vast bane
#

you can add to the item I had you make, the atl.texture.src key and whenever it has DV it will look like that image in the effect value

vast bane
#

oh wait yeah you do

#

I dunno wht the macro is you are using but you can tie vision and a token image to the same ae

deep harbor
#

One second, just setting up a test map with some walls an a light source.

fringe crag
vast bane
#

is it a levels map?

#

chris doesn't use ATL keys so you probably should add the dv on/off to his macro in macro form, that I don't know how to do

deep harbor
#

Okay. I have a token with no darkvision, and everything outside of themselves is dark. Hurray.

vast bane
#

generally speaking DV racial should be done to the proto token directly, you should only use ATL keys if its a duration effect

fringe crag
vast bane
#

it should be one feature/item, you never showed me chris's thing

deep harbor
vast bane
#

also editing the proto actor in a macro is exactly how you get ATL bugs

#

till you install the new alpha build of ATE

fringe crag
#
    async function effectMacro () {
        await warpgate.revert(token.document, 'Image Change');
    }
    let effectData = {
        'label': this.item.name,
        'icon': '',
        'duration': {
            'seconds': 604800
        },
        'origin': this.actor.uuid,
        'flags': {
            'effectmacro': {
                'onDelete': {
                    'script': chrisPremades.helpers.functionToString(effectMacro)
                }
            }
        }
    }
    let tokenArt = 'NPC/Kreaturen/Humaoid/Werewolf_Medium_Humanoid_A_09.png';
    let avatarArt = 'NPC/Kreaturen/Humaoid/Werewolf_Medium_Humanoid_A_09.png';
    let updates = {
        'embedded': {
            'ActiveEffect': {
                [effectData.label]: effectData
            }
        }
    };
    if (tokenArt != '' && tokenArt) {
        updates.token = {
            'texture': {
                'src': tokenArt
            }
        }
        updates.actor = {
            'prototypeToken': {
                'texture': {
                    'src': tokenArt
                }
            }
        }
    }
    if (avatarArt != '' && avatarArt) {
        if (!updates.actor) updates.actor = {};
        updates.actor.img = avatarArt;
    }
    let options = {
        'permanent': false,
        'name': 'Image Change',
        'description': 'Image Change'
    };
    let effect = chrisPremades.helpers.findEffect(this.actor, this.item.name);
    if (effect)  await chrisPremades.helpers.removeEffect(effect);
    await warpgate.mutate(this.token.document, updates, {}, options);```
deep harbor
#

I've made them an Elf, and the 60ft darkvision is now working.

vast bane
#

if you want to uses chris' thing you gonna have to get his help for dv, I don't even know what half that is

#

my guess is you can add the vision settings around the area of updates.token = {

fringe crag
#

alright. Thanks for the help!

deep harbor
#

Could the same effect be achieved through a warpgate mutate?

#

Just curious.

vast bane
#

the macro is a warpgate mutate, the updates would go where I just referenced but I don't know what they look like in warpgate

#

is all that macro doing is changing the token art?

deep harbor
#

As far as I can tell, yes.

fringe crag
#

@vast bane Do you know where I can find the Actor from warpgate that is mentioned?

vast bane
#

I think thats a typo, he means jb2a assets

#

no way badger provides an actor compendium

fringe crag
#

yea didn't find one and was confused

deep harbor
#

So, having the upgrade on vision range for Dwarf is working, but the one for Duergar (Dwarf) is not.
Dwarf sets vision mode to darkvision and upgrades range to 60 ft.
Duergar does the same but upgrades range to 120 ft.

#

It's the priority that was wrong.

#

Sorted.

vast bane
#

you really shouldn't do racial visions in ae's

#

i they are permenant, then doing needless ae's especially in midiqol setups is going to add up and drag down combat

#

if its permenant then mod the sheet directly

deep harbor
vast bane
#

edit the sheet directly or possibly macros

deep harbor
#

Part of the reason I'm doing this is so that I can clone a generic humanoid, let's say 'Soilder', and assign a race and subrace with only two drags from the compendium, so I want to avoid manual if at all possible.

vast bane
#

just understand that is an expensive setup over time as you build out your world

deep harbor
#

Expensice as in "It takes a loooong time", or computationally?

vast bane
#

computational

#

also modding the priority to overcome other ae's will then cause premade items that target the same kiey need to be modded too

deep harbor
#

I don't plan on using any pre-mades as is. I'm trying to compendiumize 5E, into a single matching set, and am well aware of how gargantuan a task that is.

#

Computationally, would using a macro to make the racial changes be better than a collection of effects?

#

I'm setting this up for a group of 4 DMs/Players, who have been playing together for over half a decade. I have the time and am willing to spend it in this way. A long term project to work on in the background.

#

And because the macro fires only once, it wouldn't lock those items either?

vast bane
#

in a midi build you are going to have a ton of ae's to begin with but to then leverage permenant thigns on actors to also be ae's is going to add to the workflow

#

correct

deep harbor
#

Good. Having to toggle the race AE to change your stats was a negative.

vast bane
#

ae's are documents stored in the actor data while a macro edits the paremters of the actor/token

deep harbor
#

Would it best be done as a warp, which can then be reverted when the feature is removed, or would that counteract the positives?

#

I would still need one active effect to toggle the macro, for both race and subrace. They'd be empty except for an Item Macro call, but they'd still need to be there.

#

This is the effects list for Urist McDorf the Duergar. It's pretty beefy already, so macro would be better.
The toggleable sunlight sensitivity would still need to be on there through.

vast bane
#

if the change is situational/temporary then ae's are the way to go but babonus can sometimes also be utilized for things too

deep harbor
#

So, warp or direct edit?
And would the latter be easily reversible?

vast bane
#

Warpgate would make whatever you are making require a module

#

I don't think direct edit is reversable unless you store it somehow

#

honestly its a question for #macro-polo I knokw wnough about macros to get myself in trouble thats about it

deep harbor
#

I'm already using warpgate for other effects, such as my enlarge reduce spell, so I'm not worried about a dependency here.
As for #macro-polo , I'm 99% sure they'll just direct me back here because I'm using midi QoL. I should be able to figure it out as a warp.

#

Saying that, the mutate revert in my enlarge/reduce spell isn't working again. And its removal from the target isn't ending the caster's concentration.

deep harbor
#

It's failing to call the item macro. Assigning origin isn't the only thing needed for that, clearly.

#

Does anyone know exactly what a DAE with macro.itemMacro needs to make a successful call?

vast bane
#

are you on midi 36/dae 25?

deep harbor
#

I updated midi this morning, didn't notice a DAE update.

vagrant wharf
#

is there a macro or something for bestow curse, the way a little popup happens for contagion

deep harbor
#

Looks lie it's missing the item data flag.
I just compared it to a effect added directly using dae, not a macro, and it has in flags.dae an Item data flag with a bunch of information in it.
I think I have two ways to fix this. Have the spell apply an empty effect before the macro runs, which will be correctly auto-populated, or clone this structure.
I'm sure others must have encountered this issue before, so I'll leave a question and come back later:
When adding an effect to an actor using a macro, where the effect definition is written in the macro, and the effect them calls macro.itemMacro as one of it's effects, how do you handle this?

vast bane
#

when in doubt pagerize midi srd, midi samples, and cpr

vagrant wharf
#

isn't there just midi samples

vast bane
# vagrant wharf isn't there just midi samples

Sources of premade stuff for Midiqol:

Midi Sample Items Compendium(comes with the module)

Midi SRD's compendiums
https://foundryvtt.com/packages/midi-srd

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

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

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

Dfred's Convenient Effects:
https://foundryvtt.com/packages/dfreds-convenient-effects

Activation condition and other useful info:
https://github.com/thatlonelybugbear/FoundryMacros/wiki

vagrant wharf
#

I'm positive I have like half of those, but I didn't think midi srd was competible with v10

vast bane
#

it is now

vagrant wharf
#

so it is, just looked

#

but yeah I have convenient effects too, I consider it mandatory alongside midi

#

the sample items compendium is super helpful too, even if improved divine smite confuses me

vast bane
#

I use CPR's smite, smoother use

#

improved divine smite is really simple, its just a damage bonus to all mwaks

vagrant wharf
#

I just extracted the activation from dragonslayer

#

thats what I mean though - improved divine smite is more than just 1d8, its an extra 1d8 to certain targets

vast bane
#

By 11th level, you are so suffused with righteous might that all your melee weapon strikes carry divine power with them. Whenever you hit a creature with a melee weapon, the creature takes an extra 1d8 radiant damage.

vagrant wharf
#

no but I might have misread it, let me see again

#

ok you're right. somehow I got it into my head it dealt extra damage divine smite style

#

n/m on that one then, makes way more sense now

vast bane
#

no but some phb's have bad wording including mine

#

it was clarified in the errata and a jc tweet, it only applies the damage once

#

here is the confusing wording version:

#

there is an errata for this so this is not raw unless you don't subscribe to errata

vagrant wharf
#

I use errata just somehow got it into my head that the extra radiant damage also applied to improve divine smite

#

say goodbye to your extra 1d8 bitches

vast bane
#

honestly they don't need more damage, barbas and pallies are already ridiculous post level 11

#

my two martials are op af in my campaign

vagrant wharf
#

well in my very undead heavy campaign it was extra silly

#

I guess the vengeance paladin will have to be slightly less godlike

#

they're already kinda underrated compared to hte edgelord paladins

#

is there some way to create a stacking -max hp effect for stuff like wraith attacks? or Harm?

vast bane
#

CPR has multiple examples of creatures that reduce stats

vagrant wharf
#

also is there a way to segregate the infenral wound from devil glaive from the lifesteal effect

vast bane
#

with macros you can do just about anything

vagrant wharf
#

I carefully added hte wound effect to lifestealer sword but it only triggers the wound on a crit

vast bane
#

the wraith is not in CPR but Shadow is

vagrant wharf
#

which lifestealer is supposed to do but not devil glaive

#

I don't have anything in the active effects that says apply only on crit so I don't know

#

its just infernal wound renamed

vast bane
#

dc 20 seems crazy for an item

vagrant wharf
#

this is a CR 22 boss

#

not a player item

#

and the party has a paladin that's probably going ot have holy avenger by th time they fight him anyway

vast bane
#

if its meant to heal the owner for the overtime damage then thats pure midi macro territory

vagrant wharf
#

no

#

its meant to do the wound effect from devil glaive

#

which is what you see above, copy pasted over

#

a stacking wound per hit, crit or not

vast bane
#

i tshould transfer on hit, unless you have a strange activation condition in the item

#

I think you need the macro that comes with that weapon, overtimes don't stack right like that

vagrant wharf
#

now it also has the lifestealer as the base sword, which is meant to trigger on a crit

#

for some reason its applying the wound only when there's a crit, triggering the lifesteal

vast bane
#

uncheck the box there and the ae will apply no matter what

#

well it applies on hit

vagrant wharf
#

but will that apply the lifestealer effect on every hit too?

vast bane
#

how many ae's are on the actor?

#

errr item

vagrant wharf
#

this is the goal, one that triggers on crit, and one that triggers on every hit

#

just what you see above

vast bane
#

show me the effect tab of the item pls

vagrant wharf
vast bane
#

effect tab of item

vagrant wharf
vast bane
vagrant wharf
#

the lifestealing isn't an effect, its part of the item macro

vast bane
#

yep uncheck effect activation true box at the bottom of the item and you shuld be all set

vagrant wharf
vast bane
#

macros have nothing to do with that

#

what is the point of the activation condition if the check is in the macro too?

vagrant wharf
#

I have no idea?

vast bane
#

my guss is you picked two different items and combined them?

vagrant wharf
#

yeah I took lifestealing

#

didn't touch anything except the base damage per hit

#

and the item name

#

and imported the wound effect

#

I didn't mess with anything else

vast bane
#

the glaive had a macro too, are you appending that onto the lifestealing one?

vagrant wharf
#

the glaive didn't, just the effect

vast bane
#

Devil's glaive?

vagrant wharf
#

I looked carefully for that

#

yes

#

anyway unchecking the box did work

vast bane
#
const version = "10.0.10";
try {
    const lastArg = args[args.length-1];
    if (args[0] === "on") {
      let target = canvas.tokens.get(args[3]);
      let flag = DAE.getFlag(target, "infernal-wounds") || {hookId: 0, woundCount: 0};
    console.error("fetching flag ", target.id, flag);
      flag.woundCount = flag.woundCount + 1;
      if (!flag.hookId) {
        console.error("hookId not set");
        flag.hookId = Hooks.on("deleteActiveEffect", (actor, effectId) => {
          console.error("Resetting wound count");
          if (effectId === lastArg.effectId)
            DAE.unsetFlag(tactor, "infernal-wounds");
        })
      }
      DAE.setFlag(target, "infernal-wounds", flag);
    
    } else if (args[0] === "each") {
      let tactor;
      let ttoken = canvas.tokens.get(lastArg.tokenId);
      if (ttoken) tactor = ttoken.actor;
      else tactor = game.actors.get(lastArg.actorId);
      let damageItem = Item.createOwned(game.items.getName("Infernal Wound"), tactor);
      let saveTargets = game.user.targets;
      game.user.targets = new Set([ttoken]);
      let hookId = Hooks.once("midi-qol.RollComplete", (workflow) => {
        if (workflow.saves.has(ttoken)) {
          tactor.deleteEmbeddedEntity("ActiveEffect", lastArg.efData._id);
        }
      })
     try {
      damageItem.roll();
      let flag = DAE.getFlag(ttoken, "infernal-wounds") || {hookId: 0, woundCount: 1};
      } finally {
       game.user.targets = saveTargets;
      }
    } else if (args[0] === "off") {
    // do any clean up
    }
} catch (err)  {
    console.error(`${args[0].itemData.name} - Devil's Glaive ${version}`, err);
}

Devil's glaive most definitely has a macro

vagrant wharf
#

yeah I see it now

#

the one I dragged over earlier today didn't have that I don't think

#

either way just using the Effect I copy pasted works

#

it applies a stacking wound

#

checks for a con save

#

and deals the correct damage

vast bane
#

I think thats gonna break though and not trully stack as overtimes do not like to be stacked on themselves, thats the point of the macro

vagrant wharf
#

then I might just get rid of the lifestealing since I don't know how to combine them

vast bane
#

if you clear the similar variables or edit them accordingly, those two macros could just be combined

vagrant wharf
#

I have no idea how to do that

vast bane
#

anything that is defining a const or a let

vagrant wharf
#

my programming knowledge starts and stops with copy paste

vast bane
#

if they are same on both macros, then leave them, if they are different after the = then the var needs to be changed to unique for each function

#

actually looking at lifestealing, it has nothing

vagrant wharf
#

sorry I'm monolingual

#

english only

vast bane
#

you should be able to put them both on top of each other in a single item

#

lifestealing doesn't define any variables

#

only glaive does

#

just literally paste one into the other make sure that theres a line break where the two meet

vagrant wharf
#

ok that I can do

vast bane
#

also roll other was not suppose to be checked, as its only suppose to roll with the activation condtiion, thats why there is one on that weapon

vagrant wharf
#

I'm assuming that I have to rename Infernal-Wounds to Grievous-Wounds since thats what my Effect is using

#

or the macro breaks

#

or it breaks anyway

vast bane
#

I was mistaken theres a variable defined twice

#

find the easier of the two to rename

#

it will be a const X = line or a let X = line

vagrant wharf
#

what

vast bane
#

OH

#

its the stupid one on each lol

#

its the version

#

look at the very first line

#

thres two of them cause you pasted both macros

#

just delete the first line

#

they are needless lines anyway but only one needs to be deleted

vagrant wharf
#

ok that worked

vast bane
#

I just am so trained to ignore the first line there that It didn't occur to me that it was technicallly declaring something

vagrant wharf
#

yeah I have no idea, its all a wall of gibberish to me, but yeah that seems to have fixed it

#

the goal is to have the lifestealing effect as part of his theme more than something I expect to actually see use

#

but the stacking wounds are a real issue the players confront immediately in the fight

vast bane
#

bearded devil has the same mechanic, I thought for sure it would create a problem for my players, they destroyed a whole army of them at level 6 and since then I never bothered to throw them at them again. Pallies make the feature useless

vagrant wharf
#

yeah tahts why the save is so high

#

I'm anticipating like +5 and advantage to their save so I figure 20 will make it scary and meaningful but not impossible to beat

vast bane
#

its just easily removed is the issue

vagrant wharf
#

yeah the magical healing

#

I don't want to fuck with the macro but I might remove that if I knew how

vast bane
#

getting too far into the weeds, the mechanics won't be the fun part, the rp will be, develop some lines for the baddy, create some suspense in the encounter, the players aren't going to be entertained by javascript

vagrant wharf
#

no but just a way so the wound mechanic isn't easily dealt with would be nice, but oh well

#

the weapon is already really powerful, just trying to ensure he's at appropriate CR 20+ in total

#

its too complicated for me but maybe something like a phantasmal killer type effect on hit that also heals the boss unless you use dispel magic or something

vast bane
#

is it a single monster vs the party?

vagrant wharf
#

no this sword is like Frostmourne, he's a general over the undead so he'll have minions

#

and he has auras of his own to buff them too

#

but this sword of his has been super hyped up so I want being hit with it to hurt and be noteworthy and memorable

#

I still don't know how to make turn defiance grant advantage but oh well

#

it seems like MIDI has a hard time understanding that a particular save is against a certain status effect (like a charm spell) or damage type, unfortunately

violet meadow
#

That is the way the system works.
It's not MidiQol at fault here. Midi though can be used to help with what you want to achieve.
Needs setting up though as it is not out of the box.

vagrant wharf
#

yeah I'm not blaming it since those things aren't as easy to flag as "spell" or "melee weapon attack"

vast bane
#

turn immunity and resistance is

vagrant wharf
#

CPR like what you use to revive unconscious people?

vast bane
#

the long list of modules and compendiums I showed you above

violet meadow
#

When I have time I will test the new MidiQol for the saves. But it will be some time before I can do that.

vast bane
#

you can either drop the premade items in CPR or use his flag:

vast bane
#

CPR is Chris' PRemade Module

vagrant wharf
#

yeah I see it now

#

fortunately forge auto flagged its prereq modules for me too

vagrant wharf
# vast bane

yeah mine doesn't have those, still there's a lot of neat stuff in here

vast bane
vagrant wharf
vast bane
#

yeah that one is his temp items compendium for monster features

vagrant wharf
#

is it safe to use if this won't drop down?

#

like isn't there supposed to be something in the drop down to show its properly working?

vast bane
#

its only for auto complete, its no big deal

#

plenty of midi keys also don't auto complete

#

optional.X for instance

vagrant wharf
#

ok just mkaing sure

#

so this will successfully apply turn resistance to the aura?

#

how do I make it recognize a "turn" effect? does it just scan the name of the incoming spell/ability?

#

oh there's a class features version that I'm guessing is paired with it

vast bane
#

most of his stuff relies on you using macro.ce for status conditions rather than statusEffect fyi

vagrant wharf
#

I dont know anything about that

#

but yeah it seems the that is programmed to interact specificaly with the turn undead CPR class feature

#

gosh a lot of these class ones would've been nice to have months ago

vagrant wharf
#

can you just check the box in special features instead of dragging fortitude onto every relevant undead stat sheet? do they do the same thing or is one busted?

short aurora
#

If I just want a visual indicator of someone being with the range of an aura (think low automation Spirit Guardians), is active auras still the best bet?

gentle sluice
#

thanks

violet meadow
#

Don't know about Chris'integrated Auras, if they would do that too

#

Or it is more behind the scenes infrastructure

umbral basin
#

Hey
I was bumped here from another chat.
Does anyone here know how to fix this macro?

#
if(args[0].hitTargets.length === 0) return {};
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target  = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;

const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = new Roll(`${numDice}d6`).roll();
new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD.name, new Set());
const effectData = {
 label : "Drain",
 icon : "icons/skills/wounds/blood-drip-droplet-red.webp",
 origin: args[0].uuid,
 changes: [{
   "key": "data.attributes.hp.max",        
   "value": `-${damageRoll.total}`,
   "mode": 2,
  "priority": 20
   }],
  disabled: false,
  duration: {seconds: 86400,startRound: gameRound, startTime: game.time.worldTime},
}
await MidiQOL.socket().executeAsGM("createEffects", {actorUuid: target.actor.uuid, effects: [effectData]});
let hpNow = target.actor.data.data.attributes.hp.max;
let updateHP = hpNow - damageRoll.total;
let the_message = `<p>${tokenD.name} drains ${target.name} of ${damageRoll.total} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${damageRoll.total} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
      user: game.user._id,
      speaker: ChatMessage.getSpeaker({actorD: actorD}),
      content: the_message,
      type: CONST.CHAT_MESSAGE_TYPES.EMOTE
    });```
#

Its supposed to deal damage and then heal for the amount of Necrotic damage done. But nothing happens when I run it, its not made by me.

violet meadow
#

await new Roll(

#

And then await MidiQOL.damsgeOnlyWorkflow just below

#

data.attributes.hp.max make it system.attributes.hp.max

#

In the hpNow replace the data.data with system

#

In the ChatMessage.create in the end, better use game.user.id instead of game.user._id

hasty jackal
#

i have a question about ending an effect, i create an effect that needs to end after the target takes damage

#

how can i do it?

violet meadow
#

let damageRoll = await new Roll(...).evaluate({async:true})

violet meadow
#

Do you have times up?

hasty jackal
#

yeah

#

so i just need to remove duration and add one special duration effect?

#

like this?

violet meadow
#

Nope

#

On the DAE

umbral basin
# violet meadow In the ChatMessage.create in the end, better use game.user.id instead of game.u...
if(args[0].hitTargets.length === 0) return {};
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target  = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;

const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = await new Roll(`${numDice}d6`).roll();
await new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD.name, new Set());
const effectData = {
 label : "Drain",
 icon : "icons/skills/wounds/blood-drip-droplet-red.webp",
 origin: args[0].uuid,
 changes: [{
   "key": "system.attributes.hp.max",        
   "value": `-${damageRoll.total}`,
   "mode": 2,
  "priority": 20
   }],
  disabled: false,
  duration: {seconds: 86400,startRound: gameRound, startTime: game.time.worldTime},
}
#
await MidiQOL.socket().executeAsGM("createEffects", {actorUuid: target.actor.uuid, effects: [effectData]});
let hpNow = target.actor.system.attributes.hp.max;
let updateHP = hpNow - damageRoll.total;
let the_message = `<p>${tokenD.name} drains ${target.name} of ${damageRoll.total} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${damageRoll.total} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
      user: game.user.id,
      speaker: ChatMessage.getSpeaker({actorD: actorD}),
      content: the_message,
      type: CONST.CHAT_MESSAGE_TYPES.EMOTE
    });``` 
@violet meadow 
Like this?
violet meadow
#

Oh no

#

Delete the new line you added before the new MidiQOL.damageOnlyWorkflow

#

And just put await in front of the preexisting one

#

I am on the phone to type it out for you so it's more difficult to explain ๐Ÿ˜

hasty jackal
#

okay what option should i pick?

violet meadow
#

Or even the one that says even if no damage is applied to the target to account for resistances

umbral basin
violet meadow
#

Nah just learning and I couldn't be more specific as I am on the phone ! ๐Ÿ˜…

hasty jackal
#

worked

#

thanks

umbral basin
violet meadow
#

Yeah seems fine !

One thing to change to save you some future troubles.

#

In the await new Roll at the end, replace the .roll() with .evaluate({async:true})

umbral basin
#

What kind of future troubles could I have otherwise?๐Ÿ‘€

violet meadow
#

Ahmmm I hope you are in v10 right now

#

Foundry v10 I mean

umbral basin
#

I am!

violet meadow
#

The .roll will be/is replaced by the one I mentioned and backwards compatibility will be dropped after foundry v11 or something

#

So its just future proofing

keen bridge
#

Hey, my workflow is really laggy sometimes, and other times it's OK. It s usually with one precise character but sometimes with others too. Is it necessarily an issue with another module?

#

Sometimes it's the initial hit roll not triggering sometimes the damage roll

violet meadow
keen bridge
#

I still have the issue on targets that have no reaction

#

But I should also check that, maybe it s that sometimes

violet meadow
keen bridge
#

OK thx, ill check that

violet meadow
#

If not, disable reactions and check the saving throws timeout too if that attack involves a save

#

And try again

keen bridge
#

Because it's random it's hard to reproduce

#

But I'll try thanks

#

Somewhat random I guess ^^

violet meadow
#

Yeah if there are any errors we can pinpoint an issue ๐Ÿคทโ€โ™‚๏ธ

umbral basin
# violet meadow The .`roll` will be/is replaced by the one I mentioned and backwards compatibili...

Hmm....
Something is off about the macro. It starts and "does" what it should. However it does not actually heal for the damage dealt, the textbar says the max hp is much lower than what it should be and the creature takes more damage than it should.

Ex
Vampire hits and deals 6 piercing and 17 necrotic damage.

The text in the chat box says that the attacked Giant Crocodile has a Maximum hp of 51 now. Should be 68 (Which the sheet states correctly)

The vampire does not heal for the damage dealt.

You wouldn't happen to know what could have gone awry? ๐Ÿคฃ

violet meadow
#

Hope krig (I saw them typing) can take a look cause I cannot do that easily on the phone.

short aurora
#

I was thinking rolled health shenanigans with the wrong max hp but I guess just fixing the healing is easier

#

Although the flow looks right, is there no errors?

umbral basin
#

Is there a way to check for errors? (This is the first day iv ever dabbled with this)

#

oh wait f12?

short aurora
#

Fair, F12 to open the console and then there should be a red message somewhere.

umbral basin
#

Okay, there are 2 red messages.

short aurora
#

Dope, take a screenshot/use snipping tool and put them here

short aurora
#

I think it's expecting an item where we're just giving the name, try this for your first blurb;

async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if(args[0].hitTargets.length === 0) return {};
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target  = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;

const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = await new Roll(`${numDice}d6`).roll();
await new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD, new Set());
const effectData = {
 label : "Drain",
 icon : "icons/skills/wounds/blood-drip-droplet-red.webp",
 origin: args[0].uuid,
 changes: [{
   "key": "system.attributes.hp.max",        
   "value": `-${damageRoll.total}`,
   "mode": 2,
  "priority": 20
   }],
  disabled: false,
  duration: {seconds: 86400,startRound: gameRound, startTime: game.time.worldTime},
}```
#

Specifically I removed the .name from itemD in the line that starts like await MidiQOL.applyTokenDamage

umbral basin
#

Okay, lets try again

last loom
#

Does anyone know how to automate the effect of 1d4 strength reduction after the damage is done? (Must be stackable)

short aurora
#

to trigger me

#

Did fangy heal?

umbral basin
# short aurora Did fangy heal?

Okay so this time it did heal the vampire (Lady Iley)
However the chatbox message is still incorrect. It states the Crocodile has a max hp of 61, it is however 73 after the 12 necrotic damage it took.

The Crocodiles sheet is correct, the applied effect (Reduction of max hp) is correct. But the chat box message is wrong

:I What could be causing this?

umbral basin
short aurora
#

That's a good question... Would the message be correct with the crocodile "sidebar" actor? Wondering if there's some rolling health shenanigans since I assume crocodile is an unlinked actor/a monster

violet meadow
#

Check the hp message math

#

Midi had probably already updated the hp

#

And you are reducing it by the damage amount once again

short aurora
#

Oof, yes, I overlooked that

#

If you move

let hpNow = target.actor.system.attributes.hp.max;
let updateHP = hpNow - damageRoll.total;``` up to under under `let damageRoll...` it should be good, like so
```js
async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if(args[0].hitTargets.length === 0) return {};
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target  = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;

const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = await new Roll(`${numDice}d6`).roll();
let hpNow = target.actor.system.attributes.hp.max;
let updateHP = hpNow - damageRoll.total;
await new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD, new Set());
const effectData = {
 label : "Drain",
 icon : "icons/skills/wounds/blood-drip-droplet-red.webp",
 origin: args[0].uuid,
 changes: [{
   "key": "system.attributes.hp.max",        
   "value": `-${damageRoll.total}`,
   "mode": 2,
  "priority": 20
   }],
  disabled: false,
  duration: {seconds: 86400,startRound: gameRound, startTime: game.time.worldTime},
}```
vast bane
#

strength drain is in CPR on various premades

short aurora
#

... should that message even do math? Shouldn't it just be able to retrieve the new max?

#

scratches temple

short aurora
#

This is all one big macro, right? You're breaking it up for sake of space?

umbral basin
#

Ye, discord wouldnt allow me to post the whole thing ๐Ÿ˜’

vast bane
short aurora
# umbral basin Ye, discord wouldnt allow me to post the whole thing ๐Ÿ˜’

Fair, I'm irresponsible with my money. Copy paste this, I'm thinking you didn't notice I said "move" and it's trying to declare hpNow twice

async function wait(ms) {return new Promise(resolve => {setTimeout(resolve, ms);});}
if(args[0].hitTargets.length === 0) return {};
let tokenD = canvas.tokens.get(args[0].tokenId);
let actorD = game.actors.get(args[0].actor._id);
let target  = canvas.tokens.get(args[0].hitTargets[0].id);
let itemD = args[0].item;
let gameRound = game.combat ? game.combat.round : 0;

const diceMult = args[0].isCritical ? 2: 1;
const numDice = 3 * diceMult;
args[0].isCritical ? numDice * 2 : numDice;
let damageRoll = await new Roll(`${numDice}d6`).roll();
await new MidiQOL.DamageOnlyWorkflow(actorD, tokenD, damageRoll.total, "necrotic", [target], damageRoll, {flavor: "Necrotic Bite - Damage Roll (Necrotic)", damageList: args[0].damageList, itemCardId: args[0].itemCardId });
await MidiQOL.applyTokenDamage([{damage: damageRoll.total, type: "healing"}], damageRoll.total, new Set([tokenD]), itemD, new Set());
const effectData = {
 label : "Drain",
 icon : "icons/skills/wounds/blood-drip-droplet-red.webp",
 origin: args[0].uuid,
 changes: [{
   "key": "system.attributes.hp.max",        
   "value": `-${damageRoll.total}`,
   "mode": 2,
  "priority": 20
   }],
  disabled: false,
  duration: {seconds: 86400,startRound: gameRound, startTime: game.time.worldTime},
};
await MidiQOL.socket().executeAsGM("createEffects", {actorUuid: target.actor.uuid, effects: [effectData]});
//let hpNow = target.actor.system.attributes.hp.max;
//let updateHP = hpNow - damageRoll.total;
let updateHP = target.actor.system.attributes.hp.max;
let the_message = `<p>${tokenD.name} drains ${target.name} of ${damageRoll.total} pts from their maximum Hit Point value!</p><p>${target.name} now has Maximum Hit Point maximum of ${updateHP}.</p><br><p><b>If it reaches O, they die!!</b></p><br><p> ${tokenD.name} regains ${damageRoll.total} Hit Points back!</p>`;
await wait(600);
ChatMessage.create({
      user: game.user.id,
      speaker: ChatMessage.getSpeaker({actorD: actorD}),
      content: the_message,
      type: CONST.CHAT_MESSAGE_TYPES.EMOTE
    });```
#

This is also me testing if we ever need to do math, because it should just retrieve the changed max HP from get go

umbral basin
#

It works!

short aurora
#

Good stuff

umbral basin
#

Thank you both
@short aurora @violet meadow
Without you I would be stuck with manually fixing these things in game hahaha

#

Hmm, one thing I realised though. Is it possible to have the "Drain" effect go away on a long rest? I mean, there is an option for Special Duration to end it on a "Long Rest"

How would one add that into the macro? Currently the time is just 86400 seconds. ๐Ÿค”

#

As you can see in the bottom I manually set it to Long Rest, but there should be some flag for that right?

vast bane
#

what creature has that?

umbral basin
vast bane
#

has anyone shown you CPR and midi srd?

umbral basin
#

Nope

vast bane
#

if you don't want to reinvent the wheel you can install the midi premade modules which have a ton of stuff made in them

#

Sources of premade stuff for Midiqol:

Midi Sample Items Compendium(comes with the module)

Midi SRD's compendiums
https://foundryvtt.com/packages/midi-srd

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

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

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

Dfred's Convenient Effects:
https://foundryvtt.com/packages/dfreds-convenient-effects

Activation condition and other useful info:
https://github.com/thatlonelybugbear/FoundryMacros/wiki

#

though only incubus/succubus are available in cpr for draining attacks

reef monolith
#

Hey folks, Freeze helped me modify the macro from the scene transitions module to play a random animation cutscene. I have Dice So Nice set to execute the macro on any roll of a '20'. I'm wondering if there's an existing way in Midi to tie the macro execution to the application of crit damage or Midi's recognition of a critical hit, like it does with sounds?

short aurora
# umbral basin Hmm, one thing I realised though. Is it possible to have the "Drain" effect go a...

Try replacing your effectData with this;

const effectData = {
    label: "Drain",
    icon: "icons/skills/wounds/blood-drip-droplet-red.webp",
    origin: args[0].uuid,
    changes: [{
        "key": "system.attributes.hp.max",
        "value": `-${damageRoll.total}`,
        "mode": 2,
        "priority": 20
    }],
    disabled: false,
    duration: { seconds: 86400, startRound: gameRound, startTime: game.time.worldTime },
    flags: {
        dae: {
            specialDuration: ['longRest']
        }
    }
};```
umbral basin
vast bane
#

thats probably a dae macro,read its macro instructions

umbral basin
last loom
# last loom Does anyone know how to automate the effect of 1d4 strength reduction after the ...

ya me lo solucionรฉ

// Runs only if a hit is detected
if (args[0].hitTargets[0] !== undefined) { 


// Get Actors
const lastArg = args[args.length - 1];
let tactor;
if (lastArg.tokenId) tactor = canvas.tokens.get(lastArg.tokenId).actor;
else tactor = game.actors.get(lastArg.actorId);
let target  = Array.from(game.user.targets)[0].actor;

// Roll the die
let roll = await new Roll('1d4').roll();
roll.toMessage({flavor: "Fuerza reducida"})
let rollvalue = roll.total;
let stat = target.data.data.abilities.str.value-rollvalue;

//write effect
let drain = async function() {
   let the_message = "";
   const effectData = {
      label : "Drain",
      icon : "icons/magic/unholy/orb-hands-pink.webp",
      changes: [{
        "key": "data.abilities.str.value",        
        "value": `-${rollvalue}`,
        "mode": 2,
        "priority": 20
       }],
        disabled: false,
        flags: {
            dae: {
                macroRepeat: "none",
                specialDuration: ["shortRest"]
            }
        },
      }
await target.createEmbeddedDocuments("ActiveEffect", [effectData]);
the_message = `<em>${tactor.name} saps ${target.name} of ${rollvalue} pts from their Strength Score! <br><br>${target.name} now has a Strength Score of ${stat}. <br><br><b>If it reaches O, they die!!</b></em>`;

ChatMessage.create({
 user: game.user._id,
 speaker: ChatMessage.getSpeaker({tactor: tactor}),
 content: the_message,
 type: CONST.CHAT_MESSAGE
});

}

drain();



}
scarlet gale
short aurora
#

Not sure how to set that up to be on everyone inside the radi

scarlet gale
#

I want to say it's in the generic category

#

If you want an outline on the tokens in the area, token magic fx might be better

#

That one has an outline preset flag

short aurora
#

๐Ÿ‘ Will have a look

umbral basin
vast bane
#

make sure your item does nothing, so set its action type to other and have no formulas

umbral basin
#

Well the macro activates but does nothing ๐Ÿ˜‚ Oh well Atleast I got a nice chat box that said "Elemental Weapon"

vast bane
#

it gives you a temp item

#

open console if it didn't

#

if you want help with it report the error you see in console

scarlet gale
#

If you're trying to use a DDB importer macro, may just be easier to enable the module and use this console command set it up right:

item = game.items.getName("Cloak of Displacement");
await game.modules.get("ddb-importer")?.api.effects.addDDBIEffectToDocument(item);```
#

Replacing Cloak of Displacement with whatever the item or spell name is.

umbral basin
keen bridge
#

It seems my lag was caused by target reacts and/or search anywhere. Not sure it's entirely fixed but it seems smoother without, we'll see in real play

#

I should probably stop keeping those unmaintained modules ^^

light sleet
#

does CPRs healing light work for anyone?

scarlet gale
#

Good chance I broke it by accident

#

let me take a look at it

#

Actually the dumbest bug

#

Fixed in next release lol

light sleet
#

sick

umbral basin
# scarlet gale Good chance I broke it by accident

It is THE Chris!
I have a question for you! I just installed your CPR spells. Is the spell Spiritual Guardians just supposed to ask for alignment and then start the animation?
Because I see no effects of lowered speed nor damage dealt.

scarlet gale
umbral basin
#

It asks for "Movement and Combat listener" and those are both activated

scarlet gale
#

You need "Movement Listener" and "Combat Listener" on for it to work.

#

I don't have it applying a slow, but it should be triggering the damage right.

#

Is there errors in console when the turns swing around?

umbral basin
#

Ill check

#

This poped up when I used it

scarlet gale
#

None of those are relevant.

#

Go through the turns and see if anything shows up

#

Specifically red (warning) errors

umbral basin
#

Nothing shows up in the log when I switch turns

scarlet gale
#

Sent you a DM

#

Also, turn off better rolls

#

That module doesn't work with midi anymore

#

Nor is it updated for version 10 of Foundry

jovial crater
#

I started using Chris's module this week and was trying to use the maneuvers, but idk how to set up this scale thing. Could you guys help me?

scarlet gale
#

Take a look at your sub-class for battle master

#

you'll want to unlock it and edit it

jovial crater
#

Ok

scarlet gale
#

Screenshot what it looks like right now

#

You should only just need the first one on the list

deep harbor
#

What would I need to call if I want to manually tell midi-qol that a character is no longer concentrating on a spell?
I can see that it populates and unpopulates the midi-qol.concentratiion-data flag on the actor, but don't know what function would clear it properly.

scarlet gale
#

Unless you're trying to keep that for some reason.

deep harbor
jovial crater
#

I believe it's working. For brace and riposte I click on the feature and they add the die on the next attack

#

But how does precision attack work?

scarlet gale
#

You should get a prompt on a regular attack

#

Iirc it's using midi optional bonus

vast bane
deep harbor
#

Even though I had a macro grabbing an effect just a few days ago, I'm now struggling to figure how to do that again.
I need to get the effect index for Concentrate, but I'm clearly not doing it quite right.

scarlet gale
#

I looked over the module list too

deep harbor
#

Here's what I've got, but I've tried a few variations also:

if (err.message == "The Dialog was closed without a choice being made.")
        {
            const caster = lastArg.actor;
            const effectIndex = caster.effects.findIndex(e => e.value.label == "Concentrating");
            caster.effects.remove[effectIndex];
            return;
        }
scarlet gale
deep harbor
#

Basically, if the player cancels the spell by closing the dialogue box, I don't want them to keep concentrating.

deep harbor
scarlet gale
#

Then do js await effect.delete()

deep harbor
#

Thanks.
It works now.
For the fourth time, I believe that this enlarge reduce macro is fully functional. Hopefully it actually is ๐Ÿ˜„

jovial crater
scarlet gale
jovial crater
scarlet gale
umbral basin
scarlet gale
jovial crater
deep harbor
scarlet gale
#

Such as having devil's sight, or blindsense

#

Turning on attack attribution in the midi settings will make it more obvious too

umbral basin
umbral basin
scarlet gale
umbral basin
#

Thank you!

bleak jungle
#

is this the place for the ultimate D&D5e automations construction?

scarlet gale
#

Assuming you're using midi-qol as a base, yes.

bleak jungle
#

Chris! We have the same name. Also I just installed your Pre-Mades. Honestly I have been using Foundry since like Aug/Sept and have been using MidiQOL for fights, but it's a low combat game so I never had a need to dig into what was happening or get to heavy automation. But now we have decided to fight more. So.

young owl
#

Huh, hadn't heard that before. What's the conflict/risk? Been using for awhile, so curious what might have been being screwy

scarlet gale
#

Templates were not passing targets right. But the new update should have fixed that

#

It's not any hard incompatibility, just a potential for bugs

vast bane
#

also midi reactions weren't working with mims

young owl
#

Hm, thanks for the info

lusty yacht
#

Could anyone help me with creating either/both of these effects for a magic item? I'm still new to automating things

At the start of every combat, attack rolls against you have disadvantage before the start of your first turn, provided that the item is on your person.
&
As an action, you can use the item to strike a point. The first time in the next minute that a creature within 60 feet of that point deals damage to another creature with an attack that hits, the attacker takes psychic damage equal to half the damage it dealt to the target. [Can only use once per long rest]

violet meadow
violet meadow
#

This one is freaking awesome tbh! Let me know if it works OK and I will add it in the WIKI.

#

As for the secondary Item that snuck in, its doable but not as easy. Will give it some thought

lusty yacht
lusty yacht
violet meadow
#

Share a screen of the effect

#

Are you in combat, first round?

lusty yacht
#

Which part of the effect, The section with the effect value?

#

And yes, I am in combat round 1

lusty yacht
violet meadow
#

Strange. So the actor with that effect is in the active combat and their turn has not yet passed?

#

Any errors in console?

#

Just testd and works for me ๐Ÿค”

lusty yacht
# violet meadow Any errors in console?

I'm not familiar with reading all this console stuff. But it looks like it's saying it's giving my tokens advantage on their attacks because they are "hidden/invisible" even though that's not the case ๐Ÿ˜… I think it's an error with CUB?

violet meadow
#

ok saw the issue

lusty yacht
#

Some are actually getting advantage rather than just 'normal' attack though. I think implying it's not always giving them disadvantage regardless of the CUB error?

scarlet gale
#

Your tokens don't have vision setup on them most likely

lusty yacht
violet meadow
#

grab it again

#

The Vision might be a secondary issue. If that is setup correctly, the shared example should be working fine!

lusty yacht
lusty yacht
scarlet gale
#

I've always like those random rune things from that module

violet meadow
#

OK so for the secondary effect I believe it's too much trouble for what it's worth ๐Ÿ˜…

Placing a Template and then either an Active Aura or Template Macro, which would create a DAE on the creatures entering the radius, with a special duration of 1 Hit and a macro.itemMacro which on the args[0] === "off" it will damage the attacker for half the damage dealt.

#

And then when that goes off, the template should just be deleted as well

scarlet gale
#

That 2nd part would be a lot easier with template macros probably

#

Active Auras in recent updates hasn't been removing auras after template deletion, so watch out

lusty yacht
violet meadow
#

I haven't used that for some time tbh ๐Ÿคท

scarlet gale
violet meadow
#

VAE buttons though ๐ŸคŒ ๐Ÿ˜„

scarlet gale
#

NO D:<

short aurora
#

Hmm, if macros can be in VAE, them buttons could run the temporary items Chris' items create for me for that double dip... ๐Ÿค”

violet meadow
#

yeah they can ๐Ÿ˜„

scarlet gale
#

fine

#

I'll look into adding buttons

short aurora
#

I was going to write my own module to create some "temporary action bar" for the items I have that create items, so using VAE instead sounds v tempt

scarlet gale
#

I'm a big fan of favorting them in tidy and setting their custom sheet section to make them stand out.

short aurora
#

That's a good solve, I made another module for myself that changes the character sheets and I think I'm locked out of tidy for that. >_>

scarlet gale
#

Can custom buttons be made during effect creation? Or do I have to use the VAE hook?

short aurora
#

API says hook but I don't know when that actually fires, maybe you can macro some hook once shenanigans

scarlet gale
#

Having it in a hook seems backwards to me. I'll have to look at the flags, but I'd think I can just set a flag on the effect data during creation.

violet meadow
scarlet gale
#

I am

short aurora
#

why does bugbear sound like the stranger the schools warned me about

violet meadow
#

Let's go for a ride with my Van

#

I meant VAE

#
const content = fromUuidSync(effect.origin).system.description.value;
const buttons = await TextEditor.enrichHTML(updateVAE(item),{async:true});
await effect.setFlag("visual-active-effects", "data", {content, intro:buttons});

function updateVAE(item) {
    let buttons = `<b><center>${item.name}</center></b>`;
    buttons += "<div class='vae-buttons'><p>";
    if (item.hasDamage) buttons += `<a data-vaebutton="damage" data-uuid="${item.parent.uuid}">${game.i18n.localize("DND5E.Damage")}</a>`;
    buttons += "</p></div>";
    return buttons;
}
``` and Custom CSS ```js
.vae-buttons {
 display: flex;
 flex-direction: column;
 align-items: center;
}

.vae-buttons a {
  font-size: 14px;
  height: 30px;
  line-height: 26px;
  margin: 2px 0;
  background: #6f2f31ad;
  border: 2px groove #9e6161;
  width: 100%;
  border-radius: 6px;
  text-align: center;
  padding: 1px 6px;
}

.vae-buttons a:hover {
  text-shadow: 0 0 8px white;
  background: brown;
  color: black;
}

li.control-tool.toggle.active {
  background: var(--color-shadow-highlight) !important;
  box-shadow: 0 0 10px var(--color-shadow-highlight) !important;
  border: 1px solid var(--color-shadow-highlight) !important;
}
scarlet gale
#

That uh

#

seems messy

violet meadow
#

Back in the day ... before hooks ๐Ÿ˜…

scarlet gale
#

Guess I should just add my own button and populate it like the module API wants

violet meadow
#

Yeah now that you have the Hook, just use it on the module level

short aurora
#

That's a clever approach

hasty jackal
#

how can i add temporal true sight to someone? its a 15 ft truesight area for 1 minute

#

using DAE or Midi

scarlet gale
#

A ATL key can do that

hasty jackal
#

hmm how can i add it?

scarlet gale
#

Have the item add an effect with the ATL key

hasty jackal
#

like this?

scarlet gale
#

ATL should have a bunch of keys that will auto complete

#

It'll likely be one of the ATL.detectionModes keys

hasty jackal
#

nope :/ maybe i can try using system

vast bane
scarlet gale
#

They have VAE buttons now.

#

I even added a automatic details feature to fill in the VAE details when the effect doesn't have one set.

hasty jackal
#

what values should i add?i tried +15 but didnt worked

vast bane
#

you usually do not need to set these

#

do you have an abnormal vision setting?

#

dnd5e/foundry will pair the most likely detection mode with what vision mode you set

#

its probably going to be upgrade or override

hasty jackal
#

its for adding an effect like arcane eye but with true sight

vast bane
#

but if its just basic.range, thats autopopulated with your visionMode

#

wouldn't that just be an actor?

hasty jackal
#

arcane eye adds darkvision i think

vast bane
#

yeah but it never doesn't have darkvision

#

its like spiritual weapon, you summon a notarget creature type unit that the mage can see through and its proto actor has the vision settings on it already, no need to make an ae for it

#

but moreover than that, unless its truesight, darkvision will just need basic sight and its default made by foundry when you set the darkvision range

#

oh I misread your statement i thought you were making arcane eye

vast bane
#

though if it is an actual seperate actor, i suggest what I just said above, if its a self buff like this then use this

hasty jackal
#

hmmm okay ill use that as a base

#

and yeah

#

its a selfbuff

vast bane
#

How do you make an ae that an actor applies to a token, give itself advantage against said token? I know its an activation condition on a grant advantage flag, but I dunno how to tell it what the id is of the source actor who put the ae on?

#

Use Case:

Melee Weapon Attack: 1d20+6 (+6) to hit, reach 5 ft., one creature. Hit: 10 (2d6 + 3) piercing damage, and if the target is Large or smaller, the cloaker attaches to it. If the cloaker has advantage against the target, the cloaker attaches to the target's head, and the target is blinded and unable to breathe while the cloaker is attached. While attached, the cloaker can make this attack only against the target and has advantage on the attack roll. The cloaker can detach itself by spending 5 feet of its movement. A creature, including the target, can take its action to detach the cloaker by succeeding on a DC 16 Strength check.

scarlet gale
vast bane
#

so the attack should apply a grant advantage flag, and the flag needs an evaluation

scarlet gale
#

Not sure how DAE would make actor.id as an option to compare it to

#

I would do an on use macro for this

#

see if the target has the desired effect, and if so add advantage

vast bane
#

me either, I think I'm just gonna do a normal advantage key and then sus it out manually

#

the only thing I'm worried about is cross attachments

scarlet gale
#

check the origin of the effect

vast bane
#

if cloaker A attacks while cloaker B is attached

scarlet gale
#
if (effect.origin.actor.id === this.actor.id) blah blah blah```
vast bane
#

and define effect with the find line?

scarlet gale
#
if (this.targets.size != 1) return;
let effect = chrisPremades.helpers.findEffect(this.targets.first().actor, 'Effect Name Here');
if (!effect) return;
let origin = await fromUuid(effect.origin);
if (!origin) return;
if (origin.actor?.id != this.actor.id) return;
this.advantage = true;
#

Run on pre attack roll

#

or whatever it's called

vast bane
#

I also need an activation condition for if the attack had advantage, I thought I had it but its not working. I thought just "workflow.advantage" but I think maybe there needs to be a capital letter or somethin

scarlet gale
#

I generally don't use activation conditions, couldn't help you there.

#

What do you need it for?

vast bane
#

they blind if they had advantage on the attack

scarlet gale
#

I'm reading this ability and don't see anything that looks like it checks for advantage

#

ah

vast bane
#

so it would be an activation true to apply the blinded, but I don't think it can be in the item

#

yeah it can be nm that

#

yeah it has 2 ae's

#

so can't use activation condition

#

one applies no matter what, the other requires the cloaker to have advantage to apply

#

my current solution is to have two identical attacks, one that applies attached, and one that applies blinded

scarlet gale
#

postActiveEffects:

if (this.hitTargets.size != 1 || !this.advantage) return;
await chrisPremades.helpers.addCondition(this.targets.first().actor, 'Blinded', false, this.item.uuid);```
vast bane
#

so the macro will be all for macropass right?

scarlet gale
#

oh uh

vast bane
#

or will need macropass lines for both of them

scarlet gale
#

I guess you'll need to do an all pass one

#

Then check the args pass

#

since I'm guessing you want these both on the same item macro

vast bane
#

I could keep the seperate attacks then it'd be as simple as just pasting your two

#

or I could make one an actor on use

scarlet gale
#
if (args[0].macroPass === 'postActiveEffects') {
    if (this.hitTargets.size != 1 || !this.advantage) return;
    await chrisPremades.helpers.addCondition(this.targets.first().actor, 'Blinded', false, this.item.uuid);
} else if (args[0].macroPass === 'preAttackRoll') {
    if (this.targets.size != 1) return;
    let effect = chrisPremades.helpers.findEffect(this.targets.first().actor, 'Effect Name Here');
    if (!effect) return;
    if (!effect.origin) return;
    let origin = await fromUuid(effect.origin);
    if (!origin) return;
    if (origin.actor?.id != this.actor.id) return;
    this.advantage = true;
}```
#

Untested

#

run as all passes

#

also double check the blinded condition

#

Might just be Blind

vast bane
#

mines blinded

scarlet gale
#

Then it should be good

#

added a check for no origin

#

very unlikely to happen but

#

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

#

May also need to check for the existence of disadvantage actually

#

Depends on how you want to rule having both

vast bane
#

oh when I regrabbed the macro forgot to change name

#

its not doing a dfreds CE blinded, is that ok for CPR?

scarlet gale
#

Uh

#

what?

#

It's literally using the CE API to add the condition lol

vast bane
#

the condition added is Blinded, not macro.ce

scarlet gale
#

well this was an automatic add the blind

#

I thought

#

If there is a save involved this gets much more complicated

#

Reading the ability, it looks like they're automatically blinded

#

So not having macro.ce won't matter

vast bane
#

its working perfectly, except that theres a strange effect going on, when it attacks and hits the second time to apply blinded, its removing the old attached and adding attached again, which is ok...cause its not looking bad at all, but why is it removing and adding a new one?

#

weird thing is I know I set that to name a second ago...

#

I guess when something doesn't stack, it removes and then refreshes the duration so it will do the minus and then plus on the new effect?

#

I've never really looked closely at this scenario

#

whenever I see an effect remove and add I just think Cub/dfreds are stepping on each other but I don't have that

#

Either way it works perfectly now

scarlet gale
#

Oh

#

Need to add a check to not readd blinded if it already exists

#

It's just preventing it from stacking

#

Away from PC but I can edit it when I'm back

scarlet gale
#

@vast bane

if (args[0].macroPass === 'postActiveEffects') {
    if (this.hitTargets.size != 1 || !this.advantage) return;
    let blindedEffect = chrisPremades.helpers.findEffect(this.targets.first().actor, 'Blinded');
    if (blindedEffect) return;
    await chrisPremades.helpers.addCondition(this.targets.first().actor, 'Blinded', false, this.item.uuid);
} else if (args[0].macroPass === 'preAttackRoll') {
    if (this.targets.size != 1) return;
    let effect = chrisPremades.helpers.findEffect(this.targets.first().actor, 'Effect Name Here');
    if (!effect) return;
    if (!effect.origin) return;
    let origin = await fromUuid(effect.origin);
    if (!origin) return;
    if (origin.actor?.id != this.actor.id) return;
    this.advantage = true;
}```
vast bane
#

btw you could totally add this since you wrote it lol, its the Cloaker's Bite

scarlet gale
#

I would do this slightly differently, but yea

vast bane
#

theres more fun things to automate in it if you care, the damage transfer, I have that setup as just grant advantage reminder and the cloaker has Damage resistance to all while attached

scarlet gale
#

Don't be surprised when it gets added.

vast bane
#

I'm using your mirror image spell in place of its phantasms

#

kinda wish stacking default drop down setting was name and not origin, what module is this or is it core?

scarlet gale
#

DAE I think

vast bane
# scarlet gale DAE I think

I just added Suffocating, and it would pair right up with blinded so...

if (args[0].macroPass === 'postActiveEffects') {
    if (this.hitTargets.size != 1 || !this.advantage) return;
    let blindedEffect = chrisPremades.helpers.findEffecT(this.targets.first().actor, 'Blinded');
    let suffocatingEffect = chrisPremades.helpers.findEffecT(this.targets.first().actor, 'Suffocating');
    if (blindedEffect) return;
    if (suffocatingEffect) return;
    await chrisPremades.helpers.addCondition(this.targets.first().actor, 'Blinded', false, this.item.uuid);
    await chrisPremades.helpers.addCondition(this.targets.first().actor, 'Suffocating', false, this.item.uuid);
} else if (args[0].macroPass === 'preAttackRoll') {
    if (this.targets.size != 1) return;
    let effect = chrisPremades.helpers.findEffect(this.targets.first().actor, 'Attached');
    if (!effect) return;
    if (!effect.origin) return;
    let origin = await fromUuid(effect.origin);
    if (!origin) return;
    if (origin.actor?.id != this.actor.id) return;
    this.advantage = true;
}

is this ok?

scarlet gale
#

sure

vast bane
#

does suffocating have to be a status marker or can it just exist in dfreds menu

scarlet gale
#

Anything that's in the CE menu

#

I only use it for conditions, hence the helper function name. But it can be anything you have as a CE.

#

My condition resistance actually would allow you use anything from the CE menu as well.

#

Like you could have advantage vs Suffocating

vast bane
#

oh thats cool

#

wait that'd open alot up holy shit

#

so I could use the same key as CR.poisoned but have it be say....suffocating instead

scarlet gale
#

yep

vast bane
#

so unusual nature and breathless could get your CR.suffocating keys

#

all the various features that say the creature does not breath

coarse mesa
#

Man I look away for a day and you guys are making all kinds of magic happen over here

umbral basin
#

These guys are good

scarlet gale
#

I'm actually a bit curious to see if anyone has interest in the automatic VAE description thing.

vast bane
scarlet gale
#

I feel like I force lowercase it

#

let me double check

vast bane
#

I feel like the blind vs blinded thing is literally a dfreds thing

scarlet gale
#

Nah

vast bane
#

I feel like the core condition is blind, and dfreds for some reason changes it to blinded right?

scarlet gale
#

Blinded is right

vast bane
#

I've seen blind somewhere and I can't remember what was making it

scarlet gale
#

At any rate, I lowercase the condition name

vast bane
#

maybe its a cub thing or a monks combat details thing

scarlet gale
#

So you would want blinded for example

vast bane
#

cloaker fights have been a blast so far, glad I could get that automated it was always the drag in combat

short aurora
#

Anyone know where Midi does its' range checking? Can I have a peek at what it's detecting in the workflow or args somewhere?

scarlet gale
#

It's behind the scenes, if you need to do your own range check you can call one of it's exported functions

short aurora
#

๐Ÿ‘ I spotted it I think, checkRange

scarlet gale
#

or if you're using my module: let distance = chrisPremades.helpers.getDistance(sourceToken, targetToken);

umbral basin
potent mason
#

im trying to get a magic item to apply a damage resistance active effect when an actor attunes to it using this: https://prnt.sc/V85DU8uvfKE- but it doesnt seem to work, what am I doing wrong?

Lightshot

Captured with Lightshot

scarlet gale
#

Wrong key

#

Use the system attributes key for damage resistance

vast bane
#

I should add the DR/dr issue to the pin

#

its probably common enough right?

scarlet gale
#

yep

umbral basin
#

Oh

#

Damage resistance

scarlet gale
#

The key you were using is damage reduction

vast bane
#

I just updated the pin with some nuanced changes

#

Attribution is in it now cause gad dang thats an annoying troubleshoot too

#

I have a link in it to an image explanation for attribution too if any of you helpers don't want to type it all out all over again

bold rockBOT
#
Community Dev/Creator Discord Servers

Foundry VTT's community is home to a number of awesome developers and creators, many of which have their own communities to offer support for their modules, systems, and content.

potent mason
# scarlet gale The key you were using is damage reduction

ah, that explains a lot, because i did notice i could reduce it by a flat value, i just didnt put that together. That means i could add flat damage reduction on some monsters to make some options not as effective without being as punishing as resistance. that makes me think, is there a key for the opposite case? like if i wanted to make a creature that took an extra 5 damage whenever it took fire damage, does that exist?

vast bane
#

use negative values in DR flags for adding damage

potent mason
#

oh cool, that makes sense, awesome, thanks to both of you for the help ๐Ÿ‘

queen raptor
#

Is there a way I could use an activation condition to make a player's weapon deal x amount of damage from the Other Formula field on a miss?

vast bane
#

macro territory for that

coarse mesa
wide crystal
scarlet gale
#

VAE module with me hovering over the effect

wide crystal
#

Sorry, what does VAE stand for? Google doesn't give any results.

scarlet gale
#

Visual Active Effects

wide crystal
#

Thank you.

deep harbor
#

yesterday, someone mentioned an alternative way to get tokens that ignores permissions, using midi. They said it was safe to target tokens that the player didn't own.
Seeking alternative to: canvas.tokens.get("SOME_ID")
Does anyone know which function they were reffering to?

scarlet gale
#

Like in an on use macro?

deep harbor
scarlet gale
#

Shouldn't be an issue getting the token

#

the only issue is making any edits to it

#

What are you trying to do?

deep harbor
#

Okay. Thanks.
I'm using warpgate mutators to make changes to it, and they're set to ignore strict permissions and to blindly accept in the config, so I should be good.

scarlet gale
#

Yea, was gonna say. Warpgate will sort out the permission problems for you.

#

Most of the time you shouldn't need to use the canvas.tokens for what it's worth

#

You can just get a target from the midi workflow

#
let targetToken = this.targets.first();```
#

For example

deep harbor
#

I'm converting my compendized races from using AEs, which I was informed can cause significant slowdowns as they increase in number, as well as locking the edited features, to using a reversible warp macro.

vast bane
#

I think race items are coming in dnd 2.2

#

I'd ask over in the parent channel of dnd5e here Zhell usually knows this stuff

scarlet gale
#

Pretty sure race items will just be another subset of features

vast bane
#

I'll ask for you

deep harbor
#

The feature will add a single AE, which will call the macro, and de-call it when it's removed, but have nothing else in it. I was told it'd be computationally faster.

vast bane
#

I thought it was gonna be like class features

scarlet gale
#

makes sense