#MidiQOL

1 messages · Page 92 of 1

quasi needle
#

ok, i have warpgate but only because another mod required it, i haven't looked at it yet. got a link for me to start with?

vast bane
#

I have macros for these 4

scarlet gale
#

Warpgate has some pretty extensive documentation, but that's only useful if you're familiar with javascript

vast bane
#

yeah but the warpgate wiki was so easy to read that even I was able to write some things

spice kraken
#

Does Arbon's not help with these?

vast bane
#

the problem I have with arbron is it only does like 1/3 of the work

scarlet gale
#

Arbon's is ok I guess

quasi needle
#

i'm not, i know just barely enough to tweak what someone else wronte. i'm on the project url right now hoping someone already made a tasha's spell, but no such luck

spice kraken
#

Ah, obv never tried it

vast bane
#

Arbron just does the warpgate part

#

it doesn't do sequencer or midi stuff

scarlet gale
#

The module also hasn't been updated in awhile

vast bane
violet meadow
#

fromUuidSync(tokenUuid).actor.system.details.race?.includes("Undead") || fromUuidSync(tokenUuid).actor.system.details.type?.value.includes("undead")

vast bane
violet meadow
#

yes

scarlet gale
#

Looks like it should

vast bane
#

@dense vessel you followin what he just shared?

spice kraken
vast bane
#

its mostly bugbears work

#

I love the pre item roll check

spice kraken
#

What does yours looks like when you cast it?

vast bane
#

it has a pink glow for the players color and it summons with a poof

spice kraken
#

You get options for the which summon?

vast bane
#

I do leave the dialog in there but thats mainly cause I dunno how to remove it

#

I don't really bother knitpicking the specifics but to be fair summon beast was the first one I made and never went back to it

spice kraken
#

This is what mine looks like

vast bane
#

Thats conjure animals not summon beast

spice kraken
#

goes to find phb

scarlet gale
#

Not in PHB lol

#

Tasha's

spice kraken
#

(╯°□°)╯︵ ┻━┻

vast bane
#

Tashas' cauldron of everything has special summons that I strongly feel are best dealt with in warpgate macros

spice kraken
#

My book is upstairs and I'm too lazy to get off the couch, haha

vast bane
#

conjure typically are like your example

#

Tashas summons are like the new stat block concept for summons

#

think of stuff like the drake warden and defender, only they scale off spell casts

scarlet gale
#

Tasha summons make the DM cry less

vast bane
#

yeah

#

Honestly my druid player and I talked before campaign to prevent the action economy slowdown of conjure spells

#

she never prepares those and just does her tashas

scarlet gale
#

My DM in a past game said I was only allowed to cheese conjure beasts once

vast bane
#

The one time she cast conjure woodland beings I used a homebrew dungeon of the mad mage trick where instead of summoning things from the feywild she summoned a fey creature she knew who was in waterdeep which was fun

#

Cause undermountain has adverse effects on magic that travels between realms

dense vessel
vast bane
#

try it out, make sure the first tab is transfer on equip

#

and if ts an attune item make sure they are attuned and wearing it

#

I think we're all also assuming you are on midi 35/dae 23 fwiw

#

dae 24 is fine if you dont' use hunters mark/bonus action smites/favored foe/hunters mark hex in your world.

#

I'm about to resurrect a week old post who got forgotten in the conversations...

#

Sorry nobody answered you but I'm currently troubleshooting Searing smite myself as well, fyi I'm pretty sure your issue is directly related to the sneak attack comment in the pin by me in this channel.

queen raptor
dense vessel
queen raptor
#

No, but tbf I haven't messed with it much or tested it since I asked the question

vast bane
#

the macro also has v9 shit that needs to be fixed I'll tweak it here shortly that could also be the problem

queen raptor
#

I gotcha

#

No rush from me, but will be happy to test whatever you come up with.

vast bane
#

mine seems to be working as is

#

I do think you might have the issue though with more than one damage macro

#

is your paladin also a rogue?

#

or does your paladin have hunters mark?

queen raptor
#

No, but they are a Warlock who also has Hexblade's Curse that was not sticking correctly.

#

And they do have Hunter's Mark as well

dark canopy
vast bane
#

yeah...

violet meadow
#

you can also go crazy in the flags and do something like ```js
lebomb(tokenUuid)
function lebomb(tokenUuid) {
const targetType = "gnome";
const attacker = fromUuidSync(tokenUuid).actor;
const {race,type}= attacker.system.details;
return ([race.toLocaleLowerCase(),type?.value].some(v=>v?.includes(targetType)))
}

spice kraken
vast bane
queen raptor
vast bane
#

are you on dae 24?

queen raptor
#

I am

vast bane
#

DAE 24 might be why your hex/hunters mark breaks

violet meadow
#

MidiQOL .35 is the issue

queen raptor
#

Also on Midi .35 👀

violet meadow
#

DAE .24 is responsible for onUpdateTarget/onUpdateSource

vast bane
#

yeah but we have to stay on 35 for the goodies in CPR

dark canopy
vast bane
#

So he can only stare longingly at Arbron's Summoning

#

(and Baboni)

queen raptor
#

So wrt the Searing Smite (and also Hexblade/Hunter Mark, apparently) issue, it's Midi or it's DAE that I would need to downgrade?

I would hate to lose CPR 🥺

vast bane
#

Yeet or keep data?
if (!["mwak","rwak"].includes(args[0].item.data.actionType)) return {};

violet meadow
#

system

violet meadow
vast bane
#

System also?
const spellLevel = actor.data.flags["midi-qol"].brandingSmite.level;

violet meadow
#

yeet

spice kraken
#

vast bane
#

By that logic, the original author of better rolls is also

#

yeah my paladin it seems to work perfectly fine so my only thought is that maybe canary's pally has other damagebonusmacro keys

#

of other items, I think I guessed right that he was the kind of pally who has hunters mark and stuff

vast bane
#

thats identical to my functional one

violet meadow
# queen raptor

Move it to the sidebar. Delete item from the actor. Move it back

#

Details tab, is it Transfer to actor on item equip?

vast bane
#

It shouldn't be, I feel like he might have another item that is, and uses the same key, thats throwing all of this off

queen raptor
#

It's not presently.

violet meadow
#

OK then you will need to do something else

#

Best bet, leave the Item on the sidebar

queen raptor
#

Paladin's current effects, if it matters

violet meadow
#

then open the AE

#

Drag and drop the item inside the Effect value

#

literally

#

Make it so in the end it looks like ItemMacro.Item.xxxxxxxxx when the xxxxxxx is the ID

queen raptor
#

Like so?

vast bane
#

I'm pretty certain you should probably downgrade to dae 23 when you are done getting help from bugbear on this

violet meadow
#

Nope delete the Searing Smite

#

ItemMacro.Item.Qbn...

vast bane
#

you were suppose to clear the effect value before you dragged

queen raptor
#

Ah

vast bane
#

oh not the whole thing sorry

#

just the second half

queen raptor
vast bane
#

Generally speaking if your games utilize Hunters mark, favored foe, bonus action smites, hex, and possibly also hexblades curse, you should be running DAE 23 not 24 as theres a breakage in the key most automations use for some if not all the items.

#

I know theres one bonus action smite that uses one of the keys I think

#

dae is different than midi, he stows the package inside a problematic folder "DIST" inside the zip so beware

#

So if you are used to doing this with midi, its going to be slightly different because he for some reason does not use the DAE folder to hold them in the zip

queen raptor
#

Hum, maybe that's why Forge tried to install 30 modules when I tried to do a tweak to DAE for SW5E and import it myself...

#

Using .23 and having the item macro reference the sidebar item doesn't appear to have meaningfully changed things

#

She still gets the bonus damage, but then immediately loses concentration as the giant starts to burn

#

Oh

#

She loses concentration, but the target does still have the Searing Smite overtime effect

#

Hum

vast bane
queen raptor
#

It just wasn't displayed

vast bane
queen raptor
#

Thing is, I'm not sure if that's working as intended or not?

vast bane
#

I wonder if all the smites make this mistake

queen raptor
#

Trying to see if Hexblade's Curse is working now

#

At the very least, it's not disappearing immediately

#

But hard to proc a 19 crit unless there's a secret way to fudge rolls that I don't know about

soft ravine
#

@vast bane and everyone anyone else with input, (I'm still reading) but wanted to pop up a message saying THANK YOU

scarlet gale
lean holly
#

MidiQoL with automation and flanking rules is having Spiritual Weapon actor roll with advantage. Creature type is set to NoTarget and disposition is set to neutral. Ideas?

lean holly
#

Nope,

vast bane
#

this is...another...attribution issue...

#

once you have it on, make the attack and expand to seee what the weapon has for flags

lean holly
#

ADV:Flanking

vast bane
#

show me your character sheet for spiritual weapon

lean holly
vast bane
lean holly
vast bane
#

I'm at a loss here then, mine doesn't, what is your flanking set to

#

and what version of dfreds CE/midiqol

lean holly
#

dfreds: 4.1.2
midi: 10.0.35

vast bane
#

I'm trying to fix my spiritual weapon cause I apparently hit the CPR button for it and it killed my old version

#

yeah it is getting flanking

#

I don't ever remember seeing this before

#

it also gets it with dfreds setting too

#

I think I know how to janky it

lean holly
#

I thought setting it as NoTarget meant midi wouldnt interpret it as a creature so things wouldnt effect it

vast bane
#

badgers not gonna like this

violet meadow
#

AoE won't affect it

#

Other things will

#

like direct attacks

#

It is an Actor after all

vast bane
#

Yep get ready for this amazing hack

#

Nobody show honeybadger this

violet meadow
#

I don't remember if there is a flag for no flanking

#

Might

vast bane
#

change the sidebar actors prototype token to neutral or hostile

lean holly
#

I did that

#

Sidebar is Neutral

#

And on map is too

vast bane
#

then the opponent causing flanking is also neutral

lean holly
#

Still gets flanking

vast bane
#

the otherside is also neutral then

#

flanking only works if same disposition is involved

lean holly
#

Other side is friendly

vast bane
#

move them

#

you are still acting with the original key on you

#

you need to change the state by moving them

#

and retargetting

violet meadow
#

Actor onUse preAttackRoll ```js
this.flankingAdvantage = false;

