Aedif / TokenVariants

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

Is there a way to change what I want as the Root Folder? #51

Closed Ozefox closed 2 years ago

Ozefox commented 2 years ago

Hey man, I love this module!!! Makes life easy.

However, I keep running into the issue that my 'map' assets will get caught in the search. Is there a way to make sure that only the paths I choose get scanned and not the main folder?

Aedif commented 2 years ago

Hi,

It should already work like that. The module should only scan folders under the path you added in 'Search Paths'

e.g. if tokens/npc/ has been entered the module will only look at folders inside npc tokens/npc/monsters/ tokens/npc/villagers/

and will not look into tokens/pc/Aedif/ or tokens/pc/Lanfer/

Would you mind telling me what type of paths you're using? S3, imgur, regular, etc

Also are you running on forge or some other hosting service?

I had to fix issues with such platforms before as they would treat invalid paths as simply starting at the root.

Ozefox commented 2 years ago

I added three pics to help out. Im just trying to grab these folders. Ive tried putting them outside of my AppData, and individually.

Token 3 Token pic 2 Token pic_LI

Aedif commented 2 years ago

Ahh interesting. Yes I see the problem now and was able to reproduce it. When given the full path e.g. C:\Users\vaitk\AppData\Local\FoundryVTT\Data\modules\caeora-maps-tokens-assets\assets\tokens\ Foundry will default to the root folder.

You should instead use relative paths.

So for the path I've shown above, it would instead need to be: modules\caeora-maps-tokens-assets\assets\tokens\

See there is a limitation with Foundry in that it doesn't allow modules to access any directories outside of the Foundry's Data folder. When you provide a full path (including the driver letter) it is not smart enough to figure out that you're pointing to a folder within the Data folder and instead just immediately gives up.

If you want to keep your asset folders outside of the FoundryVTT\Data folder and don't mind typing out a couple of commands in the command line you can do the following:

Open up Command Prompt as an administrator:

image

And create a folder in your FoundryVTT\Data that points to some other folder in your file system by running the following command:

mklink /D path/to/a/new/folder/in/foundry/data/ path/to/some/other/folder/on/your/pc/

e.g. image

Ozefox commented 2 years ago

Dude... Thank you so much! I had been trying to figure it out for ages! I appreciate your help!