Craftzero
Craftzero
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Closing this, thanks @enso
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Can you message me your venmo, Enso?
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Works Perfectly!
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Although I removed the extra period as per Enso's suggestion
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Correct
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Hmm, What in the code points to the correct character art file?
js
if (!token) return ui.notifications.error("No token is selected.")

const tokenName = token.name;
const notTransformed = tokenName + '/' + tokenName + 'Normal.webp';
const transformed = tokenName + '/' + tokenName + 'Scared.webp';
const img = token.document.texture.src === notTransformed ? transformed : notTransformed;

new Sequence()
.sound(`${tokenName}/evil2.ogg`)
.effect()
.file("modules/jb2a_patreon/Library/2nd_Level/Divine_Smite/DivineSmite_01_Dark_Purple_Caster_400x400.webm")
.atLocation(token)
.scaleToObject(2)
.randomRotation()
.wait(1500)
.thenDo(async () => {
await token.document.update({ img });
await token.actor.update({ img });
})
.play()
js
if (!token) return ui.notifications.error("No token is selected.")

const tokenName = token.name;
const notTransformed = tokenName + '/' + tokenName + 'Normal.webp';
const transformed = tokenName + '/' + tokenName + 'Scared.webp';
const img = token.document.texture.src === notTransformed ? transformed : notTransformed;

new Sequence()
.sound(`${tokenName}/evil2.ogg`)
.effect()
.file("modules/jb2a_patreon/Library/2nd_Level/Divine_Smite/DivineSmite_01_Dark_Purple_Caster_400x400.webm")
.atLocation(token)
.scaleToObject(2)
.randomRotation()
.wait(1500)
.thenDo(async () => {
await token.document.update({ img });
await token.actor.update({ img });
})
.play()
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
No description
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
@enso the token is now switching, thank you. But it's showing the token art, rather than the character art, what would I need to do to change that?
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
(Thanks @Zhell !)
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Now it appears to be fixed, at least as far as going back and forth for the token
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Yup, saw that!!
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
And that's it. Clearly I screwed something up. 🙂
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
The sound works, the jb2a animation fires... but the token changes to the mystery man token
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
if (!token) return ui.notifications.error("No token is selected.")

const tokenName = token.name;
const notTransformed = tokenName + '/' + tokenName + 'Normal.webp';
const transformed = tokenName + '/' + tokenName + 'Scared.webp';
const img = token.document.texture.src === notTransformed ? transformed : notTransformed;

new Sequence()
.sound(`${tokenName}/evil2.ogg`)
.effect()
.file("modules/jb2a_patreon/Library/2nd_Level/Divine_Smite/DivineSmite_01_Dark_Purple_Caster_400x400.webm")
.atLocation(token)
.scaleToObject(2)
.randomRotation()
.wait(1500)
.thenDo(async () => {
await token.document.update({ img });
await token.actor.update({ img });
})
.play()
if (!token) return ui.notifications.error("No token is selected.")

const tokenName = token.name;
const notTransformed = tokenName + '/' + tokenName + 'Normal.webp';
const transformed = tokenName + '/' + tokenName + 'Scared.webp';
const img = token.document.texture.src === notTransformed ? transformed : notTransformed;

new Sequence()
.sound(`${tokenName}/evil2.ogg`)
.effect()
.file("modules/jb2a_patreon/Library/2nd_Level/Divine_Smite/DivineSmite_01_Dark_Purple_Caster_400x400.webm")
.atLocation(token)
.scaleToObject(2)
.randomRotation()
.wait(1500)
.thenDo(async () => {
await token.document.update({ img });
await token.actor.update({ img });
})
.play()
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Here is the code, I changed the names to reflect .webp
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
No description
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Okay, so first here is the folder structure and what's in it:
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
js Test
js Test
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
How do I post this as code, what command is that?
46 replies
LOELeague of Extraordinary FoundryVTT Developers
Created by Craftzero on 12/28/2023 in #commissions
Macro to Change Token/Character Art
Give me a bit to put that in there and make sure the images are there, give me... 5 mins plz
46 replies