#

try this

vast bane
#

I get no flag:

#

this trick should work for you, my only guess is you aren't recasting the spell/recreating the scenario from scratch and are still stuck on the old flag.

#

when you summon things with warpgate, the disposition isn't changed if you don't tell it to in the warpgate macro

#

even though its green, its still technically yellow for most things

#

so this should prevent flanking, or you can make an actor on use for it like bugbear said

violet meadow
#

You could use DFreds flanking, make it a statusEffect and add a condition immunity on the Spiritual Weapon Actor for flanking 😄

vast bane
#

I think a transfer on equip spiritual weapon attack ae with macroOnUse key for your one liner would work too

#

but 99% of the time there is NO yellow border in combat

#

theres no neutrality in war

#

so making it yellow/neutral should prevent flanking

#

but if you change it without moving them and retargetting it will keep the original flanking flag on falsely showing no change

#

this is exploiting a glitch with disposition to solve another glitch, my favorite kind of janky

lean holly
#

I can drop a fresh not summoned spiritual weapon actor to the map, disposision of neutral, attack using the spiritual weapons attack and still get advantage even though the "flanking" actor is Friendly.

soft ravine
#

i understand this, but barely FANTASTIC

vast bane
#

does your spiritual weapon have the flanking on them already?

#

drag a new one, turn off require targets, and make an attack

soft ravine
#

i was not sure if that was possible but that would be preferd!

vast bane
#

do you see the flag for advantage on them?

vast bane
#

take the macro he shared and make it an ItemMacro, on use, after active effects on your Harvest Cantrip

#

paste the macro into the item macro button on the top bar of the Harvest cantrip

lean holly
vast bane
#

cause you have no warpgate enabled, drag him out manually

#

are you 1000% sure that the other guy is friendly?

#

I just showcased that player colors are not always friendly fyi

lean holly
vast bane
#

I'm gonna say modules are involved cause I can't reproduce in my world

#

foundry 291
dnd5e 2.1.5
midi 35
dae 24
dfreds 4.1.2

#

not using dfreds for flanking but dfreds flanking also fails with my trick

soft ravine
vast bane
#

Congrats to our sw5e brethren:

Dfreds CE

lean holly
#

Foundry: 10.291
Dfreds: 4.1.2
DAE: 10.0.24
Midi: 10.0.35
socketlib: 1.0.12
libwrapper: 1.12.12.0
only these modules, all others disabled. Spiritual weapon token set as Hostile. Manually drag to map, attack "flanked" target, rolls with advantage lol

#

Im cursed

vast bane
#

I'm definitely not installing the broken dae 24 to test, your welcome to downgrade to dae 23 though to see

#

dae 24 is broken for other reasons

vast bane
lean holly
#

exported

vast bane
lean holly
#

Advantage is flagged.

#

Im cursed

spice kraken
lean holly
#

Ill downgrade DAE tomorrow and report back lol.

vast bane
#

@carmine condor you likely are misreading the swarms statblock or whomever made the rat swarm, misread the statblock

#

swarms have a really weird resistance that many misread

#

swarms are resistant to all weapon damage, not just non magical, so someone probably plopped nomagicall on it

#

this is how it should resist

#

my guess is your swarm creature has the magical popped at the bottom also

carmine condor
#

ok let me check.. i could have sworn i made it like above before i started troubleshooting

vast bane
#

if it is like this and not working...read the first pin here and go down The list

#

hard for midi to handle damage when another roller is doing the rolling

lean holly
#

Okay, I have more to report.
It is ONLY getting advantage is there are 2 "Friendly" actors in range of the target. One of them has to be in flanking position. The other just has to be within melee range of the target. If I have only have the 1 "Flanking" actor then Spiritual Weapon does NOT get advantage. Only when another "Friendly" actor is within melee range of the target.

lean holly
#

No, this is all still bare min modules no summons.

vast bane
#

reproduceable you are not crazy

lean holly
#

I'm glad its not just me.

#

LOL

vast bane
#

I think we need to consult the smarter folks here, but what IS the rule that midi is using for its own flanking?

#

there is a rule where 3 or more enemies around a target means they are flanked

#

imo neutral should be ignored

#

thumbing through my dmg now standby

#

its definitely not in the most traditional flanking rule

#

its even more broken with CE flanking:

lean holly
#

Thanks for going through it with me, im going to bed. Ill submit a github issue in the AM unless youve done one.

soft ravine
vast bane
#

cause they are copyright

soft ravine
#

right

carmine condor
vast bane
soft ravine
vast bane
#

do you not have item macro installed?

#

its a module

soft ravine
vast bane
#

once you install Item Macro Module, go to its settings in configure settings in the sidebar, and turn off character sheet hooks

#

Honebadger is the author of Item Macro? 0_o

#

TIL

soft ravine
vast bane
#

at the top of Harvest theres a like document lookin thing with "ItemMacro" to the right of it, click that

#

paste the macro in

#

hit save and try it out

#

the link to the macro is in the thread link I just typed

#
const otherItem = actor.items.getName("Soul Essence");
const {value, max} = otherItem.getRollData().item.uses;
const total = args[0].damageList[0].appliedDamage;
await otherItem.update({"system.uses": {value: Math.min(max, value + total)}});

@violet meadow It works, but it throws these warnings

#

OH

#

wow what a funny problem

#

this is actually kinda hilarious

violet meadow
#

What is the Willing Target?!

vast bane
#

Night is a new user and managed to put an activation condition in that is wrong lol

#

this is actually funny:

soft ravine
violet meadow
#

Is it an activation condition -- yeah

vast bane
#

its picking up a keyword

vast bane
#

the problem with dae's zip is he put a bad folder immediately inside containing everything

#

you are meant to navigate the zip, copy allt he contents of DIST, and paste them into the DAE folder, BUT, remember what I just told you in a DM, you have two DAE's one of them is bogus(DAE SRD) don't confuse the folders

soft ravine
#

dist folder.. idk what its there for but its gone now lol

vast bane
#

@soft ravine Remove the words from the activation condition of Harvest, midi uses a special feature on that field and you are using a naughty word that is fooling it, just clear it

#

put that in the flavor field or something

vast bane
#

I'm gonna put a github post for him to fix the zips going forward

soft ravine
vast bane
#

Is harvest meant to only be used on allies?

#

you could just manage this manually but you'd need a killswitch macro added to the macro to stop it from doing anything if they target an unwilling creature

