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

Add DSA5 System support #103

Closed Nyhles closed 3 years ago

Nyhles commented 3 years ago

System Name: DSA5

System Repository or Foundry VTT address: https://github.com/Plushtoast/dsa5-foundryVTT

Does the system has the languages set up on Foundry? No

Does the system uses languages as skills? No, languages are Items.

Additional context The System is a typical fantasy setting much like D&D.

I can provide a list with the languages and wich font would be best, but the actual implementation is still needed. If I can help any more, let me know.

mclemente commented 3 years ago

I'd like to have the list and fonts. Should character with Level 1 be able to understand/speak the language or should that be exclusive to Level 2+? How would you handle Literacy? Would you add a general ability as "Literacy (Name)" on the sheet?

Nyhles commented 3 years ago

Thank you for already adding partial support. I will send you the list with the corresponding fonts (like the .json files in settings\?) by end of the week.

Languages in DSA5 range from Level 1 to Level 3. A character with 1 Level in a given language should idealy be able to partialy understand the language, as in some words are scrambled and others not. Much like in #62 requested. Since that is not implemented I would think with one rank in the skill you should understand the langueage fully for the time being.

Literacy is handled by having a ability with name "Schrift (Name)" . There are no levels for literacy. Since a every script corresponds to a language i'd simply give them the same fonts.

Is that what you meant or have I missed something?

mclemente commented 3 years ago

That was it all. The only way I could implement levels of understanding for now would be binary (Level 1 wouldn't understand anything). I could make Literacy separate for Journals, but it would probably be unnecessary for most games (e.g. the GM could just not allow the player to read a Journal). Both those features would be better as general functions rather than exclusive to DSA. Whenever I manage to implement those, DSA will probably the first to get them.

Nyhles commented 3 years ago

The module/dsa5.json file is added, but there is more to be done to make it compatible. In the polyglot.js I think there needs to be a case "dsa5": this.loadLanguages("dsa5"); break; added. Polyglot seems then to use the dsa5.json file because it uses the default font I choose for every language.

I am not sure why it doesn't use the fonts I specified for any given language, I guess it doesn't recognize them as the corresponding language.

Another thing is that polyglot doesn't work in the journals, but it would be good to get it running with the specified fonts first.

Nyhles commented 3 years ago

Apparently it is still not working as intended, at least for me. All languages are scrambled with the _default font. I'm not to sure what else is needed. The Language Items are created eg. Language (Garethi) or Sprache (Garethi) for german. They do exist in the dropdown menu to select which should translated.

mclemente commented 3 years ago

Try replacing your dsa5.json with the following:

{
  "alphabets": {
    "altes alaani": "130% HighschoolRunes",
    "angram-bilderschrift": "130% Skaven",
    "chrmk": "130% Iokharic",
    "chuchas": "130% Kargi",
    "protozelemja": "130% Kargi",
    "yash-hualay-glyphen": "130% Kargi",
    "geheiligte glyphen von unau": "130% HighDrowic",
    "hjaldingsche runen": "130% OldeThorass",
    "imperiale zeichen": "130% Infernal",
    "isdira-zeichen": "130% Tengwar",
    "asdharia-zeichen": "130% Tengwar",
    "kusliker zeichen": "130% MiroslavNormal",
    "nanduria-zeichen": "130% Espruar",
    "rogolan-runen": "130% EldarFutharkFS",
    "torwalsche runen": "130% Floki",
    "trollische raumbildschrift": "130% Eltharin",
    "tulamidya-zeichen": "130% Valmaric",
    "ur-tulamidya-zeichen": "130% OldeEspruar",
    "zhayad-zeichen": "130% Pulsian",       
    "unbekannt": "130% Ophidian",
    "atak": "130% FingerAlphabet",
    "fjarningsch": "130% Dethek",
    "goblinisch": "130% OrkGlyphs",
    "mohisch": "130% JungleSlang",
    "nujuka": "130% Reanaarian",
    "ogrisch": "130% OrkGlyphs",
    "oloarkh": "130% OrkGlyphs",
    "ologhaijan": "130% OrkGlyphs",
    "rabensprache": "130% Valmaric",
    "amulashtra": "130% Qijomi",
    "drakhard-zinken": "130% Celestial",
    "gimaril-glyphen": "130% Semphari",
    "arkanil": "130% ArCiela"       
  },
  "tongues": {
    "_default": "unbekannt",
    "asdharia": "asdharia-zeichen",
    "atak": "atak",
    "aureliani": "imperiale zeichen",
    "bosparano": "kusliker zeichen",
    "fjarningsch": "fjarningsch",
    "garethi": "kusliker zeichen",
    "goblinisch": "goblinisch",
    "isdira": "isdira-zeichen",
    "mohisch": "mohisch",
    "nujuka": "nujuka",
    "ogrisch": "ogrisch",
    "oloarkh": "oloarkh",
    "ologhaijan": "ologhaijan",
    "rabensprache": "rabensprache",
    "rogolan": "rogolan-runen",
    "rssahh": "chrmk",
    "ruuz": "tulamidya-zeichen",
    "saga-thorwalsch": "hjaldingsche runen",
    "thorwalsch": "thorwalsche runen",
    "trollisch": "trollische raumbildschrift",
    "tulamidya": "tulamidya-zeichen",
    "ur-tulamidya": "ur-tulamidya-zeichen",
    "zelemja": "chrmk",
    "zhayad": "zhayad-zeichen",
    "zyklopäisch": "kusliker zeichen"
  }
}
Nyhles commented 3 years ago

I did, but still only the default Ophidian font.

mclemente commented 3 years ago

I've finally got the time to properly look into it. Long story short: Tongues needs all the tongues that you've wrote on Alphabets, otherwise it'll use the default font.

Long story long:

_getFontStyle(lang) {
    return this.alphabets[this.tongues[lang]] || this.alphabets[this.tongues._default]
}

The module checks for the language's name on tongues (e.g. "Altes Alaani"), if it isn't there, it'll use the default. For example, it'll show the correct font for "Trollisch", because it is on tongues, but not Altes Alaani. Also, alphabets only needed one entry for each font (e.g. you only needed one alphabet with OrkGlyphs, not four), but you can leave it as it is.

mclemente commented 3 years ago

I'd fix it myself, but I'm not sure which are languages and which are just fonts. By the way, don't change the casings, they were correct.

Nyhles commented 3 years ago

Thanks for all the work so far.

The way it currently is all existing tongues are under tongues and all alphabets under alphabets. The tongues reference the corresponding alphabets, but the alphabet has a different name than the language that uses it.

You said "Trollisch" should work but as I tried to use it, it still only display the default font.

To test your suggestion, I've added everything that was under alphabets to tongues but still to no avail.

If you'd like you can test the system compatibility: https://foundryvtt.com/packages/dsa5