#Dimension Door

1 messages · Page 1 of 1 (latest)

loud sluice
#

I've got a dimension door macro here.

https://github.com/dmrickey/ckl-foundry-macros/blob/master/spell-animations/dimension-door.js

I haven't touched it in a ~couple years. It also requires warpgate, sequencer, and JB2A. Though the JB2A bit can be removed pretty easily if you understand what's going on. And then Sequencer could also be removed if you understand how to just move the token to the crosshair's selected location.

But Sequencer/JB2A are required "to make it look pretty" (i.e. those are required for the animations)

queen wasp
#

Thanks for sharing that. When I try to run it, nothing seems to happen.

#

The console shows this.

#

VM525195:37 Uncaught (in promise) ReferenceError: undefined. item is not defined
[Detected 2 packages: advanced-macros, lib-wrapper]
at eval (eval at executeScript (lib.js:175:13), <anonymous>:37:15)
at Macro.eval (eval at executeScript (lib.js:175:13), <anonymous>:77:3)
at Macro.executeScript (lib.js:179:13)
at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:591:14)
at 🎁Macro.prototype._executeScript#0 (libWrapper-wrapper.js:189:20)
at Macro.renderMacro [as renderContent] (lib.js:293:17)
at _executeMacroInternal (lib.js:137:17)
at Macro.executeMacro (lib.js:77:15)
at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:591:14)
at 🎁Macro.prototype.execute#0 (libWrapper-wrapper.js:189:20)
at Hotbar._onClickMacro (foundry.js:68365:20)
at HTMLLIElement.dispatch (jquery.min.js:2:43064)
at y.handle (jquery.min.js:2:41048)
eval @ VM525195:37
eval @ VM525195:77
executeScript @ lib.js:179
🎁call_wrapper @ libWrapper-wrapper.js:591
🎁Macro.prototype._executeScript#0 @ libWrapper-wrapper.js:189
renderMacro @ lib.js:293
_executeMacroInternal @ lib.js:137
executeMacro @ lib.js:77
🎁call_wrapper @ libWrapper-wrapper.js:591
🎁Macro.prototype.execute#0 @ libWrapper-wrapper.js:189
_onClickMacro @ foundry.js:68365
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2

#

to be clear, right now I'm just selecting a token and running a macro. Is item undefined in that case?

loud sluice
queen wasp
#

Ok, I wasn't clear about my use case. Actually didn't really say it at all. Working on dimensional slide for an Arcanist and I figured I could treat it like dimension door

loud sluice
#

Then put it as a script call on the class ability instead of a spell

#

But you should probably use this Dimensional Hop macro as a basis because it's already set up to use charges (cleric domain ability). But it also has logic to limit the distance being hopped based on the number of charges used. And I don't think that Dimensional Slide has that same limitation

#

So maybe the dim door macro is better.. one sec, let me go refresh myself on that ability..

#

If you understand javascript at all, the cleric ability will give you a better starting point as it has distance limits built into it. You'd just need to update it to calculate the correct limit and remove the part about spending extra charges

queen wasp
#

ok, much better set up now. So I made a Dimensional Slide class ability, linked it to the Arcane Reservoir, and it comes close to working. Getting a file not found in the JB2A stuff. I don't have the patreon content, just the free

#

don't have blue. only yellow and dark yellow.

#

everything works now! Thanks. that was much easier than I had feared

queen wasp
#

it subtracts from the arcane reservoir now correctly. but keeps letting you use it if you have used all the reservoir up. So that's the next thing to look at 🙂

#

for me I mena

#

mean

loud sluice
#

Ok, it looks like you got the file path swapped out easily enough

#

it subtracts from the arcane reservoir now correctly

I'm confused, the ability itself should be stopping itself from being used if there are no charges. It only takes one charge per use, right? So if you have the macro as a script call on the ability, then the ability should be in charge of the charges

queen wasp
#

yeah, that's what I would have expected as well. and the number of times per day seems to track correctly, exactly the same number for dimensional slide as for arcane reservoir. But when it is at 0/8, it still lets me use it. I just try to use arcane reservoir it says you don't have enough though

loud sluice
queen wasp
#

yes and it does. correctly subtracts one from the pool when used. Just keeps letting it be used when it gets to 0

loud sluice
#

Can you post a screenshot of how you've got the charges set up? And just to clarify, you've got your macro set up as an "on use" script call?

queen wasp
#

hrm... that's interesting. I just set the pool to 3/8 and used it and it deleted all charges

#

and yes

loud sluice
#

The one use drained 3 charges? Can you post a screenshot of how Dimensional Slide's charge usages are set up (bottom of Details tab)?

Can you paste the macro here?
js_ in a code block like this _

queen wasp
#

...js

#

pretty much the exact script you had with a change for distance and yellow instead of blue

#

I think I figured it out. Didn't have an action in the details tab for Dimensional Slide, just the script in the advanced tab

#

yup that did it.

loud sluice
#

Ah yeah that would do it

queen wasp
#

just had to keep talking through things

loud sluice
#

Well wait, the charge configured?

queen wasp
#

yeah. not sure what exactly was happening before. But I think it deleted all charges when used for some reason

loud sluice
#

Can you post a screenshot of exactly how it was configured? Because that sounds like a bug

queen wasp
#

let me see

#

if I can recreate

#

Details tab of feature, then the values of the pool before using and after using

loud sluice
#

Ok, so you've got it set up like this, which ends up deleting all charges

  • Ability has no action
  • has charges set up to consume 1 charge
  • has an "on use" script that runs when the ability is used

And the fix is to just add an action (I'm guessing you don't even have to configure it)?

queen wasp
#

correct. when I add the action everything works fine

loud sluice
#

@jagged yoke
Do you know if the above is still how it behaves on dev? (summarized in my comment just above)

I'd expect "no specific action but has an on use script call" to still consume the charges correctly and not whatever it's actually doing that causes the charges to be deleted

jagged yoke
#

With no action I have no idea how it behaves, considering the action is kinda central to anything happening.

#

But it appears that it indeed deletes the charge value.

queen wasp
#

I really appreciate the help you guys give. This commmunity is awesome

jagged yoke
#

Looks like the special case of script call being enough to make it activatable behaves poorly with that. I'd have to guess the charge usage becomes NaN due to lack of action.

loud sluice
#

I can write up an issue for it and summarize the above

jagged yoke
#

The issue is that the system is calling this.chargeCost in ItemPF.use()... which does not exist.

#

And the line a little bit below.

loud sluice
#

Cool, looks like it should be a quick fix

jagged yoke
#

addCharges(-undefined)

#

I kinda feel like there was a bug report about this... or it was a comment in one of my MRs that it looked weird, but then I forgot about it.

loud sluice
#

I'll write up quick issue for it. Hopefully the fix is as straightforward as it looks

jagged yoke
#

It should be.

#

Not seeing it on glance, but !796 was when I noted it, and the functionality that MR introduced should make fixing this one easy.

loud sluice