#

If disposition not the same return or something at the start

#

I dunno what it would really be so don't copy what I just wrote lol

soft ravine
#

ITS WORKING (mooohahahahahaaa!!!)

soft ravine
#

big plans big plans

#

i will be back most likely soon when i get stuck again, but its always best to try first, the information @vast bane provided me with today was super helpful across the field with many examples to help me figure out what i need to do 🙂 - gotta check out that wiki too. Tnx again @vast bane, Thank you VERY much @violet meadow , and everyone else, love this community ❤️

vast bane
#

@atomic badge what do you want to replace it with?

#

and why

atomic badge
#

Well simply put I wanted to make a custom condition as a replacement to the Unconscious condition.

I run with a homebrew ruling where they essentially hit "Death's Door" instead of just straight unconscious, generally I prefer not having CC that completely neuters a player's ability to act.

vast bane
#

tposney has this new vitality homebrew in optional rules is that something you'd use?

atomic badge
#

Mm, I'm not familiar with it, care to expand on that?

vast bane
#

I dunno what its from, its not in the dmg

#

he never really elaborated on what it is other than its an alternative to death saves

atomic badge
#

Yeah not quite, the mechanics I'll be running works as following:
Upon hitting 0 hit points, you enter the "Death's Door" state, in this state, you are afflicted with the "Prone" condition.

You may move and act as normal (halved movement because of prone, disadvantage on attacks, yadda, yadda, you know what that condition does to you), attacks within 5ft of you auto crits.
If you were to be put to above 0 hit points by a healing spell, you gain 1 level of exhaustion, every other method of healing does not apply this exhaustion.

You roll death saves as normal each turn.
If you were to be stabilized you do not have to roll death saves and any previous death save rolls are reset, but you're still afflicted by the "Death's Door" condition as normal.

#

Simply put, giving the players more agency in how they act even at the worst of times.

#

I've been similarly changing most "stun" based conditions to fit this ideology of letting players always have some modicum of control, with only two of these having actual full shutdown of control for the players.

Normally stuns are fine in most games, but I find that they do not serve a good purpose in most TTRPGs because a stun can make things take several minutes to get back to an actually playable turn.

vast bane
#

turn off all your auto defeated settings and handle it manually, CUB might be able to pulll this off in some way too

atomic badge
#

Gotcha, I'll just look for that rq then in all of the various settings.

vast bane
#

if you run cub alongside dfreds beware of conflicts if both are managing ae's

#

is it only the players who will have this 0 hp rule?

atomic badge
#

Any non-allied creature will not have the rule applied to them.

vast bane
#

you could put a passive overtime on the players that only works when they are at 0 hp that applies prone and death's door condition on them

atomic badge
#

Unless explicitly stated as a part of their features.

#

Ah that's fair, that would be a workaround to it yeah.

#

Also when you mentioned CUB, I assume you are speaking of its Triggler functions?

vast bane
#

you could also do basic auto dead, and then add an effect macro on toggle on that undeads a player disposition or player owned token and applies death's door instead

atomic badge
#

Hmm... That'd work. Well that did it alright, much appreciated, thanks!

vast bane
#

@violet meadow what would the macro be like for macro.createItem to make the item attached be equipped AND attuned on drop?

scarlet gale
#

Would just be an item update to set attunement and equip status

vast bane
scarlet gale
#

Same way as always, right click on the thingy in the title bar and fromUuidSync it

