vtt-lair / token-replacer

Foundry VTT - Automatically replace NPC actor tokens and/or portraits dependent on token assets saved in a defined folder structure
MIT License
5 stars 4 forks source link

Replacement not working for actors with multi-word names #59

Closed The-Grison closed 3 years ago

The-Grison commented 3 years ago

Thanks for making this! I love the functionality and I have it partially working, but I'm having a few issues:

1) My token and portrait replacements function correctly, but only for actors with single-word names (e.g., "Goblin"). For actors with multi-word names (e.g, "Bandit Captain"), no replacements occur and the existing artwork is retained. 2) I added portrait images to the same image directory, prefacing filenames with "Av" (avatar) and specifying "Av" as the portrait preface string. Portraits replacements work (at least for single-word-named actors), but this introduced a new issue: The wildcard token matching also selects the portrait images ("Av_Actor_Name") as matches, so I get a mix of token and portrait art each time I drag an actor token onto a scene.

EDIT: I was able to resolve both of these issues by selecting the "Use NPC Difficulty Folder Structure" setting, even though I'm not actually using such a folder.

Finally, I have a feature suggestion:

Thanks again!

vtt-lair commented 3 years ago

Thanks, will have a look at this during the week.

vtt-lair commented 3 years ago

@The-Grison I'm glad to see that you were able to resolve the issue. Can you possibly share a screenshot of your token folder for me please? The "Use NPC Difficulty Folder Structure" is supposed to then use the NPC Variable setting (cr by default) to look for the images in a structure where the files are saved into those difficulty folders. Just want to see if I can replicate the issue that you were experiencing

For instance mine is setup as: image

And then the files are setup as: image

And my settings are then: image image

Which basically should translate to: Look for the images in the directory. The images will be in a folder structure defined by the NPC Difficult Name, using No Spaces in the folder name (eg. cr1, cr2 etc). The images will use Underscores between the names (eg Animated_Armor_1.png, Animated_Armor_2.png etc)

If I removed the "Use NPC Difficulty Folder Structure", it would just look for the images in the Directory and not worry about the subfolders.

The-Grison commented 3 years ago

I’m happy to send a screenshot, but just to be clear, my token folder is just a single folder with no subfolders. I only checked the “use NPC folder structure” box because doing so seemed to fix the issues I was having, even though all my tokens are just in a single folder. Let me know if you still think a pic would be helpful.

Thank you,

From: Werner Dohse @.> Sent: Monday, March 29, 2021 12:03 AM To: vtt-lair/token-replacer @.> Cc: The-Grison @.>; Mention @.> Subject: Re: [vtt-lair/token-replacer] Replacement not working for actors with multi-word names (#59)

@The-Grison https://github.com/The-Grison I'm glad to see that you were able to resolve the issue. Can you possibly share a screenshot of your token folder for me please? The "Use NPC Difficulty Folder Structure" is supposed to then use the NPC Variable setting (cr by default) to look for the images in a structure where the files are saved into those difficulty folders. Just want to see if I can replicate the issue that you were experiencing

For instance mine is setup as: https://user-images.githubusercontent.com/33215552/112798128-c0c5fa80-906c-11eb-9e30-73277412b60e.png

And then the files are setup as: https://user-images.githubusercontent.com/33215552/112798152-ca4f6280-906c-11eb-9c31-671239fee695.png

And my settings are then: https://user-images.githubusercontent.com/33215552/112798226-e81cc780-906c-11eb-91c3-cf42aa0a14de.png https://user-images.githubusercontent.com/33215552/112798202-e05d2300-906c-11eb-9c72-51072b152eda.png

Which basically should translate to: Look for the images in the directory. The images will be in a folder structure defined by the NPC Difficult Name, using No Spaces in the folder name (eg. cr1, cr2 etc). The images will use Underscores between the names (eg Animated_Armor_1.png, Animated_Armor_2.png etc)

If I removed the "Use NPC Difficulty Folder Structure", it would just look for the images in the Directory and not worry about the subfolders.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vtt-lair/token-replacer/issues/59#issuecomment-809125710 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ATGXQQASZOLDP7UMHZI5QNLTGAQ3PANCNFSM4ZEQWK3Q . https://github.com/notifications/beacon/ATGXQQA3DBL7IZ7JWKDEIBTTGAQ3PA5CNFSM4ZEQWK32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGA5EOTQ.gif