KayelGee / token-attacher

MIT License
11 stars 18 forks source link

Token Attacher not working in Pathfinder1e system #104

Closed Vaank closed 8 months ago

Vaank commented 1 year ago

When importing actors with Token Attacher from the compendium this errors pop up and no actor is imported. It happens in Foundry v10 and v11. It only happens in pf1e (that I've tried). Other systems like DnD5e and pf2e seems to work fine. Update: it only happens from pf1 v9.1 and on. In previous versions of pf1 it works just fine. image

mkahvi commented 10 months ago

Issue looks to be that TA looks for basic actor type specifically for all systems.

game.system.template.Actor.types[0] should be the best way to fetch valid actor type outside of introducing your own type as Foundry v11 has made possible.

mkahvi commented 10 months ago

Additionally:

if(!actorType) actorType = game.system.documentTypes.Actor[0];

This isn't going to work in any system. This gives base and that is reserved actor type you can not create.

You should instead use

game.system.template.Actor.types[0]

or

game.system.documentTypes.Actor[1]

Vaank commented 8 months ago

Thanks for the update, but it doesn't seem to be fixed for Pathfinder First Edition when importing a Token Attacher Actor Compendium. The compendiums look empty. Additionally it also seems to be broken for Pathfinder Second Edition now. DnD5e seems to work fine.

Am I missing something? Should I make any change to my Modules?

KayelGee commented 8 months ago

I only checked superficially if my changes worked properly. I'll check later if I made some mistake.

KayelGee commented 8 months ago

Should be fixed now. Can you try again @Vaank?

Vaank commented 8 months ago

It seems to work perfectly in Pf1, Pf2e and DnD5e. Thank you so much.