vast bane
#
await args[0].item.update({'system.equipped':false, {"something else": {value: probably 2}});
scarlet gale
#

Won't be this

scarlet gale
#

Check the midi update notes for the args it gives you

#

Or dae

#

Don't remember what module does it

#

Like like it's in the last args according to the update notes

#

When I'm home I can get you something you can copy and paste a billion times

vast bane
#

I thought possibly tposney's shillelagh would have something, you are onto something

scarlet gale
#

Won't be for a few hours

vast bane
#

const lastArg = args[args.length - 1];

scarlet gale
#

Yea, dig around in there

vast bane
scarlet gale
#

Look for item or item uuid

#

Or something along those lines

vast bane
#

macro.createItemMacroUse or whatever will run the macro in the item macro

scarlet gale
#

Oh interesting

vast bane
#

I'm gonna find it in the midi patch notes, not sure if it runs the item macro on the base item or the created item

#

then again...

#

I could just do effect macro

#

like I been doin

scarlet gale
#

Looks like it runs on create as the macro pass

#

args[0].item should be the item

vast bane
#

effect macro wouldn't work cause then it wouldn't be easly copy/paste since I'd have to change the getName on them all

#

isn't args[0] the same as this?

scarlet gale
#

No

#

This is the workflow

#

It likely won't have one

#

Console log this and see if it has anything

#

That would make this much easier

vast bane
#

as an on use macro right on the item

scarlet gale
#

During the macro pass on create

#

You'll need to put this macro on the created item and have midi run it

#

If it has a passive effect you can likely just use a on create macro from effect macros lol

vast bane
#

what if the created item has a macro of its own?

scarlet gale
#

Then just update the origin

#

That's the you check the macro pass

#

You'll need to tweak your existing macro on the item

vast bane
#

oh theres an actual macropass for on create now?

scarlet gale
#

Yep

vast bane
#

I actualy already have an effect macro

#

the problem is it'd need to change for every item cause I find the item via getName

scarlet gale
#

Update the origin

#

That will be the item

vast bane
#

nah the effect macro is actually on the createitem key on the beginning item

scarlet gale
#

origin.update

vast bane
#

it finds the newly made item and updates it

#

but I only know how to find the item with the getName line

#

which means it wouldn't be a perfect copy/pasteable

scarlet gale
#

Passive effect on the item could do the same

#

Without doing an item find

vast bane
#

yeah but that also wouldn't be perfect

scarlet gale
#

It should

vast bane
#

what a bummer I was hoping the macro.createitemmacro thing would launch the macro ON the beginning item not the created item

scarlet gale
#

Origin should always be the item of the passive effect

#

Nah

vast bane
#

I would have to put an effect on every new macro.createitem

scarlet gale
#

Effect macros for that

#

Have it read the effect keys

#

This is super janky

#

Warpgate easier at this point

vast bane
#

I really think that Macro.createitemRunMacro is meant to run a macro on the first item, that then applies to the newly created item

scarlet gale
#

Yea

#

The on create pass on that item

vast bane
#
await args[0].item.update({'system.equipped':true});
#

I just don't know what the attuneable value thing would be cause I still haven't figured out how to get the details of an item, I could ask in #macro-polo honestly, most of this isn't midi

#

I'm prettty certain equipped is right

#

nah you were right, its looking for the newly created items macro

#

such a bummer

#

no clean copy/paste

#

if I have to do complext shit anyway, might as well just do it in the premade unidentified items effect macro and just copy/paste the getName

#
let i = 0
while (!token.actor.items.getName("Adamantine Breastplate") && i < 3000) {
    console.log("Waiting for new item to be created, if needed!")
    await warpgate.wait(250)
    i += 250
}

const item = token.actor.items.getName("Adamantine Breastplate")
item.update({'system.equipped':true});
console.log(origin);
origin.delete();

my effect macro method, not perfect, I still have to copy/paste the item names on each new instance.

#

however, I still don't know how to set attunement

#

I'll ask if one of the macro polo guys can point me at the item data

vast bane
#

pasted my most functional version just above. The problems that remain is that first off the origin.delete no longer works and secondly I still don't know how to attune an item in the update. However its kinda more complicated than just setting attunement. It needs to be an IF statement, IF item has "requires attunement" then attune, otherwise if not, ignore updating it.

#

somehow origin.delete stopped working but I think its patches/updates that caused that to break

#

my guess is something changed with Effect Macro

scarlet gale
#

Nothing changed with effect macro

#

But you may have an effect with an origin that's not an item

vast bane
#

Yep, I dunno how to fix it

#

its a dfreds drag

#

thats what broke it

#

only dfreds ce auto populates test

#

I think this is actually a dae glitch

#

it blinks the item as if its deleted but its never deleted

#

Item Delete Check even says its been deleted, yet there it is

#

can I make it delete after X seconds?

short aurora
#
await wait(1000)```
#

1000 being in ms

vast bane
#

yeah I'm trying to test with just effect macro, I think its a dae bug

old pendant
#

hey there, i would like to have a token deal damage and then inflict the same damage on itself depending on the roll. how would one do that in script?

short aurora
#

So deal damage to itself based on the roll or actual how much damage dealt?

#

(in case of resistances etc.)

old pendant
#

based on the roll

vast bane
#

with all 68 modules enabled it failes to delete with just this

if(origin instanceof Item) origin.delete();

just effect macro it deletes, this is gonna be a fun find the culprit

short aurora
#

(I don't think Moto meant to reply to you there, Hentik)

vast bane
#

sorry

old pendant
#

haha i thought so 😄 no worries

short aurora
#

Does the attack need to hit @old pendant ?

old pendant
#

yes

#

sorry for not giving more information beforehand i dont know what you need to take into account @short aurora

short aurora
#
if (args[0].hitTargets.length > 0){
    args[0].actor.applyDamage(args[0].damageTotal);    
}```
No problem, it was just something I thought of while testing. Here's a first try, do you know how to set things up?
old pendant
#

i do, i think but if not i'll let you know, thank you so much 😄

vast bane
#

yeah its a direct conflict with DAE 23, gonna rollback dae's till I find the version that broke effect macro compatiblity

old pendant
#

works perfectly

#

thank you so much, i didnt think it was this simple 😮

short aurora
#

😄 Fair warning is that macro accounts for the entire total damage of that attack, so if you have something that compounds damage and it was just supposed to be like a shortsword's own 1d6 that gets applied, that gets a bit trickier

old pendant
#

oh no its seperate feature for the character to inflict damage upon himself and deal that damage additionally, it works perfectly for this exactly what i needed

vast bane
#

what would be the evuivalent command as origin.delete in DAE via item macro?

#

So DAE 14 and Effect macro 14 accept origin.delete commands, but something about the mass update to dnd5e 2.1.x killed their compatibility

scarlet gale
#

What are you trying to do?

molten solar
vast bane
molten solar
#

The effect's origin should be a uuid and origin in EM should be what that uuid points at.

vast bane
#

the origin is proper

#

and I'm testing with core toggling of suspended effects now and its still breaking

scarlet gale
#

Screenshot the effect on the actor

vast bane
scarlet gale
#

And that unidentified item is an item?

vast bane
#

I don't even have the macro create stuff going on

#

I'm just testing the effect macro, the item is a basic item, you equip it and you get the ae

scarlet gale
#

It's also inactive

vast bane
#

however, it just worked after taking out the attunement requirement

scarlet gale
#

So the macro may not run

vast bane
#

I think my mistake is doing toggle on

#

unavailble to active seemingly is not working right

#

once I go from inactive to active effect macro works

#

all I have on is dae, socketlib, libwrapper, and effect macro

#

I think my mistake here is I picked the wrong hook in EM

scarlet gale
#

Trying to remember if inactive effects run effect deletion macros

vast bane
#

I don't think toggle on is what happens when unavailable to active happens

scarlet gale
#

You're trying to have the unidentified item get deleted when the effect becomes active right?

vast bane
#

man this is so frikkin weird

#

if I look at the actrs effect tab before I toggle the attune, it works

#

if I don't it doesn't

#

when I have all modules on, Item Delete Check says the item has been deleted but it blinks out and back in, and item delete check doesn't say a new item appears

#

no console errors

#

and the ending state is the item blinks out, it comes back, and the new form of it the ae is not on the actor at all and I would have to hit the hand button to reapply it

scarlet gale
#

That's weird

#

Restart foundry and try again?

vast bane
#

its going from unavailable to active that glitches, so it specifically can't work with unidentified items

#

which is weird cause that exact problem was fixed in DAE

#

just drag the item to an actor, equip and attune and the glitch happens

#

its suppose to delete itself when it attunes

#

if you change it to just suspended and remove requires attuned, then it works

#

I don't think you can do on creation for these cause likeits created "unavailable" right?

#

it has to be on toggle on?

scarlet gale
#

No idea what you are talking about

vast bane
#

I'm using On Effect Toggle On for EM trigger

scarlet gale
#

Put a console log in and see if the macro runs

vast bane
#

cause I assume on creation won't work as then it will fire as soon as it shows up on the actor

scarlet gale
#

Yep

vast bane
#

console.log(origin)?

scarlet gale
#

Just anything

#

See if it actually shows up

vast bane
#

Something shows up:

scarlet gale
#

Then it should be working

vast bane
#

it does everything but the effect macro origin.delete

violet meadow
#

Oh that is a long... conversation!

vast bane
#

though I stil think it does, its just something else is happening

vast bane
#

its suppose to delete itself on attune

scarlet gale
#

Show me your macro

violet meadow
#

Trying to set attune and equipped after creation?

vast bane
#
console.log(origin)
if(origin instanceof Item) origin.delete();
scarlet gale
#

Item5e isn't it?

vast bane
violet meadow
#

origin would be a uuid no?

#

Do first fromUuidSync

scarlet gale
#

Effect macros resolves it

vast bane
violet meadow
#

Is it via EM?

vast bane
#

it works fine when dae is disabled

scarlet gale
#

It's already the fromUuid thing

vast bane
#

it also works fine if you toggle inactive to active with both enabled but you can't do that with attune

#

something about the event for going from unavailable to active is causing dae to interfer with em

#

and I just ran my v10 2.0.3 build with it, and DAE 14 and EM 14 are fine together this works in them

scarlet gale
#

The console log showed up so...

vast bane
#

yeah its the item

#

everything is fine except that the item deletes and comes back lol

#

when it comes back its like a phantom item too

scarlet gale
#

At my PC soon to actually look at it

#

That sounds like your setup

vast bane
#

it says the item goes away, but Item Delete Check would tell me if it comes back

#

After the glitch its a weird missing ae version

#

my guess is something in the 9 versions between dae 14 and 23 gets in the way

violet meadow
#

Will boot up Foundry in a bit and try it

#

It's already included in the item?

vast bane
#

and its not even the dae key doing this, I took out the key, and it still flopped

#

yeah the item is good to test as is

#

its suppose to delete its origin when its attuned or technically when it toggles on

violet meadow
#

And what happens when the deletion is taking place?

vast bane
# violet meadow Will boot up Foundry in a bit and try it

before you go nuts with the origin.delete, I was very close to having the equip/attune macro done here it is:

let i = 0
while (!token.actor.items.getName("Adamantine Breastplate") && i < 3000) {
    console.log("Waiting for new item to be created, if needed!")
    await warpgate.wait(250)
    i += 250
}

const item = token.actor.items.getName("Adamantine Breastplate")
item.update({'system.equipped':true});
console.log(origin);
origin.delete();
vast bane
#

I just couldn't figure out what the attune step would be. I know it needs to check if requires attunement exists and then change to attune, otherwise do nothing, but I dunno what the attune property looks like on the item

#

the equip definitely works there

scarlet gale
#

Just tested it myself

#

works fine

#

Only thing I can think of is that your compendium item is the same one you're deleting

vast bane
#

there is no compendium

scarlet gale
#

So you're just giving yourself back the same item

#

you have a create item key in the effect

vast bane
#

now you got me worried lol

scarlet gale
#

Compendium.dnd5e.items.DevmObXWP9MfwE2c, permanent

#

Looks like a compendium item to me

vast bane
scarlet gale
#

the effect

#

is creating an item

vast bane
scarlet gale
#

that a SRD item?

vast bane
#

put your own item in there

#

yes it is

#

oh shit maybe its the permenant flag

violet meadow
#

So you are deleting the origin of the new item 🤔

#

I am lost I need to be at my PC

scarlet gale
#

The origin of the effect is the unidentified item

#

On my setup Moto, it deletes without issue

#

and creates the new item

vast bane
scarlet gale
#

Something on your end is messed up

vast bane
scarlet gale
vast bane
#

, permanent

#

add this to the end

#

you also aren't doing a compendium one but I'll test your way

scarlet gale
#

added that, still worked

vast bane
#

try the compendium srd item

#

I just replicated your setup and its still happening I give up

scarlet gale
#

still worked

vast bane
#

forget origin delete I'll just delete them manually, I'd appreciate someone figuring out the check for attunement and attune in my above macro

scarlet gale
short aurora
# vast bane before you go nuts with the origin.delete, I was very close to having the equip/...
let i = 0
while (!token.actor.items.getName("Adamantine Breastplate") && i < 3000) {
    console.log("Waiting for new item to be created, if needed!")
    await warpgate.wait(250)
    i += 250
}

const item = token.actor.items.getName("Adamantine Breastplate")
item.update({'system.equipped':true});

if (item.system.attunement == 1){
  item.update({'system.attunement': 2});
};

console.log(origin);
origin.delete();```
#

wrong message to @ at but reckon that should do the trick

#

item's attunement is apparently 0 for don't need, 1 requires attunement, 2 for attuned

vast bane
#

for future refernce how do you get item details out of the log, I know how to do actors

#

out of the console I mean

scarlet gale
#

fromUuidSync(itemUuid)

#

like I said a billion years ago

old pendant
#

i need another help with a macro:
Foundry VTT Version 10
It should let you choose how many hit die you want to spend (x) and add it to xd10 healing that prevents damage received on a target. (if possible not overheal the damage received)
It is accessed via the magic item section of midi qol which for some reason doesnt recognize the parent's hit dice automatically. (i tried doing it the inbuilt way with just spending 1 hitdice on use and healing 1d10 but when i attach it to magic item - Feature and run it over the magic item, the consumption gets lost after i reopen the feature (it seems to recognize that the parent, the item, doesnt have any hit die.))
is there a way to solve this?

vast bane
#

I didn't get what you were saying lol

short aurora
#

You basically use one of the get or from, for this case I used game.items.getName("name") but that was a sidebar item, for compendium stuff fromUuid is the way to go

#

... what's the diff between fromUuidSync and fromUuid actually?

scarlet gale
#

no need to await it

#

BUT

vast bane
scarlet gale
#

it can't get items from a compendium

short aurora
#

W O R T H L E S S

#

nah ok, thanks

scarlet gale
#

for what it's worth

#

you can just type fromUuidSync in console

#

and when it shows the function

#

you can click on it and it'll open up the file

short aurora
#

fair point, my fingers were already in discord

#

weird sentence

scarlet gale
#

where you can read the comments

#

Click by the orange F thing

#

and it'll open up this:

vast bane
short aurora
vast bane
#

hitdice are the one thing midi has no clue is rolling

short aurora
#

Like... Is it interception? You see someone get hit near you, you reduce that damage? Is it temp hp?

old pendant
#

It should be interception but it can just be healing afterwards that doesnt really matter (i can always just a djust damage manually) the main request would be:
Let the player choose how many hit die he wants to be consumed and change the healing number by xd10.

short aurora
#

Right, hold on a second, just gonna see if I can cheat off of either bugbear or chris' papers for this test

scarlet gale
#

Can likely steal from my wither and bloom

#

I do a bunch of complicated steps to let you pick your hit dice from any class you have

short aurora
#

A bunch? Can't you just iterate over the classes? This is an example I stole from Zhell;

const options = classes.reduce((acc, e) => acc += `<option value="${e.id}">${e.data.name} (1${e.data.data.hitDice} -- ${e.data.data.levels - e.data.data.hitDiceUsed}/${e.data.data.levels})</option>`, ``);
const content = `
    <p>Select a hit die type:</p>
    <p><select name="select" style="width: 100%">${options}</select></p>
    `;```
short aurora
scarlet gale
#

Zhell would know how to do it better than me

old pendant
short aurora
scarlet gale
#

That code is using v9 stuff too btw

short aurora
#

@old pendant could they actually multiclass? I'll be honest, it's mostly the dialog/GUI that's going to take time on this one lol

#

yeah it's an example from '22, just didn't want to redo thinking for iterating for classes

old pendant
#

it uses multiclass die yes but it should be transfered to a d10 if possible, really i dont want you guys to bother too much with it i can just have him roll the same feature over and over so it heals/ spends accordingly.

short aurora
#

It's fine, no worries, I'll get back to you when I stop procrastinating doing html

vast bane
#

if they are MC'ed to same hitdice size...

short aurora
#

It's the number of d10 that's determined by the number of hit dice

vast bane
#

is this homebrew?

short aurora
#

gonna go with presumably yes

vast bane
#

then just change it to be easier to make ;p

#

hit dice features scream oneshots to me lol

old pendant
short aurora
#

The only time consuming part of this is the dialog for presenting the choice, a feature that heals based on a variable input by the user isn't hard to macro

#

roger

vast bane
#

if theres only one class involved just roll XdX and use core application

#

if its not automated perfect then why automate it when a manual dicetray roll can accomplish the same thing

short aurora
#

because before perfection comes imperfection

vast bane
#

I prefer the sweet spot of janky

old pendant
#

haha 😄 its fine as is, we can just have him roll the feature multiple times and it'll be fine, thank you guys i really appreciate the help.

vast bane
short aurora
old pendant
vast bane
#

@scarlet gale it only doesn't work on npcs, I just tested on pc's for the first time the whole night and its working lol

violet meadow
#

Linked or unlinked?

vast bane
#

unlinked

#

god I'm so glad I'm not crazy this makes sense now

violet meadow
#

I am having some issues with unlinked tokens too, but not sure if DAE is the culprit 🤔

vast bane
#

when I tested on the 2.0.3 build I had no landing page so I used a starter hero

violet meadow
#

Ah OK so you didn't check if the same issue is happening in the 2.0.3 build with an unlinked one

vast bane
#

right

#

i only started going backwards in versions cause i knew this worked before

#

but in order to test that far back I had to pull out my second instance of 2.0.3/midi 23/dae 14

#

but that instance was packed for storage so I had no usual landing page so I created a scene and dragged out a starter hero and didn't think any differently

odd sable
#

Is there a way to set up a Template ability to only target allies or enemies, rather than everyone under the template?

vast bane
#

its probably fue to the way inventory is on npc sheets?

#

with krigs macro, on an actual linked actor, it works perfectly

#

the second I try a zombie it gets the zombie item pun intended

vast bane
short aurora
#

Macro yes, can probably just filter either allies or enemies away from the workflow after template placement

vast bane
#

are you trying to do subtle spell or the evocation wizard thing?

#

cause midi has special flags for that(though I prefer a macro bugbear gave me over them)

#

actually I think it was fotoply

odd sable
#

Yeah I know about the careful spell options, but I wanted this one to not even target allies (or enemies, depending on the spell)

vast bane
#
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))

