Aedif / TokenVariants

GNU General Public License v3.0
18 stars 12 forks source link

What are the flags for the variant art so we can trigger changes with Monk's Active Tile Triggers #155

Open stevenagl12 opened 5 months ago

stevenagl12 commented 5 months ago

Alright, possible a dumb question, but what are the token flags for the variant art images that you have selected for the image so that you can assign them to a Monk's Active Tile Trigger and be able to change their appearance automatically?

Aedif commented 5 months ago

What TVA images are you talking about? Shared (green arrows)?

stevenagl12 commented 5 months ago

Yes, when you have assigned the variants for an actor, is there an internal flag to be able to change them? Basically I am trying to be able to cause mimic tokens to switch to an active state, or changelings to release their true form on a button click.

On Fri, Apr 19, 2024, 6:54 PM M. Vaitkus @.***> wrote:

What TVA images are you talking about? Shared (green arrows)?

— Reply to this email directly, view it on GitHub https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAedif%2FTokenVariants%2Fissues%2F155%23issuecomment-2067371923&data=05%7C02%7Csalewis%40g-mail.buffalo.edu%7C7bde62f9f59c4a5f569108dc60c3b892%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638491640927582252%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=WcV6zPRcUD9zO7ekf5YVBUg9KrDw07u5Cs9NIEPZNo8%3D&reserved=0, or unsubscribe https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHHKCLPYM7XLNJJQQURRUMLY6GODVAVCNFSM6AAAAABGPU7XEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGM3TCOJSGM&data=05%7C02%7Csalewis%40g-mail.buffalo.edu%7C7bde62f9f59c4a5f569108dc60c3b892%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638491640927582252%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=37VY7qI7ayATmqocHsK9DASXwAjBCwWSwB2v0LK4pzs%3D&reserved=0 . You are receiving this because you authored the thread.Message ID: @.***>

Aedif commented 5 months ago

I'm not sure exactly what you're trying to accomplish here, but the green arrow marked images are stored on the actor and so can be accessed like so:

_token.actor.flags['token-variants']?.variants

stevenagl12 commented 5 months ago

I'm trying to use a monk's active tile trigger to alter the variant image with a single clock so I can do 20 tokens at once, instead of individually changing each.

On Sat, Apr 20, 2024, 10:48 AM M. Vaitkus @.***> wrote:

I'm not sure exactly what you're trying to accomplish here, but the green arrow marked images are stored on the actor and so can be accessed like so:

_token.actor.flags['token-variants']?.variants

— Reply to this email directly, view it on GitHub https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAedif%2FTokenVariants%2Fissues%2F155%23issuecomment-2067696323&data=05%7C02%7Csalewis%40g-mail.buffalo.edu%7C61821a7084454eaba72108dc6148f7ce%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638492213227040959%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=p2HoQTmuqgzBm%2B%2FfLlmo8p%2FBT%2BgzpNwTabUzrdyC4hA%3D&reserved=0, or unsubscribe https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHHKCLMSXJNQAPWVEL33HMLY6J54PAVCNFSM6AAAAABGPU7XEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGY4TMMZSGM&data=05%7C02%7Csalewis%40g-mail.buffalo.edu%7C61821a7084454eaba72108dc6148f7ce%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638492213227040959%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=5ljy50tkgCa0LmYC3LlWKjUCWBvlDqEk8OjXzcViTjg%3D&reserved=0 . You are receiving this because you authored the thread.Message ID: @.***>

IsaCorreia commented 2 months ago

I'm trying to do something similar, but with the Eladrin Seasons.

Here's what I got (it's not working): I wrote a macro that creates/updates a flag inside token-variants namespace.

// Updates the flag "eladrinSeason" inside "token-variants" module namespace
const actorId = "4VQ2iNTYhOymlRvw";
var actor = game.actors.get(actorId);
var seasons = ["Outono", "Inverno", "Primavera", "Verao"];

var currEladrinSeason =  seasons[Math.floor(Math.random() * 4)];

const updateData = {
  ['flags.token-variants.eladrinSeason']: currEladrinSeason
};

actor.update(updateData);

(I'll add an image of said flag here later)

Then, I setup the token images image

And lastly I used the "Mappings" option for the token to create conditions based on that flag I created. image-1

The thing is, the expressions for Mapping don't seem to work properly. I tried adding script logs for when they are met or not, and they did run immediatly after I clicked "save & close", and ran 11 times. I was testing with just two tokens, and it was supposed to show Token A, and it showed Token B, I was using the example of "hp>50%" and "hp<=50%" for this test. But then it stops, and doesn't check for later updates on said flag anymore.

The string comparisson also doesn't work, even though the module's tutorial uses a similar expression in its tutorial Screenshot_20240706_125926_Chrome

I suppose working with JS inside the Expression could be a solution, but I haven't found any mentions about what is the expected return for that in de docs.