GithubHelp home page GithubHelp logo

feu-secret / tokenmagic Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 34.0 284.77 MB

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

JavaScript 94.64% CSS 0.15% HTML 5.20%
foundry-vtt shaders pixi macros

tokenmagic's People

Contributors

aedif avatar averrin avatar brothersharper avatar brunocalado avatar dev7355608 avatar drdwing avatar elizeuangelo avatar feu-secret avatar gsv-a-nest-of-kindled-embers avatar kandashi avatar lozalojo avatar lozanoje avatar osijr avatar p4535992 avatar pdf avatar pkonshik avatar shemetz avatar spoidar avatar wilywyrm avatar zimm44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tokenmagic's Issues

ActiveEffects: macro ignored if the macro name has a space

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.)

Feature Enhancement: Allow for placeable spell templates with Vfx by hooking into dnd5e.AbilityTemplate

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"

Issue with Default Template Texture

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.

Allow for removal of the template border

The current TMFX options allow for removing the highlighting of templates, but still leaves the border
image

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

Bug: MeasuredTemplate#update() throws exception when adding texture

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:

  1. Existing textured templates do not throw an exception on page load ✔️
  2. Adding a new image texture to a newly created template throws the excetion ✖️
  3. Changing the texture on the template from test (2) to a different image does not throw the exception ✔️
  4. Creating a new template and setting the texture to the image used in the template from test (2) does not throw the exception ✔️
  5. Creating a new template and setting the texture to an image that has not previously been used throws the exception ✖️

So, there's some caching going on, and I suspect some sort of order-of-operations problem.

Duplicating effects (not sure if this is intended)

Reapplying effects with duplicate them. Not sure if this is intended or not.
image
Example of multiple mirror image effects applied one after another.

Would be good to simply overwrite old effect with new parameters :)

Enhancement Add TM VFX to non template spell effects

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.
spell effec miss
effect applied on target

Add "Preview" button to template settings

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.

Is this module abandoned?

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.

zip file should not be committed to repository

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.

Suggestion: Settings menu and template visibility

Hi,
thanks for this great module, I really love it.

Some suggestions for further improvement:

  • Improved settings menu for templates. If you use a lot of overrides (e.g. a separate unique image for every template spell) the list of overrides gets quite long and confusing. Possible solutions: options for filtering and sorting, collapsing the actual settings of an overwrite until it is selected, ...
  • It would be great if the hover over visibility of a templates' grid could be activated without the necessity of switching to the templates layer, e.g. using a definable key binding
  • It would be great if not only the grid template but also the template border could be hidden

Creating a drop down menu through Macros

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.

Improve MESS incompatibility for effect versus template selection

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:

  1. Add an option to use MESS effects instead when a template is specifically defined for that spell - on by default?
  2. Add an option to use MESS default templates instead maybe?
  3. Add a way to specifically turn on the Token Magic FX as a default instead of the MESS default for a particular spell

Thanks!! I love the new shininess, but I really want my precious library of animated spell templates to still be usable.

Allow a Targeted Token Receive the Effect

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.

AutoTemplate only matches the first damage type of an item

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.

Apply effect to target not just area

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.
expectedeffect

cone apply

migrate.js not cleaning out original presets

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).

Cannot add visual effects to templates via macros?

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?

No installation?! BUG

I went to update and the message in the image appeared. I uninstalled to see if maybe the link had changed and still I get this.

Screenshot_1269

Readme without a changelog?

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?

Feature Suggestion: addFiltersOnTargeted

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.

tokenmagic

It is possible to change the mirror image effect image for one different from the token?

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!

tokenmagicFX ignores foundry routePrefix for assets paths

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

Bug: Template Texture Tessellation

TokenMagic tessellates textures as of the most recent update. The intended behavior is to resize textures to the size of the template. Attached is a picture with the mod off:

image

And with the mod on:

image

These are my current mod settings:
image

Let me know if any other information would be useful

Enhancement: Masking Interiors of Fields/Auras/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.

Export settings

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?

List filters in chat for removal

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

Freeze when changing wildcard token image

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).

Not able to install

Attempting to install from Foundry Module finder will result in "Not found" error.

Is bundling pixi-filters in this module required?

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?

Enhancement: Automatic token effects based on attribute/property changes

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.

TMFX effects not turning off automatically

Token Magic Issue w_DAE

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.

Side menu

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:

  • remove all filters from selected token
  • remove all filters (from everything)
  • apply filter (premade ones or even custom and maybe accepting an import and add a custom to the list as well)

You could take as an example the module FX Master side menu.

Webm support?

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.

Shadow shouldn't move with zoom

Currently, the shadow filter moves when you zoom in or out. Is it possible to prevent this?

2020-10-25 17 18 46

Also, the art becomes blurry when any filter is applied. Is this inevitable?

Enhancement: Rotate Effect

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).

Shader compilation 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.

Turning off specific effect?

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)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.