Maybe this willget the juices flowin for ideas on how to make it

#

this macro I have makes it so the actor can never target allies with their evocation spells, you could remove the evo check and set it as an item macro for that specific spell

#

remove the first line entirely, and set it as an on use macro with a pass of only called once a template is placed?

#

that would be how you never target allies, then for the only target allies remove the ! in line 2

#

don't use my image above for the item on use field as its a bad advice, thats an actor on use setup

#

item would probably be ItemMacro, but if your spells have other on use macros you'd have to append and use macro pass I think

violet meadow
#

Yeah that's a sculpt spell alright 😄

vast bane
#

my evocation player hates the way midi does the flag so I do this instead lol

#

hes usually drunk half the time when he plays and messes it up so this way he can't mess up

violet meadow
#

Yeah I remember the conversation

vast bane
#

his new fat finger move is right clicking the status marker to the right of the one hes trying to use

violet meadow
#

Should get MidiQOL to auto target

vast bane
#

speak of the devil

vast bane
molten solar
violet meadow
#

Moto are these enough ?
await MidiMacros.light(args, {dim: 40, bright: 20, alpha: "0.25", color: "#ffffff", type:"pulse",speed:3,intensity:1 })

vast bane
violet meadow
#

If color is not predefined a color pick will pop up

molten solar
vast bane
#

I didn't test a player cause well, I'm dumb

#

so its either the npc sheets inventory or something or just unlinked actors are weird

molten solar
#

Shrug. dae probably never caught up with the 2.1.0 changes to AEs

#

I made a PR to make unavailable effects work right on unlinked actors

vast bane
#

when I tested my old 2.0.3 build I had no landing page so I made a scene and used a starter hero, and they are not npcs or unlinked and I never connected the dots there

#

npc's are never going to attune to unidentified items, so as far as I'm concerned, everything is fine

#

if my players torture the familiar to attune to all their mystery items they deserve a black hole opening lol

#

unavailable to active is a toggle on though cause I did see the console.log output, its just a weird glitch where the item reappears in inventory after EM does its job

molten solar
#

Well that's all on DAE. No bug on my end, good to know!

vast bane
# molten solar Well that's all on DAE. No bug on my end, good to know!

