#MidiQOL

1 messages Β· Page 43 of 1

vast bane
#

The side bar actor not the summoned one

#

actorS

#

though since theres two errors I bet you the mistake was made on both actors

covert mason
#

Right, the side actor is missing the Radiant Mace - Healing (Defender Only) feature facepalmpicard

#

Hold up, I'll add that and test it.

vast bane
#

it could be the name and the part for the error maybe

#

either that or theres another issue

#

cause it doesn't do the error twice for the same thing

covert mason
#

Okay, here we go.

dark canopy
#

No, AM caused that problem months ago

vast bane
covert mason
vast bane
#

we can't troublleshoot it till we see the actor Janner its a comparison problem

#

oh shit sorry missed the message

dark canopy
vast bane
vast bane
dark canopy
#

Other execution methods, like midi, might

covert mason
#

I thought the macro modified the existing Celestial Spirit into either an Avenger or Defender

vast bane
#

Folder macro, change tokenActor to actor

const tokenActor = token?.actor ?? game.user.character;
const effects = tokenActor.effects.filter(i => i.isTemporary).reduce((acc, e) => acc += `
  <div class="form-group">
    <label for="${e.id}">${e.label}</label>
    <div class="form-fields"><input type="checkbox" id="${e.id}" /></div>
  </div><hr>`, ``);
const content = `<form>${effects}</form>`;
const title = "Delete effects";
const buttons = {del: {
  icon: `<i class="fas fa-check"></i>`,
  label: "Delete!",
  callback: async (html) => {
    const selected = html[0].querySelectorAll("input[type=checkbox]:checked");
    const deleteIds = [];
    for(let s of selected) deleteIds.push(s.id);
    await tokenActor.deleteEmbeddedDocuments("ActiveEffect", deleteIds);
  }
}};
new Dialog({content, title, buttons, default: "del"}).render(true);
dark canopy
#

Eww, just: const actor = "foo"

vast bane
#

Zhell originall wrote it, but I believe bugbear helped v10ify it

dark canopy
#

Anyway, not able to touch foundry right now. If that is broken, I'll report a bug in a few days

vast bane
#

it works fine with advanced macros enabled with the first and 4th to last lines using "actor"

#

no no no its not broken, its only broken if you don't have advanced macros installed, and change the two tokenActor to actor

dark canopy
#

Are you using midi?

#

To execute this?

vast bane
#

yes, but this is a folder macro isn't it?

dark canopy
#

I don't know what a folder macro is

vast bane
#

no its a macro to delete effects on tokens, zhell would NEVEr make a midi macro hehe

dark canopy
#

And it's not core

vast bane
#

hotbar macro

dark canopy
#

Cool

#

Should be easy and if it don't work I'll figure out why and report

vast bane
#

I had asked him like 8 months ago to make a macro that lets me select a token and it reads out all the temp effects and lets me checkbox and delete em

#

its just a weird example of v10 and defining actor

dark canopy
#

I will not allow AM to be a "fix" for anything, lolol

vast bane
#

me either, so bugbear told me to change it to tokenActor

#

as the macro stands right now as I pasted it, it works no matter what

vast bane
#

its only when you change it

violet meadow
#

I have no access to foundry rn. It will be a couple of days before I do.
This is a conversation I remembered

dark canopy
#

Nothing in that post or code should be stopping this

vast bane
#

you had asked for an example of const actor = causing an error, if you take my script and put actor in tokenActors spot you will see the error

#

or I misunderstood what you asked

dark canopy
#

No I got the example and it must be a bug. I'll figure out why and log it

vast bane
dark canopy
#

The easiest thing is just wrapping the code in brackets to create a new scope

#

In the short term

vast bane
#

Zhell writes so many macros it was like 8 months ago before v10 was even a thing so he didn't know to do it

#

I just came to the discord with the problem and bugbear caught it

#

after my v10 update it was when it started hitting

dark canopy
#

Sure

#

This isn't about zhells macro

vast bane
#

So thats why I chimed in here when I saw him defining actor in the first line

#

but he is using advanced macros so it will work, but if he ever doesn't use it anymore, that macro will throw the v10 thing

molten solar
old yew
#

Anybody know whether it's possible to do any of the following?

  • Have a weapon's damage reduce the target's max hp
  • Have a weapon use a different AC calculation to determine hits
  • Have a weapon do additional damage to certain creature types
vast bane
covert mason
#

Yeah. I still can't get the thing to work πŸ˜‚

dark canopy
#

Wrap it in brackets

vast bane
dark canopy
#

Fixed

molten solar
spice kraken
#

STEVE!

molten solar
#

To the rescue. 😎

vast bane
covert mason
molten solar
#

Also babini for (3)

vast bane
#

Celestial Avenger and Celestial Defender

covert mason
#

It uses a template Spiritual Badger and modifies it upon summoning it, it looks like.

vast bane
#

Janner, you name 2 actors in it, is there a Celestial Defender and Avenger in the side bar?

covert mason
#

No, just a Celestial Spirit

vast bane
#

isn't that a problem then?

vast bane
covert mason
#

I'll make an Avenger and Defender alongside the regular Celestial Spirit--see if that works any

violet meadow
vast bane
#

anyone curious where its from, its the Maurezhi's bite attack

old yew
vast bane
#

in midi its kinda ok to mod max hp, but it might be wiser to use temp max hp

covert mason
covert mason
vast bane
#

are there spaces between Radiant BowX(Avenger Only)? is there a space where X is or not?

covert mason
#

Yup

vast bane
#

Same with the spaces around the dash in radiant mace - healing

covert mason
#

Yup!

vast bane
covert mason
#

The macro changes the original Celestial Spirit template to be either an Avenger or Defender

vast bane
#

man I still think its actually wrong lol

covert mason
#

I should just pay someone to automate this spell VeryWeary

vast bane
#

someone has to look at it again, in the mutates hes calling the actor Celestial Defender and Celestial Avenger, and then its summoning Celestial Spirit

#

are you absolutely sure that the token is unlinked

molten solar
#

Good lord what is that token config

covert mason
vast bane
#

oh wait

#

Janner you are using actor

#

HAH

spice kraken
#

Looks like Token Z, Patrol, Lasers, Swarm(s), Health Estimate. I think that's all?

vast bane
#

janner you defined actor in line one, and then you are trying to change actor in the mutation

spice kraken
#

Still a lot

vast bane
#

so its trying to change whatever line 1 is defined as in the data

violet meadow
#

Does the sidebar actor have any weapons currently on them?

molten solar
#

Tagger as well

vast bane
#

he has images above of the actor disregard the names on the actors

molten solar
#

MTB as well? Amazing

vast bane
#

I think I am right though

#

hes defining actor as the name of the source actor

vast bane
#

and then trying to change "actor"

violet meadow
#

With proper types?

molten solar
#

Alright alright, post the current version?

vast bane
#

I feel like I'm so right right now, just sayin

covert mason
#

I'll just post the item and actor jsons here πŸ˜…

molten solar
#

eh I don't feel like importing stuff but I got vscode open

violet meadow
#

Wont help me at all. On the phone. Are the weapons and the multiattack correctly set up?

vast bane
#

its not changing multiattack its just changing the token name, actor name, and deleting items

#

but its using the term 'actor' in line 1 and then the mutation uses it

#

and line 1 is defining actor as the source actor, as in the casters name

violet meadow
covert mason
#

Here's the current code:

const item = actor.items.getName("Summon Celestial");
const [{spellLevel: level}] = args;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;

/* Prompt the user for which type of celestial to summon */
const buttonData = {
  buttons: [{
    label: 'Celestial Avenger',
    value: {
      token: { name: "Celestial Avenger" },
      actor: { name: "Celestial Avenger" },
      embedded: {
        Item: {
          "Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
          "Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
        }
      }
    }
  }, {
    label: 'Celestial Defender',
    value: {
      actor: { name: "Celestial Defender" },
      token: { name: "Celestial Defender" },
      embedded: {
        Item: {
          "Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
        }
      }
    }
  }
  ],
  title: 'Which Celestial?'
};

const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);

async function myEffectFunction(tokenDoc) {
    //prep summoning area
    new Sequence()
        .sound()
                .file("/Sounds/Combat/Ghostly_Swells*.ogg")
                .volume(0.5)
        .sound()
                .file("/Sounds/Creatures/Zombie/MON_northrendskeleton_birth_*.ogg")
                .volume(0.5)
        .effect()
                .file('jb2a.magic_signs.circle.02.necromancy.intro.blue')
                .atLocation(tokenDoc)
                .center()
                .scaleToObject(2)
                .belowTokens()
                .fadeIn(500)
                .fadeOut(500)
                .randomizeMirrorX()
                .randomizeMirrorY()
                .randomRotation()
        .effect()
                .file('animated-spell-effects-cartoon.earth.debris.03')
                .atLocation(tokenDoc)
                .center()
                .scaleToObject(4)
                .belowTokens()
                .fadeIn(500)
                .fadeOut(500)
                .randomizeMirrorX()
                .randomizeMirrorY()
                .randomRotation()
        .play();
}

const callbacks = {
    post: async (location, tokenDoc, updates, iteration) => {
        await myEffectFunction(tokenDoc);
    }
}

