#Dimension Door
1 messages · Page 1 of 1 (latest)
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)
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?
Right, item is the spell passed to the macro when you use this as a script call
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
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
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
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
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
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
Do you have the Dimensional Slide configured to use charges from Arcane Reservoir?
yes and it does. correctly subtracts one from the pool when used. Just keeps letting it be used when it gets to 0
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?
hrm... that's interesting. I just set the pool to 3/8 and used it and it deleted all charges
and yes
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 _
...js
had to upload as a file
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.
Ah yeah that would do it
just had to keep talking through things
Well wait, the charge configured?
yeah. not sure what exactly was happening before. But I think it deleted all charges when used for some reason
Can you post a screenshot of exactly how it was configured? Because that sounds like a bug
let me see
if I can recreate
Details tab of feature, then the values of the pool before using and after using
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)?
correct. when I add the action everything works fine
@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
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.
I really appreciate the help you guys give. This commmunity is awesome
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.
I can write up an issue for it and summarize the above
The issue is that the system is calling this.chargeCost in ItemPF.use()... which does not exist.
Specifically here: https://gitlab.com/foundryvtt_pathfinder1e/foundryvtt-pathfinder1/-/blob/2eb361f3df19786c618347a3f3d28a510e58b24e/module/documents/item/item-pf.mjs#L1114
And the line a little bit below.
Cool, looks like it should be a quick fix
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.
I'll write up quick issue for it. Hopefully the fix is as straightforward as it looks
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.