you can replicate it with no dae key, like a blank ae, on an item in the sidebar that is transfer on equip with the effect macro. it doesn't happen when just EM is enabled so yeah, it must be DAE or I dunno, its a bug with a combination that should never get used so we could just let it go lol

violet meadow
#

Moto I cannot see what you are seeing.

#

Unlinked token.
Gets the imported item

vast bane
#

my server is rebootin atm I'll give you admin when it comes up

violet meadow
#

Attunes and equip. Old Item is getting deleted. New item created

#

What is the issue again? 🤔

vast bane
#

the item deletes and then reappears in the npcs inventory but only if its an unlinked actor

#

unlinked npc sheet

#

drag out the srd zombie, take the item import above, drag it from sidebar to the sheet, then edit the item, check equipped, identified, and attuned and then it should happen

violet meadow
vast bane
# violet meadow

my server restarts and takes 30 minutes to do a bunch of scheduled tasks so I'm hitting refresh till its up lol

violet meadow
#

FTC time 🤷

short aurora
#

Is the correct way to stop an item's workflow/roll "still" (unsure if it was ever the right way...) setting workflow.aborted = true?

soft ravine
#

i see allot of "once per turn" in 5e This means it can only be used once on each turn. For example, a rogues sneak attack can only be applied once per turn, but they can use it every turn, if applicable. - is there a midi answer to this?

vast bane
#

@short aurora ⬆️

#

thats kinda old, I think things might have gotten easier since midi 34

vast bane
#

the simplest way to find out is to edit the macro on that sneak attack hehe

#

if you give us what the item actually is we can probably just replace a couple things and reskin something that already exists

soft ravine
vast bane
#

tell us the description of the item, a bunch of us already know 20 other examples of once per turns

soft ravine
vast bane
#

if you don't fast forward this is all very easy in advantage reminder module

soft ravine
#

im not worried about all the stipulations, but like you were saying @vast bane i can reskin "sneak attack" so i dont have to worry about player abuse

vast bane
#

You could also reskin a GWM esque preroll item for it semi manual

#

pre roll the ability at start of turn, then have it expire after the first attack

vast bane
#

is it ANY negative effect?

soft ravine
vast bane
#

Great Weapon master

old pendant
#

Hello again, would need help with this code.

i wrote this macro for the token i want to target to remove 1 hit die but it doesnt seem to update. the notification displays the correct reduction of hit die and it seems to find the path to the hit die but it doesnt safe it and update it on the spot always leaving me with the notification "Hit die Value has been reduced to (what ever the current value is-1) but it never actually updates it not in the console and not in the sheet.

let actorName = "Morad Stormcaller";
let actor = game.actors.getName(actorName);

if (actor) {
let currentHD = actor.data.system.attributes.hd;
if (currentHD <= 1) {
ui.notifications.error(${actorName} cannot have a hit die value lower than 1.);
} else {
actor.update({"data.system.attributes.hd": currentHD - 1}).then(() => {
ui.notifications.notify(${actorName}'s hit die value has been reduced to ${currentHD - 1});
}).catch(err => {
console.log(Error updating actor: ${err});
});
}
} else {
ui.notifications.error(No actor found with the name "${actorName}".);
}

vast bane
#

thats gonna be hard to filter for

#

actor.data.system 0_o

old pendant
#

the hit die value seems to be in there yeah

vast bane
#

its probably suppose to be actor.system

old pendant
#

oh

vast bane
#

all those datas look yeetworthy

old pendant
#

haha i removed the data it still find the hit die value but does not update

vast bane
#

are you sure they are there? I could have sworn they are in classes

old pendant
#

let me double check

vast bane
#

also isn't actor naughty to define?

old pendant
#

the overall hit die are int he system.attributes.hd path but there are class specific hit die in the classes path you mentioned

#

i think im missunderstanding something

vast bane
#

also when you share macros here do this:

```js
your macro pasted here
```

old pendant
#

oh

#

thank you i will remember that

#

is there a way to remove the highest hit die available in script (like in the consumption section for the item)

vast bane
lucid elbow
#

Hi, sorry to necro this. I really need to use this and I've installed worldscripter, but I have no idea how to use it...

vast bane
#

you could look to see how chris did Wither and bloom actually

#

I honestly still haven't figured out how to find his work in his module lol

#

where ever this is:
function.await chrisPremades.macros.witherAndBloom

vast bane
#

in the new macro change the type from chat to script(or keep it script if it already was)

#

then paste the code you just replied to into the macro

#

remember its name, save it and find it in the list and drag it to the world scripter module's compendium in the compendium sidebar

lucid elbow
#

like so?

vast bane
#

open it and show me it

lucid elbow
vast bane
#

to be clear that is only going to work if you use midi damage application

lucid elbow
#

yeah I noticed the damage application

vast bane
#

either manual or auto, but only damage dealt to the druid via the checkmark button will trigger it

#

install Effect macro also

vast bane
#

I also use these keys on the symbiotic effect

#

first changes her token appearance, second gives her an AR button to press to deal damage with melee and do the extra halo damage, and last adds the special upgraded spreading spores item to her sheet to use while shes changed.

#

apparently I need to delete the second key

#

oh wait no I don't need to delete it

#

thats right the symbiotic entity has weird scaling, the halo of spores and melee bonus damage don't scale together

lucid elbow
#

Just working through these now

vast bane
#

I can probably just give you the item in a dm if you want it

violet meadow
#

Hmm I think something like this for light is OK no?

lucid elbow
vast bane
#

Lukas was the one who wanted it, I was ok with janky 8)

vast bane
# lucid elbow Where can I find this?

midi workflow button, workflow tab, damage section, the drop down that has "Yes + card" just needs to have any of the settings that include card I think

vast bane
#

the create item key isn't going to transfer properly but the rest will(if you change the path to the mushroom token image your druid prefers in the first key)

vast bane
#

I think the reason my spreading spores breaks is cause dae was having trouble deleting the created item after it finished then it would wind up with duplicates and freak out

violet meadow
vast bane
#

the three card settings are what you want I think to get midi workflow damage dealing

#

yes might actually do it but you want the card so you can undo it I think

violet meadow
#

What would be a logical max for dim and bright light 🤔 ?

short aurora
#

Isn't Light a set amount anyway?

#

40/20 always?

vast bane
#

I don't think you change the dim/bright in Light do you?

#

can it be changed while its still active?

violet meadow
#

It's meant to be infrastructure for user to do whatever

#

Light SRD will be light 40/20

vast bane
#

light cantrip is 40/20

short aurora
#

Ah, it's a function to reuse? Uuh, there are some really big spells like Daylight but not sure how many spells you can pick there

#

Is it just Light and Dancing Lights where you pick the colors?

violet meadow
#

When you pass the parameters needed, the dialog will not popup.
It will be premade for MidiSRD.
But it is will be an exposed function.
await MidiMacros.light() will just trigger the dialog and user can select what they want

#

Need to add a dropdown for animation and speed etc

short aurora
#

Aaah, roger roger. I think a reasonable max to begin with is 60/60 from a quick memory bank glance

#

well, reasonable is maybe not the word, but that seems to be the upper bounds for light creation

violet meadow
#

I just used Math.floor(canvas.scene.dimensions.width/2) to be sure 🤣

vast bane
#

I know of no lightsource larger than 60/60

violet meadow
#

oh well

vast bane
short aurora
#

just looking at a still image of that needs a warning for hypersensitivity

#

oh shit I was joking lmao

violet meadow
#

Hypersensitivity warning 😄

short aurora
#

looked like the disco scene from john wick, lights flashing everywhere

lean holly
violet meadow
#

noFlanking FTW 😄

lean holly
#

They need all the help they can get. LOL!

pliant matrix
#

