mclemente / fvtt-module-polyglot

Talk to others using a language you can speak and scrambles text you can't understand.
MIT License
41 stars 48 forks source link

World-specific "Common" language #330

Closed Xelalego closed 11 months ago

Xelalego commented 11 months ago

I want to set the "common" language to a different language in each world.

I have several worlds, one for each campaign in the same setting, and I want the worlds that are in different time periods or regions to have different instances of the "common" language. Currently if I set the common language in one world, all worlds with polyglot active use that language instead of their particular version of common.

The result is that currently, after setting the common language in a world, all other polyglot worlds start using Common (as in vanilla common) instead of what I had the Common language set to previously.

I'm not sure how this setting is handled under the hood, but I would imagine it's a simple matter of saving it in the world data rather than in the module itself.

mclemente commented 11 months ago

Are you on the latest version of Polyglot? That issue was supposed to be fixed on v2.2.

Xelalego commented 11 months ago

Ah, I was not. I had clicked "Update all packages" recently but I think it didn't catch all of them, and it was verified for the current Foundry version so I thought it was up to date. I have updated it now, and it seems to be working, but it still lists Common and Reitzil (my version of common) in each player's language dropdown. Is this intended?

mclemente commented 11 months ago

No, it shouldn't. Do the players have the Common language known, though? It should default to the world's default language if their characters don't know any.

Also, I've found another bug related to the default languages when bug hunting for this, so I might have fixed that behavior with the fix, so try updating again and let me know if it persists.

Xelalego commented 11 months ago

It still lists Common among the PCs' languages, even though they do not have it listed on their sheets. They do all have the common language of the region known, and that language shows up as intended, but Common still pops up also.

Xelalego commented 11 months ago

Okay, after a little more testing, it appears as though any languages granted through automation (common being the most, well, common) still show up as options in the dropdown even though they don't appear on the character sheets

mclemente commented 11 months ago

What do you mean by automation? Other modules adding languages through Active Effects or some other thing? If that's the case, there isn't much Polyglot can do about them.

Xelalego commented 11 months ago

I mean from features that grant languages, such as Ancestry. For example, my Automaton player gains Utopian as a language simply from being an Automaton, and that language appears in the dropdown even though (like common) it doesn't appear on the sheet with Polyglot active

mclemente commented 11 months ago

PF2e's logic is updating with the selected languages and then applying the ancestry's languages, even if they don't exist, so they aren't shown on the sheet but they're on their data.

This is a PF2e issue, not a Polyglot one, as in, that behavior happens without Polyglot, it just isn't perceived since nothing interacts with that data. I've opened an issue about it https://github.com/foundryvtt/pf2e/issues/10911

The quick fix is to edit the ancestries to not have those languages, either the one on the compendium or the one already on the actors.

Xelalego commented 11 months ago

Would it be possible to add a sort of language dictionary so that any time a PF2e language is referenced, Polyglot automatically replaces it with whichever language is listed as its parallel?

mclemente commented 11 months ago

What would be the use case for it? Can't you just add the PF2e languages you want to keep as custom languages on Polyglot?

Xelalego commented 11 months ago

The issue is that if I change the feats themselves which grant specific pf2e languages, I now have to either set those new versions aside in a new compendium or I need to re-edit them every time the pf2e system updates. I'd rather just map those pf2e languages to my homebrew languages so that the rule element treats those languages as mine instead. Essentially, if I map "Utopian" to "Empirical Standard", then any time someone has a rule element or a language from an ancestry which is "Utopian", it adds "Empirical Standard" to the sheet instead of "Utopian"

mclemente commented 11 months ago

Update to 2.3.13 and it should be fixed.

Xelalego commented 11 months ago

The bug is fixed, thanks!