feu-secret / tokenmagic Goto Github PK
View Code? Open in Web Editor NEWA Foundry VTT module that allows you to add animations and graphic effects to tokens, tiles, templates and drawings.
License: GNU General Public License v3.0
A Foundry VTT module that allows you to add animations and graphic effects to tokens, tiles, templates and drawings.
License: GNU General Public License v3.0
This is the last feature required to allow MESS to deprecate template handling.
I see that pixi-filters.js is bundled in this module and loaded via scripts
, is that required? With the module unloaded, I see the filters available via the global PIXI.filters
. Loading the filters twice seems inefficient, is the bundling for version compatibility or something?
When a wildcard token that has an effect on it has its image changed, the whole scene freezes until you reapply an effect to the token. Simply removing the effect afterwards does not unfreeze the scene and still shows the effect (though not moving).
Having the only option for removal of filters as "all" or adding a new macro for that specific filterId can be a bit akward. Having a chat list with removal options (like Dynamic Effects) would be great
First of all, this module is amazing!
I was thinking about management of effects, specially those pre made. I suggest to add a button at the left side bar that will have options like:
You could take as an example the module FX Master side menu.
I'm getting this error when trying to use tokenmagic to apply an animation to my spell. I have the texture field left blank
Failed to load texture /modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png: Invalid URL
That file location exists, and if I manually select it, the animation and texture work correctly. Is this a known issue or is there something wrong with how I have Foundry set up? I'm using the docker image and it is behind an nginx reverse proxy.
I want to make a drop down menu for selecting effects to apply, but my coding skill is limited.
I have a macro that creates a drop down menu for vision selection, and have edited that to my specific vision needs. But that's close to the limit of what I can do.
My intention is to create a drop down list that when selected and applied, adds the listed FX to the token. (Conditions are what I have in mind). Bonus if the drop down can also toggle off said effect.
let path1 = "icons/svg/"
let fp2 = new FilePicker({
type: "image",
current: path1,
callback: path => {
//insert tokenmagic stuff here and use variable = path
},
})
fp2.browse();
Having the ability to apply filters to targeted tokens could, combined with other modules and a little macro magic, open up all sorts of possibilities for automatically applying spell effects from templates such as turning someone to stone, highlighting them with Faerie Fire, actually setting them on fire, making them fly/levitate, etc.
I know that there's a mechanical rotation tied to tokens in game, but I would love the ability to just rotate the image of a token without changing its functional rotation. This could be used to quickly fix tokens not set up to face south (Foundry's default assumption) as well as to animate rotation for spell templates on things like Fog Cloud, Whirlwind, Dust Devil, etc. (my primary goal).
Although token FX work, auto templates do not appear.
Hi,
thanks for this great module, I really love it.
Some suggestions for further improvement:
Some filters with built in heavy shaders may take some time to load the first time they are used (the shader is compiled for a specific GPU). To avoid this : cache all heavy filters the first time Foundry is loaded.
I can't tell if I'm supposed to be able to do this or not.
From the description of this module on foundryvtt.com: "Add visual effects to templates, drawings, tokens and tiles." This led me to believe that I could add these visual effects via macros to shapes created via Measurement Tools -> [Shape] Template.
I can use the provided macros in the compendium to add effects to tokens. However, if I select a spell template instead of a token before activating the macro, I'm not seeing anything change in the template. Are the supplied macros supposed to work with Measurement Controls -> [Shape] Templates?
Essentially the idea here would be to allow for fields/auras/templates to apply their effects as a ring/border of adjustable thickness rather than always filling their entire area. This could be useful for various wall spells that encircle an area, for example, or in situations where you want the FX to highlight an area of effect without obscuring more of that map than is necessary.
Hi.
Can you add a how-to?
Thank you.
It's incredibly hard to look at the readme and know what this mod is doing. It would be nice if the changelog were separate from the readme. I can look at a change towards the top, and then keep reading towards the bottom, but the further down the page I get the less sure I am if that's a feature that's currently in the module.
What is MESS integration? Do I need MESS? Does this work beside MESS? Does it replace MESS?
It appears that migrate.js doesn't clear out the original line keyed with "tokenmagic.presets" whenever a migration takes place, causing old installs of Token Magic FX to have many repeating lines of "tokenmagic.presets" for each version a user has updated to. This still "works", as the lines are loaded in order from settings.db, but dirties up settings.db files.
Discovered this when a user on The Forge had installed Token Magic FX, and got an old version of "tokenmagic.presets" in a world that was never "migrated" (it appeared to be ~3.0.x version of the "tokenmagic.presets" line).
Might be an enhancement request, I can't quite tell what the behavior should be.
When casting a spell effect such as breath weapon the effect goes around targeted mobs rather then being applied to them. I would expect the effect to be applied to them or at least applied on hit (myql)?
Apologies if this is as intended, but it doesn't quite convey the right effect IMO.
Also if you could mix spell effect and targeted effect you can get some great looks like noted in expected image.
Example pic vs. expected.
This is a great module but I would love to be able to export my settings to use between worlds. Setup time can take quite a while when you start doing a lot of spell overrides.
Is this something that would be possible?
I've been thinking for a while about adding a shadow when a token's height field is updated, that increases its diffuse the higher the height goes.
Now, with splash, we might add a momentary effect when a token's HP goes down, and possibly some effect when HP goes up.
Noting here so I don't forget, I'll take a look at it when I find some time.
I want the players to use this too.
Can you make a Targeted Token Receive the Effect too?
The players can't select other tokens.
Users cannot select tokens that they don't have ownership permissions on.
Hi Ludovic! First of all I'd like to say I enjoy the Token Magic FX immensely. I been trying to get animated effect for a while now and it is perfect. I want to see if I can combine it with other macros.
For example, I want to have a specific effect when the barbarian enters rage, and another effect when the barbarian uses reckless attacks. While the barbarian will stay in rage for a duration, the reckless attacks is used intermittently.
Is there anyway to turn off a specific effect (e.g. the one combined with reckless attack) instead of relying on the "delete filters on selected/placeable tiles", which removes all the effect present (including the effect I string onto Rage)?
Would be nice to sample settings without having to save (closing the window) and then cast each time to test visuals. A button that generated a preview would save a lot of tedium on the user end, especially when getting fancy with lots of overrides.
The current TMFX options allow for removing the highlighting of templates, but still leaves the border
MESS has a similar option here that also removes the border.
Having both MESS and TMFX messes with this setting and the border still loads.
It'd be great if this could be added as a option <3
The last commit was in October, there are a lot of opened issues and suggestions.
I'm curious but, Is this module abandoned?
BTW: Great work, one of my favourite foundry module.
Is there a current way to fade out an effect instead of abruptly kill it? If not can there be? (is so how?)
Execution of a transform file causes the token to disappear. It returns when the effect is canceled. For the duration, the token just vanishes and there is no animation or anything.
macOS Catalina
Maybe out of scope, but being able to apply a webm asset as an overlay that works more or less the same as the token filters would be great. Not too big a deal for tiles, but would be great for tokens, especially for momentary animated effects (since core overlay will not take webm).
Current there doesn't seem be a simple UI/GM/User level way to add token effects as spell results with a macro radically editing the spell, and that doesn't quite work.
What I would like is to be able to specify a token magic VFX effect is a spell configuration, so the VFX is applied to the target(s).
Example, cast burning hands at a goble, MQL checks save, if hit then apple kick ass kill VFX animation until my turn ends or spell duration.
Right now I can change the spell and make it 5 Feet Cube, and apple it the template with the spell but that only applies the effect around the target and not on it (not nearly as kick ass).
This same issue occurs with instant ray spells and anything without a template to lay down.
Attempting to install from Foundry Module finder will result in "Not found" error.
Would be so great to create cones of fire, circles of heal and so forth.
While I love the idea of the new template effects, they are overriding the animated templates I have specfically defined with MESS.
I'd like to see some compatibility settings:
Thanks!! I love the new shininess, but I really want my precious library of animated spell templates to still be usable.
tokenmagicFX seems to ignore the routePrefix foundry option when configured for determining its default asset paths.
For example if routePrefix = "thing"
all content is going to be at the base path of https://mydomain/thing/
. The current behaviour of tokenmagicFX results in the following...
GET https://mydomain:8080/modules/tokenmagic/fx/assets/distortion-1.png 404
ImageResource.ts:188 Uncaught (in promise) Event {isTrusted: true, type: "error", target: null, currentTarget: null, eventPhase: 0, …}
It should however be doing...
GET https://mydomain:8080/myprefix/modules/tokenmagic/fx/assets/distortion-1.png
I think your override textures support webp. Is there any chance of getting webm or mp4 support? I have existing animations I'd like to use and they aren't supported.
Thanks.
Remove the following line. It doesn't do anything anyway at the moment (?).
window.devicePixelRatio > 1
and the filter's resolution is forced to 1, the quality will be negatively affected if the blur filter is applied after this issue has been resolved. It doesn't make a difference now, but I thought I should let you know right away.Committing binaries to the git repo is poor form - binaries cannot be stored or diff'd efficiently, so the repository size grows dramatically over time.
Consider instead using the releases feature on Github to attach the zip to a tag.
Would really like to be able to execute a macro, and have the MeasuredTemplate attach the template with Magic FX enabled on it, and mouse click to apply to the location. Currently, all the macros just apply it in a specific spot.
The dnd5e class AbilityTemplate allows this functionality, and it would be nice if Token Magic could hook into it to allow placement of templates.
It could easily be expanded upon via macro to prompt for input for shape, size and type, then allow the user to mouse around the screen before placement. While MeasuredTemplate.create() allows for this, its measurements are not scaled correctly the the scene's dimensions, and ends up being way off and impossible to calculate.
The use case for this would be "I would like a 20ftx20ft Fire effect to be placed on the canvas at this location"
This will allow better compatibility with other modules, and allow safely dynamically unpatching methods.
The dnd5e AutoTemplate in TMFX only attempts to match the first damage type of an item when performing a fx-by-category lookup.
This is a problem for entities that have multiple damage types and the first damage type does not have a preset fx, like the Ice Storm spell, whose damage types are [bludgeoning, cold].
The code responsible for the current behavior is below:
_fromCategories(categories = {}, item, template) {
if (!item.hasDamage) {
return false;
}
let dmgSettings = categories[item.data.data.damage.parts[0][1]] || {}; // this line only considers the first damage type at idx 0!
let config = dmgSettings[template.data.t];
if (!config) {
return false;
}
this._fromConfig(mergeObject(config, { opacity: dmgSettings.opacity, tint: dmgSettings.tint }, true, true), template);
return true;
}
TMFX should not care that cold is the second damage type.
Hi,
Attempted to utilize TMFX w/ Active Auras and DAE modules to create an aura field for paladins and certain types of spells. Unfortunately, I'm running into an issue where the applied filtering affects are not removed when the character moves out of range of the aura (or the source moves away). When the characters move back into range, I'm seeing a duplicating effect w/ DAE, not to mention that the filtering effects get a lil wacky when there are multiple auras. Filtering effects have to manually removed. Is there a way to fix this w/o having to write up a macro or manually removing the filters that TMFX creates?
Appreciate any assistance w/ this.
Running Foundry 0.7.5 and Tokenmagic 0.4.4. I am trying to add an active effect that will apply a TokenMagic effect on a targeted creature. For example, electricity overlaid on a targeted token when Shocking Grasp is successfully cast.
I can add an ActiveEffect to a spell by adding the spell to the Items Directory, and then going to the ActiveEffects tab in the spell description. In the ActiveEffects tab, I go to the Effects tab, add a new effect, and select "Macro TokenMagic" as the Attribute Key. Then, for effect, it gives me a choice of every TokenMagic effect. If I choose an effect with a space in the name (e.g. Fairy Outline) then the TokenMagic effect is not applied when the ActiveEffect is triggered. If I choose an effect without a space (e.g. electric) than the TokenMagic effect is applied as expected. This happens for library presets and also happens for user-added presets.
(To make the spell effect work, after adding the effect and possibly a duration, drag the spell to a character sheet. Then cast as normal. For Shocking Grasp, if the spell hits, the effect will be enabled on the target.)
I've not been able to track this down yet. When Tokenmagic is enabled, adding a texture to a template from the MeasuredTemplateConfig menu throws the following exception the first time a particular texture image is loaded, upon saving the template:
Graphics.js:850 Uncaught (in promise) TypeError: Cannot read property 'clear' of null
at r.clear (Graphics.js:850)
at MeasuredTemplate.refresh (foundry.js:37191)
at MeasuredTemplate._onUpdate (foundry.js:37414)
at Scene._onUpdateEmbeddedEntity (foundry.js:29792)
at Function._handleUpdateEmbeddedEntity (foundry.js:10735)
at Function._handleUpdateEmbeddedEntity (foundry.js:29840)
at Scene.updateEmbeddedEntity (foundry.js:10704)
at async MeasuredTemplate.update (foundry.js:12469)
at async MeasuredTemplate.update (PlaceableObjectProto.js:140)
at async MeasuredTemplate.PlaceableObject._TMFXunsetFlag (PlaceableObjectProto.js:35)
The following are the observed conditions from testing, starting from a fresh load of the page:
So, there's some caching going on, and I suspect some sort of order-of-operations problem.
It is possible to change the mirror image effect image for another? I'm trying to make a light orb orbiting the character token, I have altered a bit with that fx and succeeded in make 1 mirror image orbit the character, but I want to change that image for the orb, if an webm is possible, evem better...!!! any sugestions? ps: I'm realy bad at coding.... doing it at try and error, mostly copy paste!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.