When I create an effect that automatically puts the proficiency using DAE, I can no longer modify it (for example by wanting to put the thief's Expertise). How can I fix it without turning off the effect?

violet meadow
#

Turn off and on? 😄

vast bane
#

is it always on?

#

if its always on mod the sheet directly

#

you do not want to be adding a thousand active effects just to flag expertise when you can do that directly on the sheet

#

ae's cost performance when they start to add up

pliant matrix
short aurora
# old pendant 👀 thank you so much 😭

Hey Hentik, nearly done. If your feature isn't licensed material, can you attach an export of it here or DM me a copy instead? I'd rather the solution fit the current implementation.

vast bane
dark canopy
vast bane
dark canopy
#

the source doesnt matter, just letting you know

vast bane
#

midi is technically not involved in that fwiw, its installed but that macro is firing innocently I think

#

its using effect macros api entirely I believe

short aurora
#

... you can adjust proficiencies with active effects?

vast bane
short aurora
#

effect macros api is near 1:1 from the system from the quickest of glance

#

ah, fair

vast bane
#

yeah normally I use midi stuff but when I do effect macros its almost always just warpgate and effect macro stuff

#

you can mod the skills and tools directly to make them permenantly expertise

#

but in the default sheet the cog is auto hidden so many have no idea thats how you do it

#

though expertise on skills can be toggled clicking the dot

#

tools are the weird ones

short aurora
#

Oh there's just straight up a flag for it, I have yet to have seen that

#

system.skills.xxx.value and then it offers the proficiency types itself, nifty for a few automations I got

short aurora
#

Is it possible to effectively await a dialog/wait for a dialog to resolve in a macro run by an item and then cancel that item run, so you don't get the original chat card? For features that can use variable resources.

molten solar
#

Dialogs aren't normally awaited, but they have the Dialog.wait constructor, which takes all the usual arguments. This is async and won't resolve until closed or you click a button.

#

As a point though, Item Macro (without midi) does this by default.

violet meadow
# short aurora Is it possible to effectively `await` a dialog/wait for a dialog to resolve in a...

not a Dialog.wait() example but still ```js
const {macroPass,workflow:{item},isCritical,actor,workflow} = args[0] ?? {};
if (!macroPass || !item || !actor || !workflow) return ui.notifications.error("MidiSRD - Staff of Striking error, please notify GM!");
if (macroPass === "preItemRoll") {
workflow.config.consumeUsage = false;
workflow.config.needsConfiguration = false;
workflow.options.configureDialog = false;
return true;
}
else if (macroPass === "DamageBonus") {
const charges = item.system.uses.value;
if (!charges) return;
const labels = ["None", "One", "Two", "Three"];
const content = <center>How many charges? Available: ${charges}</center>

    async function dialogAsync(){
        return await new Promise(async (resolve) => {
            new Dialog({
                title : "Staff of Striking Charges" , 
                content,
                buttons: Array.fromRange(Math.min(4,Number(charges)+1)).map(i=>({label:labels[i], callback: (html) => {
                       resolve(i);               
                }}))
            }).render(true);
        })
    }
    let damageDice = await dialogAsync();
    if(!damageDice) return {};
    await item.update({"system.uses.value": charges - damageDice});
    const damageFormula = new CONFIG.Dice.DamageRoll(`${damageDice}d6[force]`, {}, {
        critical: args[0].isCritical ?? false, 
        powerfulCritical: game.settings.get("dnd5e", "criticalDamageMaxDice"),
        multiplyNumeric: game.settings.get("dnd5e",  "criticalDamageModifiers")
    }).formula
    return {damageRoll: damageFormula, flavor: "Striking Damage!"};
}
molten solar
#

Actually that is a Dialog.wait example

#

cus it's the literal code for Dialog.wait

violet meadow
#

it is but not using the constructor

#

well yeah

#

@short aurora if you move all that in the preItemRoll you can cancel it out if it returns false

molten solar
#

It'd be this:

const damageDice = await Dialog.wait({
  title: "Staff of Striking Charges",
  content,
  buttons: Array.fromRange(Math.min(4, Number(charges) + 1)).reduce((acc, n) => {
    acc[n] = {label: n, callback: () => n};
    return acc;
  }, {})
});
violet meadow
vast bane
molten solar
#

document.querySelector O_o

violet meadow
#

no more dialogs

vast bane
#

Its a lukas wishlist

violet meadow
#

yeah that initial one got expanded...

vast bane
#

have him gussy up the dialog for you like he did for chris's dialogs ;p

#

god I think I just showed my age

violet meadow
molten solar
#

jQuery 😠

short aurora
#

Ah, great examples, thanks both of you

frosty star
#

hello i keep getting this when i try and cast a spell. Can someone help please?

violet meadow
# frosty star

Go to Item Macro's settings in Foundry, and uncheck the Sheet Hooks option

frosty star
#

ah is it that simple :D?

violet meadow
#

One of the most common issues when using macros (in Item Macros) with MidiQOL

frosty star
#

got it in one!

#

5* service dude

deep harbor
#

Hello folks.
I'm trying to make an item macro for the Enlarge/Reduce spell.
I've asked in #macro-polo and they helped me out with a standard macro, but now I need to convert it to work as an Item Macro.
Could someone please help with that?

dark canopy
#

as a "Midi On Use" macro, to be specific

#

(its important when dealing with midi)

deep harbor
#

Thank you for the clarification. I'll have to learn all the new terminology as I go.

violet meadow
#

ItemMacro | After Active Effects and a
DAE with an effect macro.itemMacro | Custom

const mutName = "enlarge/reduce";
if (args[0].tag === "OnUse") {
//do the enlarge/reduce dialog and mutation
}
if (args[0] === "off") {
  const { tokenId } = args.at(-1) ?? {};
  if (!tokenId) return ui.notifications.error("tokenId not defined");
  const targetTokenDoc = canvas.scene.tokens.get(tokenId)
  await warpgate.revert(targetTokenDoc,mutName)
  await ChatMessage.create({ content: `${targetTokenDoc.name} is returned to normal size` });
}
#

of it has some MidiSRD code in there. just a sec

deep harbor
#

Is that fixed now?

violet meadow
#

Well it is a fill the gaps situation, but should be doable. If not, will check again later 😉

deep harbor
#

The arg array. What information is accessible in there? I've not managed to find a list of what the different indexes contain.

violet meadow
#

Check DAE and MidiQOL readme. You can find them there

#

Or create an Item onUse macro that just point to a macro with ```js
console.log(args)
console.log(this) //MidiQOL workflow

deep harbor
#

Thanks. Found the last arg contents.

deep harbor
violet meadow
#

same for a DAE macro.execute or macro.itemMacro etc.
console.log(args)

#

Different than the ones provided by MidiQOL for the Item or Actor onUse macros

deep harbor
#

Interesting. console.log(args) is returning an empty array.

#

I see. Because I have midi enabled, console.log(this) is what gives me a result.

wide crystal
#

Hey guys, does an attribute key exist for Chris's Premades' Condition Resistance? I thought it would be applied similarly to other DRs, but seems like it works differently, yet I can't find any explanation anywhere that I could understand.

deep harbor
#

args[0].tags is coming up with an error, because I'm not getting any args. I have confirmed that args[0] is undefined.
Is it possible that I have a setting wrong?

#

Also, the code you so kindly provided uses arg[0].tag in the "OnUse" section, but only arg[0] in the revert section. Is this correct?

violet meadow
#

The item will need to transfer an effect on the target

#

When that effect is deleted, the off will fire

deep harbor
#

The effect needs to be different depending on the chosen option.

violet meadow
#

Not easy to help now as I am on the phone.

#

The effect can be the same, but depending on the dialog choices, it will do something else

deep harbor
#

Yes, I put that into the upper section. It isn't getting that far because of the arg[0] is undefined thing.

violet meadow
#

Do you have item macro sheet hooks option checked maybe?

#

In the Item Macro module settings

deep harbor
#

I do. I've now turned it off.

violet meadow
#

Should be good to go now

deep harbor
#

Thanks.

violet meadow
#

The reason I use that way is so as to get the dialog to choose enlarge or reduce on the caster's client. Otherwise it will prompt the user that owns the target token if it's different

scarlet gale
wide crystal
#

@scarlet gale Advantage on rolls against being knocked prone (or moved, but I imagine that requires macro and it's just not common enough to be worth automating).

deep harbor
violet meadow
#

Of your setup

deep harbor
violet meadow
#

Should be good

deep harbor
#

I don't know what the effect value needs to be to call the macro.

violet meadow
#

And what is the macro?

deep harbor
#

You want the code of the macro? On it's way.

#
const mutName = "enlarge/reduce";

if (args[0] === "on") {
    const tokenSizes = [0.5, 0.7, 1, 2, 3, 4];
    const sizeCategories = ["tiny", "sm", "med", "lg", "huge", "grg"];
    
    const target = game.user.targets.first();
    
    if(!target) return ui.notifications.info("no target set");
    const currentSizeCategory = target.actor.system.traits.size;
    
    const change = await Dialog.wait({
        title: "Enlarge/Reduce",
        content: `<h3>Pick Enlarge or Reduce</h3>`,
        buttons: {
            enlarge: {
                label: "Enlarge",
                callback: () => "enlarge"
            },
            reduce: {
                label: "Reduce",
                callback: () => "reduce"
            }
        }
    });
    if(!change) return;
    if(change === "enlarge") {
        const newSizeIndex = sizeCategories.indexOf(currentSizeCategory) + 1 <= 5 ? sizeCategories.indexOf(currentSizeCategory) + 1 : 5;
        const newTokenSize = tokenSizes[newSizeIndex];
        await warpgate.mutate(target.document, {token:{width: newTokenSize, height: newTokenSize}});
    }
    else if (change === "reduce"){
        const newSizeIndex = sizeCategories.indexOf(currentSizeCategory) - 1 > 0 ? sizeCategories.indexOf(currentSizeCategory) - 1 : 0;
        const newTokenSize = tokenSizes[newSizeIndex];
        await warpgate.mutate(target.document, {token:{width: newTokenSize, height: newTokenSize}});
    }
    else return; 
}
if (args[0] === "off") {
  const { tokenId } = args.at(-1) ?? {};
  if (!tokenId) return ui.notifications.error("tokenId not defined");
  const targetTokenDoc = canvas.scene.tokens.get(tokenId)
  await warpgate.revert(targetTokenDoc,mutName)
  await ChatMessage.create({ content: `${targetTokenDoc.name} is returned to normal size` });
}
#

I removed the tags. Thanks.

#

I put the .tags back onto the args[0], and I ran it again. I clicked apply effects from the spell and the macro did not fire.

#

The return to normal part is working when I remove the effect.

#

Ah. It's looking for "onUse" in the tag. Is that correct for applying an active effect that then calls the macro?

#

And that was it.

#

Fixed it.

#

Now to get and dynamically add to the effect...

violet meadow
#

AFK but glad to hear that it works 💪

deep harbor
#

Deleting the active effect manually doesn't get caught. Is there a solution to that, or do i just have to make sure I disable it before deleting it?

deep harbor
violet meadow
#

Try something

#

Move the item on the sidebar.
Go to the AE and the effect value which is empty

#

Open the character sheet and drag and drop the actual item into the Effect value field

#

That will create a link

#

In the beginning of what is created in the field, add this ItemMacro.

#

Share a screen shot after

#

Drag the item afterwards again on the character sheet (delete the previous one from the sheet though)

scarlet gale
#

It should work

hasty jackal
#

what are the flags for guaranteed melee and range attacks? rwak and msak custom 1?

#

critical*

#

also its is impossible to add a passive and active effect to an item?

shell gull
#

Hi! I'm trying to mace a macro for a homebrew item. It's shield, upon activation it applies blindness on everyone except it's owner in 120ft radius for 3 turn's without saves and sphere penetrates all bariers.
I was already referred to midi documentation and digging it as of now, but without any guidance it's a bit overwhelming 😅
Not asking to write it for me, more like asking where to start
Thanks in advance!

hasty jackal
#

nvm

#

found the answer im dumb

violet meadow
#

Range blank blank Special

#

DAE on the item to apply Blindness

deep harbor
#

I'm trying to use target.effects.get to get the instance of the effect, but that's not working. I'm getting an is not function error for .get, .getName, and .find.

violet meadow
#

It's a function on the actor not the token

#

Try target.actor.effects...

deep harbor
#

And the revert message is occurring, however the effect isn't actually reverting.

shell gull
dark canopy
deep harbor
deep harbor
dark canopy
violet meadow
#

Might have the wrong target to begin with 🤔

#

Not sure without checking the macro

deep harbor
#

const mutName = "enlarge/reduce";
await warpgate.mutate(target.document, {name: mutName, token:{width: newTokenSize, height: newTokenSize}});

molten solar
#

Missed a few parameters there

dark canopy
molten solar
#
await warpgate.mutate(
  target.document,
  {},
  {},
  {name: "Steve"}
);
dark canopy
#
await warpgate.mutate(
  target.document,
  updatesObject,
  {},
  {name: "Badger"}
);
deep harbor
#

I see. Changing.

dark canopy
#

(just to slightly expand to the use case here)

molten solar
#

So it's a script-off

violet meadow
#

When one starts speakin warpgate a whole new world opens up

deep harbor
#

Thanks again. The revert is now working.

#

Now just to try and fix getting that effect...

violet meadow
deep harbor
#

It's label not name.

#

On effects, the field is called label.

violet meadow
#

Yes

molten solar
#

For now

deep harbor
#

This still fails to find it though: const effect = target.actor.effects.get(e => e.label === effName);
effName is a copy-paste of the effect's name from the editor.

violet meadow
#

Developer tools module places a really helpful button on all documents titles bars, which when pressed logs that document on the console

#

Get needs an id

#

Use find instead of get

deep harbor
#

Ah, of course.
EDIT: Still failed.

deep harbor
violet meadow
#

Yeah probably 🤷‍♂️

shell gull
#

Is there any simple way to tie item uses to battle\number of rounds\time as in simple calendar, as it works for effect duration?

violet meadow
#

Once per round for instance or effect expiry?

shell gull
#

not sure, what you are asking, sorry 😅

molten solar
#

He is asking for examples.

violet meadow
#

Effect expiration during combat is times up module alley for instance

shell gull
#

in GUI of an item i can set uses per rest, or day or charges. My GM rules some items as usable number of times per battle, so i need it to recharge once battle is over

#

and expandin on this idea i though, mb there is a way to recharge item every ___hours. Same way as effects expire after set time

deep harbor
#

It's not longer failing to find the effect, so that's a plus.
My method of pushing multiple new effects into it is clearly wrong though, as it's not adding any of them:

effect.changes.push(
            {key: "system.bonuses.mwak.damage", mode: "2", priority: "20", value: "1d4"},
            {key: "system.bonuses.rwak.damage", mode: "2", priority: "20", value: "1d4"}
        );
#

And after this fix I must stop, because I've been working on this for 10 hours straight, minus meals.

molten solar
#

That isn't how you update a document

deep harbor
#

And, as expected, it's wrong.

molten solar
#

Can't help you with midi. But Flix has a pin in #macro-polo for basics such as these.

deep harbor
#

Oh, that code. I've seen that in the examples, but I've done so much I forgot. I've also been strugling to make sense of stuff because this is my first time in JavaScript.

dark canopy
#

and warpgate can apply those AEs as well, if that is easier

molten solar
#

Well you've sure not made it easy for yourself heh

deep harbor
dark canopy
#

the warpgate wiki has a bunch of examples

deep harbor
molten solar
#

deepClone the array, change it, update the effect with new array

dark canopy
deep harbor
#

So this should be a lot closer to it:

        updates.push(
            {_id: effect._id, key: "system.bonuses.mwak.damage", mode: "2", priority: "20", value: "1d4"},
            {_id: effect._id, key: "system.bonuses.rwak.damage", mode: "2", priority: "20", value: "1d4"}
        );
        canvas.scene.updateEmbeddedDocuments("Effect", updates)
#

But that changes the key, and other values. I need to append the effects with new ones.

#

I'm also guessing as to the keyword "Effect"

dark canopy
#

lets back way up -- where is this effect held?

deep harbor
#

The effect has been placed on an actor by the spell. I'm getting it with the following:

const effect = target.actor.effects.find(e => e.label === effName);
        if (effect == undefined) return ui.notification.error("Enlarge/Reduce effect not found");
#

That part works.

molten solar
#

Just update the effect. Not the... canvas?

deep harbor
dark canopy
#

and you need to modify the effect right after creation?

molten solar
#

It's not an embedded document

#
const changes = foundry.utils.deepClone(effect.changes);
changes.push(
  {key: "system.bonuses.mwak.damage", mode: "2", priority: "20", value: "1d4"},
  {key: "system.bonuses.rwak.damage", mode: "2", priority: "20", value: "1d4"}
);
await effect.update({changes});
#

There

deep harbor
dark canopy
#

instead of jumping through hoops to modify it after the fact

fringe brook
#

why disadvantage? the creature has truesight 😦

deep harbor
fringe brook