Feu-Secret / Tokenmagic

A Foundry VTT module that allows you to add animations and graphic effects to tokens, tiles, templates and drawings.
GNU General Public License v3.0
51 stars 36 forks source link

[Question] Add more default presets to Effects #237

Closed JamesBrandts closed 1 year ago

JamesBrandts commented 1 year ago

I see there are a set of defaultPresets on TokenMagicFX, and it seems it's from there that DAE gets the list of effects available on the macro.tokenMagicFX flag, and it works great and is much easier than creating a macro on every spell/feature, but I'd like to add more effects to that list, so I can use more abilities this way. For example, I use an effect on Hunter's Mark target, I want to create a similar effect, but with a different coloration for Hex targets. Is there a way I can do that in my game?

Aedif commented 1 year ago

You can add these by running code such as following:

TokenMagic.addPreset("myElectic (Yellow)", [{
    filterType: "electric",
    filterId: "myElectric",
    color: 16774912,
    time: 0,
    blend: 1,
    intensity: 5,
    animated :
    {
      time : 
      { 
        active: true, 
        speed: 0.0020, 
        animType: "move" 
      }
    }
}])

This is describe on the main module page:

(async) TokenMagic.addPreset(<presetName>,<params>,optional <silent>)

// Example
// You don't need to add a filterId when creating a preset. The filterId is created with the preset name.
// In the example below, the filterId will be equal to "FunnyGlow"
// silent to true if you don't want a confirmation message to appear when the preset is created
let params =
           [{
               filterType: "glow",
               color: 0x4090FF
           }];
TokenMagic.addPreset("MyCustomGlow",params);

I made a small video a while back that showcases how to copy a macro into a preset both manually as well as using a macro that comes together with Mass Edit module:

https://cdn.discordapp.com/attachments/811286937377308702/1059742540359798784/presets.mp4

JamesBrandts commented 1 year ago

Thank you so much, this is amazing