/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
  token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
  actor: {
    'system.attributes.ac.flat': 11 + level,
    'system.attributes.hp': { value: hp, max: hp },
  },
  embedded: {
    Item: {
      "Multiattack": {
        name: `Multiattack (${Math.floor(level / 2)} attacks)`
      },
      "Radiant Bow (Avenger Only)": {
        'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
        'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
      },
      "Healing Touch": {
        'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
      }
    }
  }
}, celestial);
await warpgate.spawn("Celestial Spirit", updates);```

It's an OnUse Item Macro.
#

Here's the details of the items.

vast bane
#

oh its healing touch guys

#

Healing touch is just "Healing Touch"

covert mason
#

WAIT

#

HOL' UP

vast bane
#

Healing Touch (1/Day) is the problem

#

on the actor its just Healing Touch

molten solar
#

missing dmg type and other stuff

vast bane
#

does it need the full entry on the damage parts?

molten solar
#

Yes

covert mason
molten solar
#
const item = actor.items.getName("Summon Celestial");
const level = item.system.level;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;

/* Prompt the user for which type of celestial to summon */
const buttonData = {
  buttons: [{
    label: 'Celestial Avenger',
    value: {
      token: { name: "Celestial Avenger" },
      actor: { name: "Celestial Avenger" },
      embedded: {
        Item: {
          "Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
          "Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
        }
      }
    }
  }, {
    label: 'Celestial Defender',
    value: {
      actor: { name: "Celestial Defender" },
      token: { name: "Celestial Defender" },
      embedded: {
        Item: {
          "Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
        }
      }
    }
  }
  ],
  title: 'Which Celestial?'
};

const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);

/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
  token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
  actor: {
    'system.attributes.ac.flat': 11 + level,
    'system.attributes.hp': { value: hp, max: hp },
  },
  embedded: {
    Item: {
      "Multiattack": {
        name: `Multiattack (${Math.floor(level / 2)} attacks)`
      },
      "Radiant Bow (Avenger Only)": {
        'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
        'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
      },
      "Healing Touch (1/Day)": {
        'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
      }
    }
  }
}, celestial);
await warpgate.spawn("Celestial Spirit", updates);
#

untested, etc etc

violet meadow
#

Why a
Avenger only 2 times?

molten solar
#

I just took a big fat assumption that it's radiant dmg

#

lol, good catch

vast bane
#

healing touch is healing not radiant but also he needs to change the name of healing touch

covert mason
#

The healing Touch is supposed to be healing I believe.

#

Yeah

vast bane
#

that might be an error in badgers wiki example

#

How on earth did you put (1/Day) in, is that from spiritual badger?

covert mason
#

Now there's te issue of it trying to prompt me infinitely to cast the spell after I've already cast it.

molten solar
#

Ah

covert mason
molten solar
#

Item Macro in Midi, good times. πŸ™‚

covert mason
#

Serves me right

molten solar
#

There

vast bane
#

what did you set the on use to for the drop down

violet meadow
#

That warpgate.dnd5e is a no no probably

molten solar
#

Just replaced it with system.level, you can figure it out from here

#

πŸ‘‹

violet meadow
#

Ah you edited it Yeap

#

const level = args[0].spellLevel

covert mason
#

So const level = item.system.level; to -

#

There we go

molten solar
#
const [{spellLevel: level}] = args;

πŸ™‚

vast bane
#

if its in an item macro isn't spellLevel already defined?

molten solar
#

No

vast bane
#

or something like that

scarlet gale
#

I normally get it from castData to account for upcasting

molten solar
#

A regular non-midi Item Macro is in fact just a complete replacer of the item's usage

covert mason
#

You guys are lifesavers. I don't know what I'd do without this server and this channel blobheart
Please forgive my ignorance

molten solar
#

The item itself is never used unless you explicitly add item.use() in the Item Macro.

#

For non-midi users anyway

vast bane
#

badgers gonna return here and watch us all slowly catch the typo and face palm

covert mason
#

Eeeeeeyup rcon_wheeze

covert mason
dull condor
#

for full automation, is there any kind of protection against players spamming rolls (either by mistake/lag or intentional)?

vast bane
#

i swear fotoply might have, it was for another summon animation?

#

you could steal that out of that item

covert mason
#

Aye, it was for an Animate Dead macro. Lemmee find it

covert mason
vast bane
#
const imgs = await game.actors.getName("Zombie").getTokenImages()
await Promise.all(imgs.map(i => loadTexture(i)));
for(let i = 0; i < 5; i++){
  const [spawn] = await warpgate.spawn("Zombie");
  new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
}
#

take the await warpgate command at the bottom of yours and put it in a defintion like line 4, and then use a new sequence

#

ignore line 3 and 6 of mine its for summoning more than 1 of the zombies, not important here

covert mason
# vast bane ```js const imgs = await game.actors.getName("Zombie").getTokenImages() await Pr...
ETC. ETC. MORE MACRO ABOVE

const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);

/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
  token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
  actor: {
    'system.attributes.ac.flat': 11 + level,
    'system.attributes.hp': { value: hp, max: hp },
  },
  embedded: {
    Item: {
      "Multiattack": {
        name: `Multiattack (${Math.floor(level / 2)} attacks)`
      },
      "Radiant Bow (Avenger Only)": {
        'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
        'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
      },
      "Healing Touch": {
        'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
      }
    }
  }
}, celestial);
const [spawn] = await warpgate.spawn("Celestial Spirit", updates);
new Sequence().effect().file("jb2a.bless.200px.intro.blue").atLocation(spawn).center().scaleToObject(2).belowTokens().fadeIn(500).fadeOut(500).play().sound().file("/Sounds/Combat/Holy/FX_Holy_Magic_Cast_Large_*.ogg").volume(0.5)```
#

Something like that?

vast bane
#

no remove the for(yada shit and the final bracket

#

thats part of danse macabres weird summoning of multiples

#

I think the final bracket is from that for line

#

so it also needs to go

#

I think the promse line that I had, is only necessary if you use wildcards

#

badger made me put that in

#

cause my zombies all have wildcards and I was getting 404 errors

#

also you can change the animation to whatever you want

#

and theres othereffects you can do in the sequence

#

wait did you use my warpgate line?

#

you were suppose to use whatever yours was

#

await warpgate.spawn("Celestial Spirit", updates);

covert mason
#

Oh. Wait. Replace which line?

vast bane
#

you can remove the await promise all images line, third to last

#

and the one above it

#

the only two lines you wanted from my sample was the bottom two

#

the const imgs is useless can remove it

#
const [spawn] = await warpgate.spawn("Celestial Spirit", updates);
new Sequence().effect().file("jb2a.misty_step.01.blue").atLocation(spawn).play()
#

wait wrong

#

I edited my example

#

but something tells me Fotoply is about to drop a better one

covert mason
#

Aye, perhaps πŸ˜‚

vast bane
#

try that one out though, I think its good

#

as long as you didn't define spawn above in the unseen macro

kind cape
#
async function preSpawn(location, updates, iteration) {
   await new Sequence()
    .effect()
    .file("jb2a.cure_wounds.400px.blue")
    .atLocation(location)
    .waitUntilFinished(-500)
    .fadeIn(100)
  .effect()
    .file("jb2a.misty_step.01.blue")
    .atLocation(location)
    .fadeOut(400)
  .play()
  }

  await warpgate.spawn("Celestial Spirit", {}, {pre:preSpawn});
#

This looks pretty fancy

covert mason
#

Oooh

#

Thhat does look fancy

kind cape
covert mason
kind cape
#

Might want to add a .scaleToToken on them depending on how big your token is

#

Should just be replacing the last line
await warpgate.spawn("Celestial Spirit", updates);
With what I sent

covert mason
#

All righty!

covert mason
#
const item = actor.items.getName("Summon Celestial");
const [{spellLevel: level}] = args;
const summonerDc = actor.system.attributes.spelldc;
const summonerAttack = summonerDc - 8;

/* Prompt the user for which type of celestial to summon */
const buttonData = {
  buttons: [{
    label: 'Celestial Avenger',
    value: {
      token: { name: "Celestial Avenger" },
      actor: { name: "Celestial Avenger" },
      embedded: {
        Item: {
          "Radiant Mace (Defender Only)": warpgate.CONST.DELETE,
          "Radiant Mace - Healing (Defender Only)": warpgate.CONST.DELETE,
        }
      }
    }
  }, {
    label: 'Celestial Defender',
    value: {
      actor: { name: "Celestial Defender" },
      token: { name: "Celestial Defender" },
      embedded: {
        Item: {
          "Radiant Bow (Avenger Only)": warpgate.CONST.DELETE
        }
      }
    }
  }
  ],
  title: 'Which Celestial?'
};

const celestial = await warpgate.buttonDialog(buttonData);
const hp = 40 + 10 * (level - 4);

const callbacks = {
    post: async (location, tokenDoc, updates, iteration) => {
        await myEffectFunction(tokenDoc);
    }
}

/* Craft the updates that are common to all celestials */
const updates = foundry.utils.mergeObject({
  token: { "displayName": CONST.TOKEN_DISPLAY_MODES.HOVER },
  actor: {
    'system.attributes.ac.flat': 11 + level,
    'system.attributes.hp': { value: hp, max: hp },
  },
  embedded: {
    Item: {
      "Multiattack": {
        name: `Multiattack (${Math.floor(level / 2)} attacks)`
      },
      "Radiant Bow (Avenger Only)": {
        'system.damage.parts': [[`2d6 + 2 + ${level}`, "radiant"]],
        'system.attackBonus': `- @mod - @prof + ${summonerAttack}`,
      },
      "Healing Touch": {
        'system.damage.parts': [[`2d8 + ${level}`, "healing"]]
      }
    }
  }
}, celestial);
async function preSpawn(location, updates, iteration) {
   await new Sequence()
    .sound()
      .file("/Sounds/Combat/Holy/Holy_Swell.ogg")
      .volume(0.5)
    .effect()
      .file("jb2a.divine_smite.caster.blueyellow")
      .atLocation(location)
      .scaleToObject(3)
      .waitUntilFinished(-500)
      .fadeIn(100)
    .sound()
      .file("/Sounds/Combat/Holy/FX_Holy_Magic_Cast_Large_*.ogg")
      .volume(0.5)
    .effect()
      .file("jb2a.explosion.blueyellow.0")
      .atLocation(location)
      .scaleToObject(4)
  .play()
  }

  await warpgate.spawn("Celestial Spirit", {}, {pre:preSpawn});```
