#MidiQOL
1 messages · Page 92 of 1
Warpgate has some pretty extensive documentation, but that's only useful if you're familiar with javascript
yeah but the warpgate wiki was so easy to read that even I was able to write some things
Does Arbon's not help with these?
the problem I have with arbron is it only does like 1/3 of the work
Arbon's is ok I guess
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
Ah, obv never tried it
The module also hasn't been updated in awhile
Item On use Summon Beast, macro pass is ALL
fromUuidSync(tokenUuid).actor.system.details.race?.includes("Undead") || fromUuidSync(tokenUuid).actor.system.details.type?.value.includes("undead")
would that work with grant booleans?
yes
Looks like it should
@dense vessel you followin what he just shared?
Oh yours is very different than mine
I gotta admit, my shits really messy lol
its mostly bugbears work
I love the pre item roll check
What does yours looks like when you cast it?
it has a pink glow for the players color and it summons with a poof
You get options for the which summon?
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
This is what mine looks like
thats not the same spell
Thats conjure animals not summon beast
goes to find phb
(╯°□°)╯︵ ┻━┻
Tashas' cauldron of everything has special summons that I strongly feel are best dealt with in warpgate macros
My book is upstairs and I'm too lazy to get off the couch, haha
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
Tasha summons make the DM cry less
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
My DM in a past game said I was only allowed to cheese conjure beasts once
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
Am I simply supposed to copy and paste this into the Effect Value field, like so?
If I am seeing what bugbear wrote, I think yes
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.
Small typo. Grab the linked again <#1010273821401555087 message>
That is, delete, drag, and rename Searing Smite from wherever I found it? Or maybe I'm just not understanding
hmmm
let me sus it out some
fantastic, that did it. thanks much!
you never solved it right?
No, but tbf I haven't messed with it much or tested it since I asked the question
the macro also has v9 shit that needs to be fixed I'll tweak it here shortly that could also be the problem
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?
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
if you are gonna go into tasha summons -- start with this 😅 much easier to work with. https://github.com/trioderegion/warpgate/wiki/Summon-Spiritual-Badger
yeah...
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)))
}
I didn't know how different the spells were, haha
my basic ass devotion pally does not have an issue at all, I suspect your problem is you have a stack of damagemacro keys on the actor
I like Arbron's Summoning for Tasha's stuff
are you on dae 24?
I am
DAE 24 might be why your hex/hunters mark breaks
MidiQOL .35 is the issue
Also on Midi .35 👀
DAE .24 is responsible for onUpdateTarget/onUpdateSource
yeah but we have to stay on 35 for the goodies in CPR
yep, great option 100% -- just giving Super something a bit more...uh...sane...to work with 😅
Super is like you though, you two are the last v9 users in foundry hehe
So he can only stare longingly at Arbron's Summoning
(and Baboni)
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 🥺
Yeet or keep data?
if (!["mwak","rwak"].includes(args[0].item.data.actionType)) return {};
system
Searing Smite. Check the AE. Does it have an ItemMacro call?
System also?
const spellLevel = actor.data.flags["midi-qol"].brandingSmite.level;
yeet
IIRC Kandashi is also on V9 rn. Also like a month ago I know someone in here was on v9 cause you @'d me
✊
This is very technically true lol
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
thats identical to my functional one
Move it to the sidebar. Delete item from the actor. Move it back
Details tab, is it Transfer to actor on item equip?
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
It's not presently.
OK then you will need to do something else
Best bet, leave the Item on the sidebar
Paladin's current effects, if it matters
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
Like so?
I'm pretty certain you should probably downgrade to dae 23 when you are done getting help from bugbear on this
you were suppose to clear the effect value before you dragged
Ah
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
and the link to dae 23:
https://gitlab.com/tposney/dae/-/blob/v10/package/dae-v10.0.23.zip
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
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
@soft ravine
It just wasn't displayed
ah yep, I see that now too, wasn't checking for that
Thing is, I'm not sure if that's working as intended or not?
I wonder if all the smites make this mistake
No, I think that it is supposed to go away if she loses concentration
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
@vast bane and everyone anyone else with input, (I'm still reading) but wanted to pop up a message saying THANK YOU
It's actually really easy with midi hooks
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?
is the cleric flanking SOMEONE?
Nope,
this is...another...attribution issue...
Follow these two pictured messages to turn on attribution please:
#1010273821401555087 message
once you have it on, make the attack and expand to seee what the weapon has for flags
ADV:Flanking
show me your character sheet for spiritual weapon
expand the no target and show us the window
0_o
I'm at a loss here then, mine doesn't, what is your flanking set to
and what version of dfreds CE/midiqol
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
I thought setting it as NoTarget meant midi wouldnt interpret it as a creature so things wouldnt effect it
badgers not gonna like this
AoE won't affect it
Other things will
like direct attacks
It is an Actor after all
change the sidebar actors prototype token to neutral or hostile
then the opponent causing flanking is also neutral
Still gets flanking
the otherside is also neutral then
flanking only works if same disposition is involved
Other side is friendly
move them
you are still acting with the original key on you
you need to change the state by moving them
and retargetting
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
You could use DFreds flanking, make it a statusEffect and add a condition immunity on the Spiritual Weapon Actor for flanking 😄
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
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.
i understand this, but barely FANTASTIC
that is not reproduceable to me
does your spiritual weapon have the flanking on them already?
drag a new one, turn off require targets, and make an attack
i was not sure if that was possible but that would be preferd!
do you see the flag for advantage on them?
he already edited the original macro
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
No target, and it rolls normal, with "flanked" target it rolls advantage even though dispositions are different.
turn off all modules but midi, socketlib, libwrapper, and dae and reproduce again
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
Yes, I checked token configuration of the actor on the scene.
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
that looks slick AF nice work
Congrats to our sw5e brethren:
Dfreds CE
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
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
export your midi settings so you have them to restore to, then take mine to test
exported
(Do not use these unless you have exported your own backup, my settings are abnormal not many like them)
I took the warpgate wiki for conjure elemental and repurposed it for conjure animals
Ill downgrade DAE tomorrow and report back lol.
you should do it anyway cause theres bad breakage in dae 24, but for the record, that is a hail mary at best, its highly unlikely
@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
ok let me check.. i could have sworn i made it like above before i started troubleshooting
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
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.
are they the same owner?
No, this is all still bare min modules no summons.
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:
Thanks for going through it with me, im going to bed. Ill submit a github issue in the AM unless youve done one.
ok im not sure why im seeing an attack roll, but the Soul Essence amount does not seem to increase, i can make it decrease using the resource consumption on a spell though. (i set it too 11 before the test)
move soul essence and harvest to the sidebar, right click them both and send the files to me in a dm
cause they are copyright
right
Thank you! i found the problem, i had resistances turned off in midqol
you have not imported his macro
how so?
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
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
What is the Willing Target?!
Night is a new user and managed to put an activation condition in that is wrong lol
this is actually funny:
i did that previusly but let me get dae 23 working.. i dled the module zip , unzipped, pasted folder (that has .module) in the module folder. (ill figure it out)
Is it an activation condition -- yeah
its picking up a keyword
yeah to novice users the dae zip can realloy mess you up
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 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
you should be good now
I'm gonna put a github post for him to fix the zips going forward
it wasnt that hard to figure out, im on laptop rn without mouse, so im a bit slower than normal tonight
it should work fwiw, I am using your items, with the macro pasted in properly to Item Macro and its adding soul essences
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
ITS WORKING (mooohahahahahaaa!!!)
this is going to be used in ALLOT more situations than you might think (its not just for harvest making it the essence go up)
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 ❤️
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.
tposney has this new vitality homebrew in optional rules is that something you'd use?
Mm, I'm not familiar with it, care to expand on that?
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
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.
turn off all your auto defeated settings and handle it manually, CUB might be able to pulll this off in some way too
Gotcha, I'll just look for that rq then in all of the various settings.
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?
Any non-allied creature will not have the rule applied to them.
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
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?
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
Hmm... That'd work. Well that did it alright, much appreciated, thanks!
@violet meadow what would the macro be like for macro.createItem to make the item attached be equipped AND attuned on drop?
Would just be an item update to set attunement and equip status
how can I look at the items like data like I can an actor?
Same way as always, right click on the thingy in the title bar and fromUuidSync it
await args[0].item.update({'system.equipped':false, {"something else": {value: probably 2}});
Won't be this
So define the item?
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
I thought possibly tposney's shillelagh would have something, you are onto something
Won't be for a few hours
const lastArg = args[args.length - 1];
Yea, dig around in there
np I appreciate whatever you can do
macro.createItemMacroUse or whatever will run the macro in the item macro
Oh interesting
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
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?
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
as an on use macro right on the item
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
what if the created item has a macro of its own?
Then just update the origin
That's the you check the macro pass
You'll need to tweak your existing macro on the item
oh theres an actual macropass for on create now?
Yep
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
nah the effect macro is actually on the createitem key on the beginning item
origin.update
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
yeah but that also wouldn't be perfect
It should
what a bummer I was hoping the macro.createitemmacro thing would launch the macro ON the beginning item not the created item
I would have to put an effect on every new macro.createitem
Effect macros for that
Have it read the effect keys
This is super janky
Warpgate easier at this point
I really think that Macro.createitemRunMacro is meant to run a macro on the first item, that then applies to the newly created item
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
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
Nothing changed with effect macro
But you may have an effect with an origin that's not an item
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?
yeah I'm trying to test with just effect macro, I think its a dae bug
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?
So deal damage to itself based on the roll or actual how much damage dealt?
(in case of resistances etc.)
based on the roll
with just effect macro enabled and with all but the last line deleted, the item deletes on toggle on as I want it
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
(I don't think Moto meant to reply to you there, Hentik)
sorry
haha i thought so 😄 no worries
Does the attack need to hit @old pendant ?
yes
sorry for not giving more information beforehand i dont know what you need to take into account @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?
i do, i think but if not i'll let you know, thank you so much 😄
yeah its a direct conflict with DAE 23, gonna rollback dae's till I find the version that broke effect macro compatiblity
😄 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
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
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
What are you trying to do?
Check what the origin is. It is probably related to what module you use to transfer the effect. I assume it doesn't set origin correctly.
I turned off all modules except dae and EM, this item works in dae 14 and em 14
The effect's origin should be a uuid and origin in EM should be what that uuid points at.
the origin is proper
and I'm testing with core toggling of suspended effects now and its still breaking
Screenshot the effect on the actor
And that unidentified item is an item?
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
It's also inactive
however, it just worked after taking out the attunement requirement
So the macro may not run
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
Trying to remember if inactive effects run effect deletion macros
I don't think toggle on is what happens when unavailable to active happens
You're trying to have the unidentified item get deleted when the effect becomes active right?
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
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?
No idea what you are talking about
I'm using On Effect Toggle On for EM trigger
Put a console log in and see if the macro runs
cause I assume on creation won't work as then it will fire as soon as it shows up on the actor
Yep
console.log(origin)?
Something shows up:
Then it should be working
it does everything but the effect macro origin.delete
Oh that is a long... conversation!
though I stil think it does, its just something else is happening
take the item above and try to attune to it
its suppose to delete itself on attune
Show me your macro
Trying to set attune and equipped after creation?
console.log(origin)
if(origin instanceof Item) origin.delete();
Item5e isn't it?
I almost have that figured out, the problem is that deleting the origin is breaking if dae exists with em
Effect macros resolves it
I have no idea what that is
Is it via EM?
it works fine when dae is disabled
It's already the fromUuid thing
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
The console log showed up so...
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
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
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
And what happens when the deletion is taking place?
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();
it blinks out briefly as if deleted and then reappears in inventory
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
Just tested it myself
works fine
Only thing I can think of is that your compendium item is the same one you're deleting
there is no compendium
So you're just giving yourself back the same item
you have a create item key in the effect
now you got me worried lol
Compendium.dnd5e.items.DevmObXWP9MfwE2c, permanent
Looks like a compendium item to me
that a SRD item?
The origin of the effect is the unidentified item
On my setup Moto, it deletes without issue
and creates the new item
unidentified item gets attuned, it applies an ae that gives the magic item, and deletes the original unidentified item
Something on your end is messed up
can you show me your effect value on unidentified item?
, permanent
add this to the end
you also aren't doing a compendium one but I'll test your way
added that, still worked
try the compendium srd item
I just replicated your setup and its still happening I give up
still worked
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
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
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
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?
I didn't get what you were saying lol
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?
magic item tab is magic items module, which is a bad module
it can't get items from a compendium
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
where you can read the comments
Click by the orange F thing
and it'll open up this:
if you want to roll hit dice to shield away damage , there is a midi key for that, its the .DR keys. BUt that feature sounds complicated as hell especially if you allow multiclass
Can you be more precise of the damage received part? As long as Magic Items can run a macro on use, we can probably always wing it somehow
hitdice are the one thing midi has no clue is rolling
Like... Is it interception? You see someone get hit near you, you reduce that damage? Is it temp hp?
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.
Right, hold on a second, just gonna see if I can cheat off of either bugbear or chris' papers for this test
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
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>
`;```
Is it actually interception like reacting on someone else's behalf? Because then I do think your healing afterwards is muuuuch easier to do than the other, the whole reaction on someone else's thing to react to is a hornet's nest
Zhell would know how to do it better than me
healing afterwards is fine doesnt need to be interception 😄
for now 😄
That code is using v9 stuff too btw
@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
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.
It's fine, no worries, I'll get back to you when I stop procrastinating doing html
if they are MC'ed to same hitdice size...
It's the number of d10 that's determined by the number of hit dice
is this homebrew?
gonna go with presumably yes
then just change it to be easier to make ;p
hit dice features scream oneshots to me lol
reverse it sthe number of hitdice spend that is determining the amount of d10's
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
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
because before perfection comes imperfection
I prefer the sweet spot of janky
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.
were you attuning to a npc or a pc?
I'm doing it for practice regardless, I'll beep you when I'm done
👀 thank you so much 😭
@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
Linked or unlinked?
I am having some issues with unlinked tokens too, but not sure if DAE is the culprit 🤔
when I tested on the 2.0.3 build I had no landing page so I used a starter hero
Ah OK so you didn't check if the same issue is happening in the 2.0.3 build with an unlinked one
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
Is there a way to set up a Template ability to only target allies or enemies, rather than everyone under the template?
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
I don't think so no, maybe in a macro
Macro yes, can probably just filter either allies or enemies away from the workflow after template placement
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
Yeah I know about the careful spell options, but I wanted this one to not even target allies (or enemies, depending on the spell)
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
Yeah that's a sculpt spell alright 😄
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
Yeah I remember the conversation
his new fat finger move is right clicking the status marker to the right of the one hes trying to use
Should get MidiQOL to auto target
speak of the devil
It is.
we sorta solved this, the misbehavior only happens on unlinked actors
They dont run anything, that makes sense.
Moto are these enough ?
await MidiMacros.light(args, {dim: 40, bright: 20, alpha: "0.25", color: "#ffffff", type:"pulse",speed:3,intensity:1 })
did Lukas give you the dialog version?
If color is not predefined a color pick will pop up
Unrelated module breaks EM on unlinked actors?
yeah its weird DAE just being present with an EM ae with the origin.delete will cause the actor to recreate the item after the deletion
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
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
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
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
my server is rebootin atm I'll give you admin when it comes up
Attunes and equip. Old Item is getting deleted. New item created
What is the issue again? 🤔
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
my server restarts and takes 30 minutes to do a bunch of scheduled tasks so I'm hitting refresh till its up lol
FTC time 🤷
Is the correct way to stop an item's workflow/roll "still" (unsure if it was ever the right way...) setting workflow.aborted = true?
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?
@short aurora ⬆️
thats kinda old, I think things might have gotten easier since midi 34
its dealt with in macros and theres multiple ways to handle it but if you give us the literal feature, not translated into midi or foundry setups, we could convert it for you if its even what you are looking for.
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
uggg why didnt i think of that, answer was right in my face LOL, let me try first - i woke up early, and all out of coffee
tell us the description of the item, a bunch of us already know 20 other examples of once per turns
if you don't fast forward this is all very easy in advantage reminder module
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
looking that up now
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
what is a gwm?
is it ANY negative effect?
it is
Great Weapon master
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}".);
}
the hit die value seems to be in there yeah
its probably suppose to be actor.system
oh
all those datas look yeetworthy
haha i removed the data it still find the hit die value but does not update
are you sure they are there? I could have sworn they are in classes
let me double check
also isn't actor naughty to define?
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
also when you share macros here do this:
```js
your macro pasted here
```
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)
I honestly think Zhell would have the best answer, specially since your macro has no midi references, they love that stuff in #macro-polo
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...
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
to the left of the hotbar is a folder icon, click on that then create a new macro
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
like so?
open it and show me it
refresh your browser
to be clear that is only going to work if you use midi damage application
yeah I noticed the damage application
either manual or auto, but only damage dealt to the druid via the checkmark button will trigger it
install Effect macro also
actor.update({'system.attributes.hp.temp': 0});
ON deleition to cover early exit of symbiotic on purpose by the druid
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
Just working through these now
I can probably just give you the item in a dm if you want it
Hmm I think something like this for light is OK no?
Where can I find this?
Lukas was the one who wanted it, I was ok with janky 8)
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
Yes please!
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)
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
True! Credit when credit is due!
just don't pick No or Yes 😉
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
What would be a logical max for dim and bright light 🤔 ?
I don't think you change the dim/bright in Light do you?
can it be changed while its still active?
It's meant to be infrastructure for user to do whatever
Light SRD will be light 40/20
light cantrip is 40/20
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?
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
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
I just used Math.floor(canvas.scene.dimensions.width/2) to be sure 🤣
I know of no lightsource larger than 60/60
oh well
that reminds me of the laptop driver bug lol
just looking at a still image of that needs a warning for hypersensitivity
oh shit I was joking lmao
Hypersensitivity warning 😄
looked like the disco scene from john wick, lights flashing everywhere
@vast bane https://gitlab.com/tposney/midi-qol/-/issues/1218 I opened a github issue, if you want to add to it. In case I missed something.
noFlanking FTW 😄
They need all the help they can get. LOL!
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?
Turn off and on? 😄
don't use an ae
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
my players and I have no Performance issues. So changing the question, is there an effect that adds Expertise to you?
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.
I will give you the same answer you'd get in the channel it should be asked in, mod the sheet directly for permanent changes to sheets. AE's add up over time. they are meant for temporary things or for putting flags on the actor that aren't in the default sheet.
dont bind your logic on instanceof if midi is involved -- serialized classes are just objects
thank you
sure thing!
Zhell gave me that, I don't even know what it does
the source doesnt matter, just letting you know
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
... you can adjust proficiencies with active effects?
add prof*2, but you shouldn't
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
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
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.
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.
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!"};
}
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
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;
}, {})
});
😄
I get this lol
document.querySelector O_o
no more dialogs
Its a lukas wishlist
yeah that initial one got expanded...
have him gussy up the dialog for you like he did for chris's dialogs ;p
god I think I just showed my age
got both to have everyone happy
jQuery 😠
Ah, great examples, thanks both of you
Go to Item Macro's settings in Foundry, and uncheck the Sheet Hooks option
ah is it that simple :D?
One of the most common issues when using macros (in Item Macros) with MidiQOL
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?
Thank you for the clarification. I'll have to learn all the new terminology as I go.
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
Is that fixed now?
Well it is a fill the gaps situation, but should be doable. If not, will check again later 😉
The arg array. What information is accessible in there? I've not managed to find a list of what the different indexes contain.
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
Thanks. Found the last arg contents.
Oh, that would also do it. Great.
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
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.
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.
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?
Yes. The first part is an itemmacro on use.
The item will need to transfer an effect on the target
When that effect is deleted, the off will fire
The effect needs to be different depending on the chosen option.
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
You had the macro already from #macro-polo
Yes, I put that into the upper section. It isn't getting that far because of the arg[0] is undefined thing.
Do you have item macro sheet hooks option checked maybe?
In the Item Macro module settings
I do. I've now turned it off.
Should be good to go now
Thanks.
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
What condition resistance are you trying to setup?
@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).
So, it's now applying the active effect, but it's not calling the item macro. I've added an itemMacro field to the effect, but don't know how to fill out the custom box.
Share a screen shot
Of your setup
This is the effect tab of the effect that the spell applies:
Should be good
I don't know what the effect value needs to be to call the macro.
And what is the macro?
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...
AFK but glad to hear that it works 💪
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?
No worries. Respond if and when you can and want. And thank you for your help 😄
The off should be triggered when you delete the AE no matter how you do that
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)
Copy the key from Fey Ancestry and change charmed to prone
It should work
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?
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!
Target details on the item should be 120 ft creature
Range blank blank Special
DAE on the item to apply Blindness
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.
And the revert message is occurring, however the effect isn't actually reverting.
whoa! Thanks! I almost can not believe it that simple 😅
you didnt name the mutation when initially applied, so it can't find the requested one to revert
That makes sense. How do I set the name?
That worked, but now I'm getting an undefined, so my name-test is failing.
in the options argument: https://trioderegion.github.io/warpgate/warpgate.html#.mutate
{name: mutName}
Thanks. Bookmarked.
It's telling me that mutName is not defined, even though it's a const aat the very top of the macro.
const mutName = "enlarge/reduce";
await warpgate.mutate(target.document, {name: mutName, token:{width: newTokenSize, height: newTokenSize}});
Missed a few parameters there
look closer at the api -- the options are the 4th argument
await warpgate.mutate(
target.document,
{},
{},
{name: "Steve"}
);
await warpgate.mutate(
target.document,
updatesObject,
{},
{name: "Badger"}
);
I see. Changing.
(just to slightly expand to the use case here)
So it's a script-off
When one starts speakin warpgate a whole new world opens up
Thanks again. The revert is now working.
Now just to try and fix getting that effect...
Do you have the AE set as transfer to actor on item equip maybe?
Yes
For now
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.
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
Ah, of course.
EDIT: Still failed.
That will be very handy indeed. I'll go get it.
Did you mean Developer Mode?
Yeah probably 🤷♂️
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?
Once per round for instance or effect expiry?
not sure, what you are asking, sorry 😅
He is asking for examples.
Effect expiration during combat is times up module alley for instance
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
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.
That isn't how you update a document
And, as expected, it's wrong.
Can't help you with midi. But Flix has a pin in #macro-polo for basics such as these.
Thank you. I'll go find it.
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.
and warpgate can apply those AEs as well, if that is easier
Well you've sure not made it easy for yourself heh
Absolutely true, but I'll figure it out. Once I've got a few working examples and experience to draw from, I should be able to manage.
the warpgate wiki has a bunch of examples
I'm applying the AE in order to call the macro, so I just need to update it, not create a whole new one. I'll try and keep it in mind if I need it otherwise.
deepClone the array, change it, update the effect with new array
warpgate can do that as well, but core API works perfectly fine too
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"
lets back way up -- where is this effect held?
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.
Just update the effect. Not the... canvas?
effect.updateEmbeddedDocuements?
and you need to modify the effect right after creation?
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
Yes, because the spell can either enlarge or reduce, and both do different things to the character.
that's what i was missing -- simply have the macro create the appropriate AE on the target
instead of jumping through hoops to modify it after the fact
why disadvantage? the creature has truesight 😦
Thank you. I understand how that works.