covert mason
molten solar
#

Yep, same as any change on an actor.

vast bane
#

Where the flat ac value is(btw that should not be flat they can't get bonuses if you set to flat) remove it properly, and then seeing as how its in the actor, find the actor entries of the two and define the ac on both of them there

#

you could probably xcopy it into the one who doesn't have the bonus to ac

covert mason
#

All righty. I think I've fixed the AC issue

covert mason
vast bane
#
actor: { name: "Celestial Avenger", 'system.attributes.ac.flat': 11 + level }

I think, but I think you should use natural armor but I dunno how that looks in macros

covert mason
#

Aye, I'll use Natural armor

vast bane
#

maybe fotoply typoed the last line? why does it say pre:preSpawn?

#

why is there a empty {} at the last line too

scarlet gale
#

Because takes multiple arguments.

#

Pretty sure updates should be there I think

covert mason
scarlet gale
#

Change {} to updates

covert mason
#

That fixed it. Awesome. πŸ˜„

#

Thank you so much

chrome gale
#

dynamic effects - custom duration -
Is there a way of making an effect last until the actor is healed at all? Unfortunately the custom durations cover all damage types, but doesn't include the healing type

kind cape
vast bane
wheat marten
#

Heya! Got this error after updating to latest version of Foundry:

#

Would anyone know what is causing the issue?

vast bane
wheat marten
#

Don't have either of those

vast bane
#

disable all modules except for socketlib and libwrapper and repeat the steps to reproduce the error I guess

#

I may have forgotten a roller

#

Socketlib, libwrapper, and midiqol

#

is this via installing the module?

#

were you installing manually?

wheat marten
#

I am using Forge, so installing directly from the bazaar

vast bane
#

what version of foundry do you have installed

#

and what version of midiqol

#

aaand what version of dnd5e

wheat marten
#

Latest version of all of that

vast bane
#

version numbers please

wheat marten
#

MIDI: 10.0.23
DnD: 2.0.3
Foundry: V. 10, Patch 6, build 291

vast bane
#

and the error is outside the game o rinside the game?

wheat marten
#

Inside the game

#

Whenever I try to for example cast a spell on a create I've set to auto-save

vast bane
#

ok, so you will ned to find the culprit, but I really think you should revisit my list above cause it sounds like one of those are installed

#

if you have find the culprit module run it with socketlib and libwrapper turned on from the start

#

and midiqol

wheat marten
#

Aye, will try that! Thanks for the help

wheat marten
#

Apparently my MIDI had gone haywire

#

Reinstalling it fixed the issue

vast bane
#

I am getting this error with my push feature:

const attacker = canvas.tokens.get(args[0].tokenId);
const target = fromUuidSync(args[0].hitTargetUuids[0]).object;
const knockBackFt = 5;
const knockBackFactor = knockBackFt / canvas.dimensions.distance;
const ray = new Ray(attacker.center, target.center);
const knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle))); //for 5/5/5 grids.
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
const isAllowedLocation = canvas.effects.visibility.testVisibility({x: newCenter.x, y: newCenter.y}, {object: target}); //might have an issue with going through walls based on some vision settings...
if(!isAllowedLocation) return ChatMessage.create({content: `${targetToken.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
const mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
rough prism
#

is there a way to grant advantage only to a specific actor using active effect flags?

vast bane
#

vow of enmity?

rough prism
#

yes xD

vast bane
#

I'm curious if the new evaluation in the effect value makes vow of enmity alot simpler

#

something like an effect macro that edits the dae effect value with the targets name

#

might even be simpler than that. could be as simple as args = @target.actor.name or something

#

or work it backwards, use a grant advantage and have the effect value be attack=paladins name

rough prism
vast bane
#

the effect value in the midi flags can be an evaluation that equals true or false

#

0 and 1 are just the simplest ways to do it

#

theres no documentation on what you can put in there but bugbear says its basically the same as the documentation on activation conditions in midi's readme

#

if no token is defined, in an activation condition target is assumed, you can also set them with target/source

#

for various ideas for evaluations you can look at midisrd and midi sample items for activation conditions, usually in weapons

rough prism
#

ah! I feel this is a very important thing that should be written somewhere xD

vast bane
#

I think it might be simpler to do the grant flag on the bad guy, and then have it use the paladins name to check in the evaluation since the pally's name is simpler to define

rough prism
#

yes I agree

vast bane
#

if you are really lucky, a couple experts might catch these comments and decide to flex some code on us

chrome gale
scarlet gale
vast bane
scarlet gale
#

Did you hit any targets when that error was thrown?

vast bane
#

I'm deploying the push in an active effect with the key macro.itemmacro

scarlet gale
#

Did you have any targets selected?

vast bane
#

maybe it was glitched, I just reset targets and get two errors now

scarlet gale
#

What version of advanced macros are you on?

#

And is this macro running as GM?

vast bane
#

its not running as a GM

dark canopy
#

As usual, log out the args and double check

scarlet gale
#

slap a console.log(args) at the top and run again

vast bane
#

hang on this was all done in macro polo

scarlet gale
#

Pretty sure your hitTargetUuids is empty

vast bane
#

I'll do a fresh args here though

#

yeah zhell and freeze thought that dae or item macro don't use that or something

scarlet gale
#

If it's a save ability, you should just be using targetUuids if that exists

vast bane
#

1.19.3 advanced macros

scarlet gale
#

That's why

vast bane
#

they told me to change args to 1 instead of 0 and then there were more issues

scarlet gale
#

Yep

#

Why is this not just a regular itemMacro?

vast bane
#

cause it only applies on save failure

#

and I didn't know any other way to do it

scarlet gale
#

You can have the macro check if the save failed

#

if (args[0].failedSaves.length != 1) return;

#

Assuming this is a single target ability

vast bane
#

yes single target, but do I add that to the original or do I have to do more editing?

scarlet gale
#

I'll look it over

vast bane
#

do I still keep the args 1 change?

scarlet gale
#

one moment

vast bane
#

I really appreciate the help

scarlet gale
#

What's the save supposed to be

#

Just like a str save or something?

vast bane
#

fwiw its the Martial Arts Adept feature

#

every unarmed strike by the creature rolls a d4 and depending on the result applies something. I have it all setup in advantage reminder but I just couldn't convert the push macro I had for it

scarlet gale
#
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle)));
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
let isAllowedLocation = canvas.effects.visibility.testVisibility({x: newCenter.x, y: newCenter.y}, {object: target});
if(!isAllowedLocation) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
#

My testing doesn't have the wall checking part working for me

#

It just gets moved through the wall anyways

#

Β―_(ツ)_/Β―

#

But I don't know how canvas.effects.visibility.testVisibility is supposed to work.

violet meadow
#

It does due to visibility

#

Do you have 0 vision?

#

Or a sense that goes through walls?

scarlet gale
#

Vison enabled with 0 as the vision range

#

the map I was testing has global illumination on

#

So it might just be that

#

Either way, try the above macro @vast bane

#

Run as an item macro

#

Does Foundry have a function to check if a ray collides with a wall?

#

Just found canvas.walls.checkCollision as a function.

vast bane
scarlet gale
#

Testing some native Foundry functions to see if I can find one that works better then checking the vison of the destination

vast bane
scarlet gale
#

This was something I've been wanting to figure out anyways

#

For other uses

scarlet gale
#

@vast bane

let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let knockbackPixels = knockBackFactor * canvas.grid.size * (Math.abs(1/Math.cos(ray.angle)));
let newCenter = ray.project((ray.distance + knockbackPixels)/ray.distance);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})
#

This one uses Foundry's wall detection, should work better.

vast bane
scarlet gale
#

uh

#

hmm

vast bane
#

Thats good

#

its working

#

however, its spoiling the name I think which I dunno if you can fix that

scarlet gale
#

It's actually not working for me in a spot it should be

#

let me do more testing lol

#

The chat message can just be removed

vast bane
#

yeah just moved around and its not working

scarlet gale
#

That was there in the original macro

vast bane
#

I think its detecting the wall to the side

scarlet gale
#

I get the feeling the original one didn't work going downward

#
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(2);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if (hitsWall) return ChatMessage.create({content: `${target.name} hits a wall`});
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
#

This seems to be working better

#
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(2);
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if (hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
If you don't want it to have a chat message.
#

actually

#

I need to change one thing it seems

#

It works as long as they're within 5 feet

vast bane
#

That actually works for the monster I'm using since they only have 5ft reach

scarlet gale
#
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(1 + (canvas.dimensions.size / ray.distance));
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```
Now I think this should work correctly.
#

Even if the target is more than 5 ft away

#

This will move it 1 grid, not bothering with checking if it's 5 feet

#

I don't think checking the grid size will change anything, since it's snapping to the grid anyway

#
let workflow = args[0].workflow;
if (workflow.failedSaves.size != 1) return;
let attacker = workflow.token;
let target = workflow.targets.first();
let knockBackFt = 5;
let knockBackFactor = knockBackFt / canvas.dimensions.distance;
let ray = new Ray(attacker.center, target.center);
let newCenter = ray.project(1 + ((canvas.dimensions.size * knockBackFactor) / ray.distance));
let hitsWall = target.checkCollision(newCenter, {origin: ray.A, type: "move", mode: "any"});
if(hitsWall) return;
newCenter = canvas.grid.getSnappedPosition(newCenter.x - target.w / 2, newCenter.y - target.h / 2, 1);
let mutationData = { token: {x: newCenter.x, y: newCenter.y}};
await warpgate.mutate(target.document, mutationData, {}, {permanent: true})```

This would take into account the grid size.  But I don't think it'll do anything differently unless you're on gridless.
vast bane
#

I really appreciate the help, I thought for sure I was just a few typos away from having it lol guess I was way off!

scarlet gale
#

Ehh

#

I totally reworked it

#

The original macro was checking visibility, actually checking for walls makes more sense imo

#

That last one is actually useful now that I think about it. You can change knockBackFt to the desired feet to be moved away instead of a set 1 grid. I'm sure there are other features that can move stuff more than 5 feet.

spring dove
#

Roll Other Damage: [10] 20 on the Attack Roll, Not Construct or Undead
Is this it? This seems to deal extra damage when the attack roll is a 20. Is there a way for this to check the target's AC, and roll extra damage when the attack roll is +10 higher than the target's AC?

#

Also, is there a midi flag for limiting Dexterity modifier to AC? I know medium armor has it as a setting, but some shields I have in my brew have a similar dex limit

vast bane
vast bane
#

cole's post in dnd5e's channel will tell you the exact syntax for that

spring dove
#

It's blank. Is this in the DDB items?

#

the lifestealing sword

vast bane
#

midi sample items, Sword of lifestealing, and midi items in general some automated ones will have code in the activation condition field on the items details tab

spring dove
#

ah ha

vast bane
#

There are probably better examples, and I swear to god bugbear a very long time ago made a drow poison item that failed by more than 5, and that would be waaaay more like the item you want but I can't find it so when he made it, he never used the words drow or poison in it

spring dove
#

rats

vast bane
#

I really really wish discord search allowed for searching in the code

#

so many things could be found so easily

spring dove
#

no joke, that's super annoying

vast bane
#

activation conditions, and also the effect value on midi flags, is basically an equation that has to evaluate as true

spring dove
#

So this line
workflow.diceRoll === 20 && !(["construct", "undead"].includes(raceOrType)) && item.attunement !== CONFIG.DND5E.attunementTypes.REQUIRED
Help me understand each part so I can modify it. I only want the dice roll check to be +10 more than AC, then roll another weapon damage dice

vast bane
#

ooh wait, bonus damage might need a macro, ugh I got dual sessions this week I can't dive deep into anything here bud I hope I got you part of the way

spring dove
#

ooooh there's an Item Macro too

#

Yeah, it's a good start. Thanks Moto

scarlet gale
#

I feel like it should be something like:
workflow.attackTotal - 10 >= workflow.targets.first().actor.system.attributes.ac

#

I don't mess with activation conditions much, but this may work

#

Let me actually test it

spring dove
#

ok

scarlet gale
#

EC?

spring dove
#

yeah, the flag doesn't tell me what EC stands for

vast bane
#

check calego's post in dnd5e maybe?

#

either that or select a token and do _token.actor

#

in the console

scarlet gale
#

I don't see that as a field

vast bane
#

and try to follow the rabbit hole with system, attributes, ac, yada

#

there are keys in dae that do nothing btw, its kinda like mod authors register them I think with tposney and he adds them?

#

thats why half of ate's keys right now don't auto complete, dae hasn't updated since ATE went v10 official

dark canopy
spring dove
dark canopy
#

Yea, no clue. Module garbage probably

spring dove
#

Gotcha

dark canopy
#

Not core at all

spring dove
#

moto, I found the flag for limiting dex. It's attributes.ac.dex

vast bane
#

yeah it is funny though that there are modules parading as dnd5e flags, theres a bunch of them in there, wouldn't the wiser thing be to use different flag naming to not confuse with dnd5e?

dark canopy
#

Depends

vast bane
#

I'm banking on the fact that whatever world you are making your shield in has DAE installed as I think core doesn't let you do +attributes.ac.dex but dae would allow it

spring dove
#

yeah we've got DAE. I'll do it there

spring dove
scarlet gale
#

Fixing it now

#

Testing to see what works or not lol

#

I don't normally ever mess with activation conditions

spring dove
#

I don't either

#

way out of my depth here

vast bane
#

@covert mason
Step 1. Create a compendium that is specifically setup to store all of your various future "Macro.createitem" items. As you don't want to mess with them or random shit will start to break.
Step 2. Download both of these items and import them into the side bar. I personally put both of them in the special createitem compendium, but technically only "Scorching Rays" needs to go in it.
Step 3. Edit "Scorching Ray" and go to the effect value on the active effect, Drag and drop the "Scorching Rays" feature into the effect value. Do not confuse the two items here.
Step 4. If you have VAE, ask me if you want the button to appear in VAE otherwise ignore the rest of this.

#

oh shit step 2: If theres something already in it, DELETE IT(the effect value, its my UUID which I think breaks when we import/export

#

maybe one of the pros can clarify that but I'm pretty sure the UUID's are unique to server/sessions

scarlet gale
#

You'll need to update the UUID in the macro.createItem by re-dragging it from the compendium to that field

#

But that's about it

vast bane
#

prolly should have cleared it before I sent it, oh well he'lll figure it out

scarlet gale
#

workflow.attackTotal - 10 >= workflow.targets.first().actor.system.attributes.ac.value

#

There

#

@spring dove

spring dove
#

thanks!

#

Where do I input what damage it will roll?

scarlet gale
#

in the other damage field

spring dove
#

awesome, thank you so much

covert mason
scarlet gale
#

That's technically fine

#

But you'll very quickly have a disorganized mess of items

#

Plus run the chance of accidently deleting it

#

Compendiums are tucked away a bit

spring dove
#

hmm, so it's not working as I expected.

scarlet gale
#

how so?

spring dove
vast bane
scarlet gale
#

What's your midi setting for roll other damage?

covert mason
#

Oh, no no this is fine

#

I think I understand how this works now

spring dove
#

Do you mean on the weapon?

scarlet gale
#

What's the AC of the target?

spring dove
#

The AC of that target was 0

vast bane
# covert mason I think I understand how this works now

if you upcast the scorching ray spell, it will change the charges on the scorching rays feature, I don't see any value in the feature being an at will, other than it being in the spells tab if they use their sheet to roll

scarlet gale
#

What do you have this set to?

vast bane
#

@covert mason I think I might have modified that for circlet of blasting make sure I'm not overriding the to hit on the spell

spring dove
#

It was "if Save Present"

scarlet gale
#

Does it work after changing that?

spring dove
#

testing now

scarlet gale
#

It appears to work for me

spring dove
#

yep! works perfectly

covert mason
#

Now all I need is a wee ui notification telling them it's been added to their at-will spells.

vast bane
#

I've started doing all my temp items with buttons in VAE tooltips

#

Yours probably has it setup but its poitning to a folder macro that doesn't exist

#

so you'd have to remake it

scarlet gale
violet meadow
#

@vast bane I saw you were talking about EC flags. That's Challenge Mode Armor Class related.
Check midi readme. EC stands for Evasion Class.

violet meadow
violet meadow
covert mason
#

I'm trying to add an effect filter to my Levitate effect, and I'm trying to use Effect Macro to achieve this.
On Effect Creation:

let params =
    [{
        filterType: "transform",
        filterId: "dodgeStance",
        padding: 50,
        animated:
        {
            translationX:
            {
                animType: "sinOscillation",
                val1: -0.05,
                val2: +0.05,
                loopDuration: 6000,
            },
            translationY:
            {
                animType: "cosOscillation",
                val1: -0.05,
                val2: +0.05,
                loopDuration: 4000,
            }
        }
    }];

TokenMagic.addUpdateFiltersOnSelected(params);```
On Effect Deletion
```js
TokenMagic.deleteFiltersOnSelected();```
How can I ensure that it's only the token with the effect on it that's affected by these? Anything that can be improved here?
vast bane
violet meadow
vast bane
violet meadow
#

Maybe? that's for a hit though

covert mason
vast bane
#

You don't need TVA, its just the easier way to get a filter on the token

coarse mesa
#

I don’t suppose anyone in here has tackled Magical Inspiration yet? I’m guessing it would use an optional bonus and therefore the DSN base dice won’t roll again 😝

vast bane
#

I think it was chris

scarlet gale
#

It's pretty simple to do with optional bonus flags

vast bane
#

its not an overall add, it adds to 1 target if you use it on a fireball

coarse mesa
#

If a creature has a Bardic Inspiration die from you and casts a spell that restores hit points or deals damage, the creature can roll that die and choose a target affected by the spell. Add the number rolled as a bonus to the hit points regained or the damage dealt. The Bardic Inspiration die is then lost.

scarlet gale
#

Ah

vast bane
#

so it gets messy

scarlet gale
#

I need to update mine for that

vast bane
#

If I had a bard, I'd prbably just rule it as the unearthed arcana version and let it roll

#

but probably block it for magic missile lol

scarlet gale
#

I'll look at that tonight when I'm back from work

#

I got a few bards

vast bane
#

I swear someone did something, I thought was you, might have been another user, tposney responded to them so you could probably search his messages

scarlet gale
#

Was me for a similar feature

vast bane
#

Some sort of snag in picking a target out of the group

scarlet gale
#

I didn't post yet however

covert mason
vast bane
#

the macro lets you easily create and save them

#

and then when you do macro.tokenmagic the created ones show up there(in a dae key)

#

cause the old tmfx method was a pita to save new versions

covert mason
#

So-... wait, hold on

vast bane
#

I have a guest player coming tomorrow night who wants to play a level 10 battlemaster fighter but I have no idea if they are going to flake out on us or not, trying to decide if I really want to go through MASIF and v10ify his work just for a potential no show

scarlet gale
#

The ones from that flag are just the saved presets

covert mason
#

...I'm a little bit confused. How do I use this editor macro to achieve what I'm trying to do?

scarlet gale
#

That macro he shared let's you add more

#

In an easier to use way

vast bane
#

The lil mouse looking icon on the top bar is the "add new preset" button

covert mason
#

All righty. I've made a preset

#

How do I use that in an active effect?

scarlet gale
#

macro.tokenmagic

covert mason
#

Oh

#

OHHHHH

#

Oh wow, you were right, this is so simple now!

scarlet gale
#

Based on the macro you're troubleshooting in #macro-polo

covert mason
scarlet gale
#

Looks like DAE

vast bane
#

@hoary reef if you want Midi to prompt the player and yourself for saving throws with a button, you would need to install LMRTFY or Monk's tokenbar. I personally use MTB. I dunno why midi blocks the core button

hoary reef
#

i had LMRTFY

#

Now i'm trying with Tokenbar

vast bane
#

in the same place as auto check saves, theres 3 drop downs at the bottom, change them to the setting you want. I personally run MTB for all 3, but I turn mine to auto during the week when I'm idle so the players can cast on the combat dummy

hoary reef
#

This one?

vast bane
#

all three

#

the one you highlighted only works for players, the ohter two are for the DM

hoary reef
#

ahhh

#

i'll try that soon, but i have to go for now

covert mason
scarlet gale
#

You likely need to look at how it's configured.

vast bane
#

try it on a starte rhero

scarlet gale
#

NaN = not a number, so it's likely looking for something that's not set

#

I can screenshot how mine looks configured when I'm back later

#

Otherwise I'm pretty sure spell importing doesn't require a Patreon sub

covert mason
covert mason
#

I'll try installing the module and importing it

scarlet gale
#

Looks like it needs @item.level set somewhere

covert mason
#

OH

#

in the DAE

#

Duh facepalm

#

macro.itemMacro with @item.level in effects

dark canopy
covert mason
#

Also, could it be possible to change the name and icon of the summoned item depending on the damage it deals? I'd love to try my hand at having A-A recognize each name and have different colour breaths for each type of damage.

scarlet gale
#

If your have token magic fx it should change the template based on the damage type

covert mason
#

Aye, but the auto-recognition for damage types TokenMagicFX does look a little too janky for my tastes. I honestly prefer the stuff JB2A does

scarlet gale
#

Readme for that says it needs a little setup, you'll want to swap one of the first lines to use midi args

#

args[0].castData.castLevel I think

#

Actually

#

It's not using that

#

Looks like you need the spellDC

covert mason
#
const [{spellLevel: level}] = args;
const actorDc = actor.system.attributes.spelldc;```
#

Something like that?

#

For a Midi on-use item macro?

scarlet gale
#

Oh wait

#

It does

#

castdata.castLevel most likely

#

Depending if uses a scaling formula or not

covert mason
#
const spellLevel = castdata.castLevel;
const actorDc = actor.system.attributes.spelldc;```
scarlet gale
#

args[0].castData.castLevel

covert mason
# scarlet gale `args[0].castData.castLevel`
const spellLevel = args[0].castData.castLevel
const actorDc = actor.system.attributes.spelldc;

const buttonData = [
    {
        label: 'Acid',
        value: 'acid',
    },{
        label: 'Cold',
        value: 'cold'
    },{
        label: 'Fire',
        value: 'fire'
    },{
        label: 'Lightning',
        value: 'lightning'
    },{
        label: 'Poison',
        value: 'poison'
    }
];
const element = await warpgate.buttonDialog({buttons: buttonData, title: 'Target recipient and select element:'}, 'column')
if(!element) return;
const target = game.user.targets.first();
if(!target) {
    ui.notifications.warn('Please target one token to receive the ability.')
}
const abilityData = {
    "name": "Breath Weapon",
    "type": "spell",
    "img": "https://assets.forge-vtt.com/6148732b96e0aff7127b447b/Icons/Spell_Icons/Fire/T_Icon_Fire_98.webp",
    "system": {
        "activation": {
            "type": "action",
            "cost": 1
        },
        "duration": {
            "units": "inst"
        },
        "target": {
            "value": 15,
            "units": "ft",
            "type": "cone"
        },
        "range": {
            "units": "self"
        },
        "ability": "",
        "actionType": "save",
        "damage": {
            "parts": [
                [
                    "(@item.level + 1)d6",
                    element
                ]
            ]
        },
        "save": {
            "ability": "dex",
            "dc": actorDc,
            "scaling": "flat"
        },
        "level": spellLevel,
        "school": "trs",
        "preparation": {
            "mode": "atwill"
        },
    },
}
const updates = {
    embedded: {
        Item: {
            [abilityData.name]: abilityData
        }
    }
}
await warpgate.mutate(target.document, updates, {}, {name: 'Dragon\'s Breath Ability', description: `Providing an at-will spell, ${abilityData.name}, at level ${spellLevel} using ${element} damage`});```
I hit the damage buttons on the dialogue and nothing appears in the at-will spells.
vast bane
#

just copy the call lightning bugbear made with macro.createitem

scarlet gale
#

First line needs a spellLevel = in the front

scarlet gale
vast bane
#

yeah I just copied bugbears work on call lightning for my temp save items

scarlet gale
#

I should remake it as a warpgate item to avoid using a gm macro call

vast bane
#

mine doesn't use a gm macro call I don't think

scarlet gale
#

Or maybe have effect macros read a flag

vast bane
#
game.user.updateTokenTargets()
canvas.templates.placeables.at(-1)?.document.delete()
let i = 0;
while (!token.actor.items.getName("Call Lightning attack") && i < 3000) {
    console.log("Waiting for Call Lighting attack item to be created, if needed!")
    await warpgate.wait(250)
    i += 250
}
const item = token.actor.items.getName("Call Lightning attack")
const {castLevel} = effect.flags["midi-qol"].castData;
if (castLevel > 3) {
    let newItem = duplicate(item.system)
    newItem.damage.parts[0][0] = `${castLevel}d10`
    await item.update({'system.damage.parts': newItem.damage.parts})
}
dark canopy
vast bane
#

What I really like about it is that I'm able to follow how to adjust them finally, kinda feel like neo in matrix

dark canopy
#

But it looks like the midi execution is worked out?

covert mason
#

Just need to figure out how to change the breath weapon name depending on damage chosen now

dark canopy
#
"name": `Breath Weapon (${element})`,
covert mason
#

Oh! Welp, there ya' go xD

#

Simple

dark canopy
#

? hmm

vast bane
#

My biggest weakness, dialogs in macros lol

dark canopy
#

heh, yea, hence buttonDialog and menu πŸ˜… just gimme some buttons and gimme an answer

covert mason
#

Is it supposed to be

"name": "Breath Weapon (${element})",```
or
```js
"name": `Breath Weapon (${element})`,```
?
scarlet gale
covert mason
#

Oh, wait, the java script in the code tells me. πŸ˜…

obsidian orbit
#

@vast bane you’ve precisely suggested using a dfred effect to work around a complicated macro. Maybe you can help me with this?
I was able to build a macro today (with help from the community) but I would like to make a passive effect that triggers the macro whenever that actor casts a spell. Is this possible?

#

I was able to set it up on a firebolt spell as an item macro. And set it to the duration to expire on spell cast and for that one spell it’s working as desired. It applies when I cast the spell and triggers the macro. Then I have the effect on me, and it triggers again when it expires on cast of any other spell. If I could get it to automatically reapply that effect I’d probably be golden.

vast bane
#

sounds like world script territory

obsidian orbit
#

Shoot that’s what the other guy said too haha. But was unable to help me further.

scarlet gale
#

Can be done with an on use macro with midi

obsidian orbit
vast bane
#

oh yeah actor on use

obsidian orbit
#

So I can check the on use box. Set the active condition to β€œWhen casting a spell” (or something like that)?

scarlet gale
#

Then filter for the item type

obsidian orbit
#

Cool! Alright I’ll try messing with this for a while. Thanks!

scarlet gale
#

On use macros have a lot of uses. I feel like half my automations make use of it

obsidian orbit
# scarlet gale On use macros have a lot of uses. I feel like half my automations make use of i...

Are you willing to walk me through the steps this is saying?

if (this.item.type != 'spell') return;
let damageType = this.defaultDamageType;
let validTypes = ['healing', 'acid', 'fire', 'necrotic', 'posion'];
if (!validTypes.includes(damageType)) return;
let damageFormula = this.damageRoll._formula + ' + ' + this.actor.system.abilities.int.mod;
this.damageRoll = await new Roll(damageFormula).roll({async: true});
this.damageTotal = this.damageRoll.total;
this.damageRollHTML = await this.damageRoll.render();```
#

so it's checking if the target is size 0, then it's checking if they are using a spell, then...?

#

oh then it's checking if the damage is one of those types. if so then roll damage

#

then you lose me at line 6

scarlet gale
#

Sure

#

Line 6 is adding the actors int modifier to the damage formula

#

Line 7 does the roll

#

8 updates the total, and 9 rerenders it since this macro is running post damage roll

gilded yacht
obsidian orbit
#

I tested it setting up the item macro on use for firebolt and it works exactly how I want. So I could go through and apply that to every spell on the character. But if I can do this actor onUse that would be better

scarlet gale
#

Most likely want it set as a on equipped passive

obsidian orbit
#

Do I put that on a custom convenient effect with no expiry?

scarlet gale
#

Make a feature and give it a DAE effect essentially

obsidian orbit
#

the "macroPass" part, what do I do for that?

#

before attack roll, and make a second one before save?

gilded yacht
scarlet gale
#

Depends what you're doing

obsidian orbit
scarlet gale
#

The pass only really matters of your modifying a workflow from midi. Use postActiveEffects if you're not.

#

If you set it up like in tposney's screenshot you can have the macro in the item macro of the feature

vagrant bay
#

I want to tackle the 'never-or-always' broken bounded accuracy of late game expertise/advantage/observant that hinders flat DCs with traps and spells requiring Perception, Investigation, and Insight. With absurdly high DCs necessary that others couldn't possibly reach, and otherwise having to decide how to narrate and write around characters noticing everything automatically, even in dim light.
And how when choosing flat search DCs, you're basically choosing beforehand who sees and who doesn't, unless characters make a search check.

I want to make a formula bonus for passives, but I'm not sure how to format it.
The idea is this. No +/-5 from advantage/disadvantage, no double proficiency from expertise:

Expertise + Advantage: For checks, 3d20kh (min 5?) + proficiency + mod. For passives, 7 to 17 rolled 3 times keep highest + proficiency + mod.
Advantage: For checks, 2d20kh + proficiency + mod. For passives, 5 to 15 keep highest + proficiency + mod.
Neutral: For passives, 5 to 15 + proficiency + mod
Disadvantage: For checks, 2d20kl + proficiency + mod. For passives, 5 to 15 keep lowest + proficiency + mod.

Due to the level of variance making at least one character statistically likely to pass, I could implement group checks.

I was thinking a formula like this:

value = 0
adjust = 0
if (flags.midi-qol.advantage.ability.check.all == 1 || flags.midi-qol.advantage.ability.check.wis == 1) {
value += 1
adjust += 5
}
if (data.skills.prc.value) == 3 { (assuming 3 means expertise)
value += 1
adjust += @prof/2
}
if (flags.midi-qol.disadvantage.ability.check.all == 1 || flags.midi-qol.disadvantage.ability.check.wis == 1) {
value -= 1
adjust += -5
}
if (value == 2) {
[[{3d11kh, 5}kh - 4 - adjust]]
} else if (value == 1) {
[[2d11kh - 6 - adjust]]
} else if (value == -1) {
[[2d11kl - 6 - adjust]]
} else {
[[1d11 – 6 - adjust]]
}

Any insight?

obsidian orbit
#

In my macro?

scarlet gale
obsidian orbit
#

this is my macro

const dieSize = character.system.resources.primary.value;
const roll = await new Roll(`1d${dieSize}`).evaluate({async: true});
await roll.toMessage({
  flavor: `${character.name} burnout roll`,
  speaker: ChatMessage.getSpeaker({actor: character})
});
if(roll.total > 2) return;
await table.draw();
await character.update({"system.resources.primary.value": Math.max(4, dieSize - 2)});```
I can just copy `if (this.item.type != 'spell') return;` and put it at the top?
scarlet gale
#

Yep

obsidian orbit
#

ok I put it in and tested it, it is running my macro even when using a crossbow. So I didn't do it right

scarlet gale
#

Could you post what you have?

obsidian orbit
#

I must not have clicked save macro. I got it working now

scarlet gale
#

That would do it

obsidian orbit
#

@scarlet gale @gilded yacht You both are champions!!! Thank you so, soo much!

vagrant bay
# vagrant bay I want to tackle the 'never-or-always' broken bounded accuracy of late game expe...

I did receive this variance macro in this post here #macro-polo message
It creates a single effect with separately-rolled boosts for Perception, Insight, and Investigation to tokens that are selected. It could be replicated for this, but I'm not quite sure how to work the if statements and stat references in.

for(const token of canvas.tokens.controlled){
  const effect = token.actor.effects.find(e => e.getFlag("world", "randomPassive"));
  if(effect){
    await effect.delete();
    continue;
  }
  const {total} = await new Roll("3d6 - 10").evaluate({async: true});
  const changes = ["inv", "prc", "ins"].map(id => {
    return {key: `data.skills.${id}.bonuses.passive`, mode: CONST.ACTIVE_EFFECT_MODES.ADD, value: total};
  });
  const effectData = [{
    changes,
    label: "Random Bonus",
    icon: "your icon here for the effect.webp",
    "flags.world.randomPassive": true
  }];
  await token.actor.createEmbeddedDocuments("ActiveEffect", effectData);
}```
last mural
scarlet gale
#

They don't have the same data

#

The workflow has more stuff and I find easier to work with

#

such as grabbing the token

last mural
#

Ah! Can i read up somewhere on what's contained in what?

scarlet gale
#

The midi documentation kinda touches on it

#

I've just been messing with workflows long enough to notice that they contain more useful things

#

and they're formatted differently

#

for example args[0].targets is an array

#

while args[0].workflow.targets is a set

jagged bear
#

@lean stone You can!

lean stone
#

What! There's a dedicated option for that. Shame on me for not spotting that. Thanks for the heads-up!

rough prism
#

Is it possible to have midi transfer effects like Blinded or Restrained even if they do not match the name of the item rolled?

soft ravine
#

did i do this right?

opaque current
#

Yes, the setup is correct, now you just need the macro to do something!

opaque current
#

Haha, I'm afraid I don't know javascript

soft ravine
soft ravine
vast bane
pallid shard
#

Does anyone have a working version of the Swashbuckler feature Panache or do you just handle it manually?

weary rune
#

is there an easy module way of doing spell effects that remove when out of radius and apply when going into radius? I have the damage part using overtime so that's bit is ok.

rocky flax
#

Hey everyone sorry noddy question but I am having a problem with getting midi to automatically add concentration on using a spell, it still seem to check the concentration if I manually set it but it doesn't set it on casting

vast bane
rocky flax
#

Nope

vast bane
# rocky flax Nope

midiqol configure module settings>workflow button>concentration tab. If its not obvious what to change, screenshot the tab, one of us will chime in with whats messed up

rocky flax
#

Okay wait I tried it now and it works turning everything else off, I will go through and figure out what caused the issue. cheers

vast bane
#

combat utility belt and/or all the naughty rollers are probably the culprit

chrome gale
#

I'm using system.bonuses.msak.damage to give +1 to touch based spell damage, but I also want to give +1 to touch/melee ranged healing. Is there an option for this?

vast bane
#

Better rolls for 5e
Ready Set Roll
Minimal Roll Enhancements
Roll Groups
Fast Rolls by default
Fast Rolls
Dice Tooltips
retroactive advantage
Wire

All do not work with midi qol

vast bane
scarlet gale
#

Making some good progress on Magical Inspiration.

#

This is way more complicated than I thought it would be

chrome gale
#

Is there a 'radius' circle template setup which does -not- also target yourself?

vast bane
rocky flax
scarlet gale
#

Just wrapped up making Magical Inspiration. Needs some heavy testing, but I think it's pretty good to go.

#

(Requires your Bard class to have a scale set for bardic inspiration),

vast bane
#

I know it cant be simple calendar because I have midi and SC, as many of us do. Is your SC stuck in the 1.3 versions? A known bug people sit with without realizing it cause of the update button being broken

rocky flax
#

let me check

#

yeah it is still in 1.3

vast bane
#

what is your foundry build, dnd5e version, and midi qol version?

vast bane
rocky flax
#

Will try

vast bane
#

you never shared the midi settings tab for concentration

scarlet gale
#

@coarse mesa I think you were interested in magical inspiration yesterday.

vast bane
#

and the details tab of said spell

#

maybe we can spot one of the naughty rollers

rocky flax
#

It works fine now with simple calander

vast bane
#

(my list was not exhaustive)

rocky flax
#

the simple calander was just stuck in 1.3

#

and was throwing it off for some weird reason

vast bane
#

yeah but SC doesn't even touch rolling spells or concentration

coarse mesa
scarlet gale
#

Let me know if you run into any issues.

scarlet gale
#

I'm pretty sure I've done a good amount of testing

#

But there's always edge cases I could be missing.

rocky flax
coarse mesa
scarlet gale
#

Yea, it was pretty messy

#

The targeting selection dialog took me the most time lol

#

That and figuring out how to edit the damage details

coarse mesa
#

I predict WotC won’t have abilities that work like this in 5.5… now they’re in the VVT game too. Probably a good thing for everyone

#

Assuming the rules designers even talk to the devs πŸ˜†

scarlet gale
chrome gale
#

Is there a reason why this isn't working?
Character A uses spell on Enemy A.
Enemy A gets hit and gains the effect.
Character A Ends turn.
Enemy A loses effect immediately (instead of at the end of their turn)

#

I thought it might see the enemy as the 'source' instead of the target, but I tried changing to 'end of sources turn' and it makes no difference

spice kraken
#

What happens if you add rounds to the duration? Also do you have Times Up?

chrome gale
#

yes to times up

chrome gale
#

so that fixes it, but still seems like a bug (as far as I know the specials shouldn't require a regular duration as well)

spice kraken
#

The issue there is you never specified any duration to begin with. No duration for a temp effect is just gonna be removed. Passive effect wouldn't.
(works for me fine on v9)

vast bane
#

midi should respect the details duration though I think, ist the item not setup?

chrome gale
#

The duration is 'end of targets next round', I'd have thought that would be sufficient as it's a definitive time

vast bane
#

turn not round, but yeah personally I always set seconds AND rounds AND special durations

#

cause of weird totm combats

#

Like that player who casts shield to roleplay a solution to a non combat encounter or something

chrome gale
#

That's fine then I added a random limit that was longer than it needed to be

#

I just assumed it was a bug

vast bane
#

So last night was my first night running my humanoid randomizer. It works great, but it was utterly hilarious to have the Giff recieve a -5 to his dex mod as a gunner. His dc for his handgrenade was 19, but all of his gunshots were dex based and had no positive bonus it was comical. I still love it, adds to the flavor of humanoids in battle. Just need to scan their randomization before I go to play them lol.

tropic vine
#

Anyone have a working macro for Tasha's Hideous laughter? I've tried the ones in MidiSRD, but they are for v9 (I'm on 10) and don't work. I have everything in the effect working just fine, but the "target gets to save on taking damage" part.

vast bane
vast bane
coarse mesa
vast bane
#

I went with the mods instead of actual attributes cause the dice rolls would swing too far having to double the changes

#

cause an attribute changes the mod for every 2

#

This is really weird, the tashas automated versions are not in midi srd anymore?

#

I swear they were

#

oh, srd versions, naughty tasha

tropic vine
#

@vast bane I installed the one from the Dropbox link, but it is missing the macro attached to the spell. Do you have a link I could grab it from?

vast bane
#

the macro is in the modules file, thats how midi srd works:

#

I dunno how to find them in midi srd's files but I'm testing it now to see if it works

tropic vine
#

@vast bane Yeah, I saw that, but I couldn't actually find the macro itself. The only macro in the Macros Compendium is CUB Condition.

vast bane
#

nah, midi srd has an actual file in the modules folder for midi srd where all the macros are stored

#

they aren't front facing for users you have to dig

#

honestly we should @violet meadow since its his pet project and this is the error in midi srd's macro version of hideous laughter. I ponder if the issue is some missing things in the macro.itemmacro key:

#

If bugbear doesn't figure it out I'm sure one of the other gurus here can spot the mistake in MidiMacros file in the modules folder

#

its apparently line 29 in midisrd macros

tropic vine
#

@vast bane Yeah, it's a weird one. I tried it out and it works, IF I use it from the character sheet. If I use it from Token HUB, nothing happens at all. But it does solve the saving on damage thing. Thanks!

vast bane
#

its got alot of midi shennanigans but we could also post it in macro polo they might spot a v10 issue

violet meadow
#

Ah give me a sec to enable MidiQOL

vast bane
#

If I edit it in the dev tools does it edit the actual file on the server?

tropic vine
#

@vast bane@violet meadowDidn't mean to start a whole thing!

vast bane
#

plus I have a wizard in my party, he doesn't have it prepared, but he does infact have it

tropic vine
#

@vast bane I've got a bard - he uses it all the time.

molten solar
violet meadow
#

Ah no worries. I just saw a forgotten deleteEmbeddedEntities

vast bane
#

I get the feeling editing in the dev tools is client only till I refresh eh?

violet meadow
#

save it and reload

#

and is good to go till the next module update

vast bane
#

I couldn't save it properly cause I'm not actually the host

#

I'd have to go into the file which I can...just will take a few

violet meadow
#

I am pushing an update in a bit

tropic vine
#

@violet meadow Thanks. That spell is way OP, but it will be nice to have it working properly!

vast bane
#

Did you confirm it as the fix, otherwise I'll continue manually editing to help you test it if you want

#

do I need to reboot the server when I edit a modules file or just the clients?

violet meadow
#

Can you try updating?

vast bane
#

my manual edit seemed to keep the error but I probably messed it up, using your version now loading in

vast bane
#

redragged midi srd's macro version

violet meadow
#

Target is not defined?

vast bane
#

its actually the line under the error that is what its pointing to

#

yeah

violet meadow
#

that is a differrent story then

#

I will take a look

vast bane
#

normally item macro in the active effect, you guys put things in it like @something this one has nothing in there

violet meadow
#

lol it completely lacks the definition of target.

covert mason
#

I'm trying to automate an Absorbing Tattoo's Damage Absorbtion feature. Is there an optional flag for specific types of damage taken?
Or is there some sort of macro that can prompt this effect?
When you take acid damage, you can use your reaction to gain immunity against acid damage, and you regain a number of hit points equal to half the damage you would have taken.

vast bane
#

I would just make a reaction that gives them acid absorption for that attack

#

I believe theres an actual absorption key set in midi that does it all automatically

covert mason
#

Oh shit

vast bane
#

I don't think you can control when the reaction prompts though

#

well....hmmm. The optional macro setup might actually work, I dunno

covert mason
#

Well I'll be damned

vast bane
#

yeah that'd prompt every time but I dunno about you, thats just a thing we live with in our game, I set player reaction timers to 10 seconds and just live with the delays

#

Would probably need a world script to control when it prompts no idea if its trully even possible

#

or necessary really

violet meadow
vast bane
#

though when I was trying to find the error I get the point now of the macros being in the module file, this way you don't have to redrag them out...usually if the code changes on the file instead of the item.

violet meadow
#

You will need to draw the item out from the compendium again, or add a @target to the call of the macro.itemMacro in the Hideous Laughter DAE

tropic vine
#

For me, it throws the following error when it tries to add the effects.

scarlet gale
#

You might be missing a needed module

violet meadow
#

No DAE?

tropic vine
#

@violet meadow I've got DAE and all my other added MidiQOL effect apply just fine. I'll toodle around with it and see if it's something on my end.

violet meadow
#

No I just saw that again.

#

It uses a call to CUB!

violet meadow
tropic vine
#

@violet meadow CUB? I don't even have CUB installed! MidiQOL 10.0.23.

violet meadow
tropic vine
#

@violet meadowAhhhh! Let me uninstall and reinstall Simple Calendar and try again.

violet meadow
#

Afterwards probably the error will become ```js
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addCondition')
[Detected 1 package: midi-srd]

vast bane
#

can we fix that to be cleaner, I was actually seeing that error and not worrying about it cause dfreds seemed to catch it

#

it would do the red error but still apply prone/incapcitated

#

something was still accomplishing the condition step

#

oh shit, I wonder if dfreds has a hideous laughter premade woops

#

arrggg wish this machine would finish with its system restore!

violet meadow
#

Of course it has

tropic vine
#

@violet meadow Yup, that's the error that I get, but it works! Yay! Thanks a bunch.

violet meadow
#

I will push another change in a bit to get rid of that. Will get some other things in there too before though

vast bane
#

Its funny I have cub, I just have enhanced turned off, it stil fails to apply it but somehow, I'm guessing midi+dfreds, its still managing to apply them

#

Yeah I had a premade custom for hideous for some reason applying both the conditions

vast bane
#

It also prompts for another roll, but this could be because I'm stuck on 10.3 of MTB atm. But it literally prompted for a manual wisdom roll after the turn advanced onto the next turn in addition to MTB's roll

#

I tried to just put @target in I will redrag and see if there was more nuance to the item changes

violet meadow
#

I rolls the spell the save automatically.

vast bane
#

I tried with the actual version in the compendium and nothing changed, its got the above issues still

#

I'm gonna temporarily bump up to the newest MTB and see if I'm just on a bugged MTB version

covert mason
#

How would I format this in a DAE while also allowing for things like a shield to further increase AC?
While you aren't wearing armor, the tattoo grants you an Armor Class of 15 + your Dexterity modifier (maximum of +2). You can use a shield and still gain this benefit.

violet meadow
violet meadow
#

Custom AC Formula

#

probably need a max in the dex mod too

vast bane
#

isn't ther ea field in the data for ac dex?

molten solar
#

@attributes.ac.dex

vast bane
#

yeah, that post is old probably so they hadn't had it then?

#

just avoid flat like the plague as its the only thing that I think blocks bonuses

molten solar
#

As intended

violet meadow
#

and natural as it is essentially flat πŸ˜„

scarlet gale
#

@abilities.dex.mod > 99 ? 10 + @abilities.con.mod + 99 : 10 + @abilities.con.mod + @abilities.dex.mod
DDB importer uses this for Barbarian AC formula. It appears to work with shields.

#

I feel like you should just be able to do 15 + @abilities.dex.mod as an upgrade

violet meadow
#

the what now
??

scarlet gale
#

for the same effect

violet meadow
#

what is that 99

scarlet gale
#

I have no idea what it's doing

#

I'm guessing it's some fancy way to allow equipped armor to overwrite it.

molten solar
#

What the fuck is that.

molten solar
scarlet gale
#

At any rate, custom AC formula still allows a shield bonus

molten solar
#

Looks like a way to cap the dex mod at 99

#

but why

violet meadow
#

yeah it does but now I wonder what that formula is supposed to do. Is there a fancy AE going on?

molten solar
#

Why not just set it to .barb??

violet meadow
#

that was intended for Chris

scarlet gale
#

Doesn't look like it's anything other than just a AC formula upgrade

#

Monk unarmored defense also imports like that too

violet meadow
#

ternary operators on formulas are not a thing anymore, no?

scarlet gale
#

The importer does tend to use a bunch of deprecated stuff for AC, so it wouldn't surprise me if it's just outdated ways of doing things

molten solar
#

Apparently ternary operators do work in AC formulas

#

Easy test: @abilities.dex.mod > 1 ? 0 : 1

worthy viper
#

How do i set up the midi to prompt players for advantage or disadvantage + any dice command they can add to it

scarlet gale
#

Turn off fast rolls or whatever it's called

worthy viper
#

where is that setting

#

Fast Forward Ability Rolls?

scarlet gale
#

Should be in the midi settings

vast bane
#

its abnormally in a weird spot

#

I'm sure theres a reason why, but just pointing out its in a unique place int he settings outside the workflow settings button

spring dove
#

hey @vast bane, I got a complicated question

#

In roll20, there was a way to set up a query inline with a roll. It was a "?" followed by the options and if those options translated to something else, like a number. So for example, you could set up an inline query for an upcasted spell damage, something like
?(Spell level?|2,d6;3,2d6;4,3d6,etc;etc)
I know the syntax won't be the same, but is there a way to set up inline queries in Foundry, or in Midi?

spice kraken
#

What should the damage be for each level?

spring dove
#

Reason I'm asking, is I've got that extra damage on the "other damage" field when the attack roll is +10 over target AC. But, some weapons have versatile, so I need an inline query to ask how many hands are on the weapon

#

So the inline query needs to be something like
?(One handed or two handed?|one hand,d6;two hands,d8)

#

I've got other conditions that need inline queries, but once I figure out how to do it, I'll write them myself.

vast bane
scarlet gale
#

Versatile has it's own damage formula

#

You can just hold down shift when attacking

spring dove
#

I know

#

but this is the "other damage field"

#

and can't separate

scarlet gale
#

Bit confused what you're trying to do

#

If it's from that extra damage when over 10 ac thing from earlier

spring dove
#

Yes

scarlet gale
#

It being versatile shouldn't change anything

spring dove
#

Because there's only one "other damage" field, I can't two different damages.

vast bane
#

bugbear gave you that activation condition yesterday

#

you had it

spring dove
#

I still have it

#

I think you guys are still confused, let me explain. I'm sorry.

scarlet gale
#

There is 3?

vast bane
# scarlet gale

Chris hes doing an activation condition to apply other formula

spring dove
#

Yes, but am I not using the "other damage" field for the extra damage dice?

vast bane
#

but since the dice size changes, it won't work

scarlet gale
#

ah

spring dove
#

Right

vast bane
#

personally I'd just make two weapons

#

or you could do it all in a macro

spring dove
#

So if I can put an inline query in the other damage field, it could change the dice size depending on the query

vast bane
#

inline queries are a roll20 thing, and I agree, yes, I miss that sweet sweet goodness

spring dove
#

yeah? Would it be easier to have a one handed and two handed version of those weapons?

vast bane
#

Yeah cause then you put bugbears activaction condition in and put the extra dice in other formula

spring dove
#

So inline queries aren't a thing in foundry?

vast bane
#

if you don't fast forward you could just do this as an advantage reminder

spring dove
#

Cuz I could have sworn there were spells that asked for the damage type you wanted, like chromatic orb

vast bane
#

no dialogs are a pain in the ass to make and need macro work

spring dove
#

ugh

dark canopy
#

(warpgate dialogs)

vast bane
#

It is virtually the only thing I miss in roll20

spring dove
#

yeah, same

#

was such a handy tool

vast bane
#

I cannot believe that they have not brought that over to foundry and made it better like everything else about roll20 here. It was such a core crutch that everyone used and in order to use it here it has to be a macro and it has to involve js

spring dove
#

yeah that does seem like an obvious feature anyone familiar with roll20 would want in Foundry

vast bane
#

I asked Kaelad about having the ability to use a macro to apply to a situational bonus in AR, and that will be the closest we will get to roll20 inline dialogs

spring dove
#

Or hell, just add the option to add more than one "other damage" formula

vast bane
#

but right now not possible

dark canopy
#

#feature-suggestions awaits, but it is far from an easy thing due to the richness of data that foundry's rolling system has access to

spring dove
#

I'll put my bid in nonetheless. They've done a lot more with a lot less prompting lol

dark canopy
#

const result = await warpgate.buttonDialog({buttons: [{label: "OK", value: true}]}; console.log(result);

spring dove
#

where do I put this?

vast bane
#

the problem there is I have to know JS and honestly I'm kinda proud of myself that i've actually started to sus out some stuff, but dialogs just cross my eyes and confuse me

#

Wonder if babonus could pull your idea off

spring dove
#

I'm right there with you. I feel like I should have learned JS a long time ago

dark canopy
#

however, now that the roll system is moving towards fully async -- inline queries are more possible than previously

molten solar
molten solar
#

Oh, the core rolling.

#

Whew

vast bane
#

A longsword that swings 1d8 or 1d10, if it beats the ac by more than 10, gets an additional die or two of whatever the handedness was

molten solar
#

Gotcha. Then no. Attack rolls and damage rolls are two separate rolls, they don't interact.

spring dove
#

we're doing it with an activation condition that then rolls "other damage" field

molten solar
#

(as far as babonus is concerned)

spring dove
#

Is that a module?

#

I honestly thought babonus was Moto's nickname for you, which was odd but I wasn't going to judge lol

scarlet gale
#

At this point I think you're better off just doing it with a macro

#
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
if (workflow.attackTotal - 10 < targetActor.system.attributes.ac.value) return;
let damageFormula = workflow.damageRoll._formula;
roll =  await new Roll(damageFormula + ' + 10').roll({async: true});
await workflow.setDamageRoll(roll);
#

Adds an extra 10 damage when the roller is 10 or higher than the target AC.

#

Run on "After Damage Roll".

spring dove
#

oh shit lol. b a bonus

#

I thought was a baboon thing

spring dove
scarlet gale
#

oh

#

Still doable

scarlet gale
#

Yea

#

let me change it to just grab the damage dice instead of a flat number

spring dove
#

thanks

scarlet gale
#

Does the extra dice get doubled too when you crit?

spring dove
#

no

#

May be helpful if you have the full text context.

#

This is from Revised Martial Equipment.

#

Powerful blow = +10 over target AC

vast bane
spring dove
#

attachers = sneak attack, smite, poison, etc

vast bane
#

what IS the animal in babonus then lol?

violet meadow
#

Otter

vast bane
#

I thought it was some sort of homage to Badger or something

spice kraken
#

It's Steve

violet meadow
#

We all luv Steve

vast bane
#

We all have a Steve

spring dove
#

My name is Stephen lol

#

surreal

kind cape
#

Thats 100% an otter

violet meadow
#

And the circle is complete 🀣

vast bane
#

You guys know the easter egg in his module?

scarlet gale
#
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
if (workflow.attackTotal - 10 < targetActor.system.attributes.ac.value) return;
let damageFormula = workflow.damageRoll._formula;
let diceNum = 1;
//if (workflow.isCritical) diceNum = 2;
let bonusRoll = ' + ' + diceNum + 'd' + workflow.damageRoll.terms[0].faces + '[' + workflow.damageRoll.terms[0].options.flavor + ']';
roll =  await new Roll(damageFormula + bonusRoll).roll({async: true});
await workflow.setDamageRoll(roll);```
Uncomment line 9 if you do ever decide to allow it to crit.
violet meadow
#

Oh there is the macro πŸ˜…

spring dove
#

lol

scarlet gale
#

oh

#

Did you want me to make it run on crits too?

spring dove
#

Yeah

vast bane
#

I think its basically crit if over 10 or 20

spring dove
#

most of the time, but not all the time

vast bane
#

but not twice if the ac is 10 and he rolls a 20 or whatever

spring dove
#

you can +10 a slime pretty easy, but a crit on a dragon isn't going to be +10 over every time

vast bane
#

You bsically don't want to add that extra dice twice during the natural behavior of the crit if both qualifiers happen

spring dove
#

right

scarlet gale
#
let workflow = args[0].workflow;
if (workflow.hitTargets.size != 1) return;
let targetToken = workflow.targets.first();
let targetActor = targetToken.actor;
let doExtraDamage = false;
if (workflow.attackTotal - 10 >= targetActor.system.attributes.ac.value) doExtraDamage = true;
if (workflow.isCritical) doExtraDamage = true;
if (!doExtraDamage) return;
let damageFormula = workflow.damageRoll._formula;
let diceNum = 1;
//if (workflow.isCritical) diceNum = 2;
let bonusRoll = ' + ' + diceNum + 'd' + workflow.damageRoll.terms[0].faces + '[' + workflow.damageRoll.terms[0].options.flavor + ']';
let roll =  await new Roll(damageFormula + bonusRoll).roll({async: true});
await workflow.setDamageRoll(roll);```
#

Make sure the item macro is running as "After Damage Roll" instead of the normal "After Active Effects"

spring dove
#

I'll give it a whirl. Thanks so much for this, Chris

#

I assume I modify line 12 with the 'd' and put the damage there?

scarlet gale
#

nope

#

Leave it all as is

violet meadow
#

Missing a let

scarlet gale
#

oh yea

#

There shouldn't be anything you need to modify in the macro

spring dove
#

Can you tell me what exactly it's doing so I know?

scarlet gale
#

(I just fixed it, you may need to re-copy it)

#

Sure

#

It's taking the first dice it finds in the formula