Code Monkey home page Code Monkey logo

fvtt-module-polyglot's Introduction

GitHub release GitHub release (latest by SemVer and asset)

ko-fi

Polyglot

Talk to others using a language you can speak and scrambles text you can't understand, into several fantasy scripts.

How to Use

As a GM

  • Check the module settings to configure it according to your preferences.
  • Select tokens to speak as them.
  • Change the default editor of the Journal Sheet to TinyMCE if you intend to use the Journal feature.
  • Check the wiki for more in-depth information.

As a Player

  • Assign a character on the User Configuration window.
  • Talk as your character. Select other owned tokens to read and speak as them.

Attribution

Community Contribution

See the CONTRIBUTING file for information about how you can help this project.

fvtt-module-polyglot's People

Contributors

brothersharper avatar crnormand avatar demianwright avatar dilomos avatar drdwing avatar eldritchtranslator avatar elizeuangelo avatar fenaldar avatar hmqgg avatar iksior avatar juanfrank avatar kakaroto avatar karelzavicak avatar kelliak avatar kristianserrano avatar leratierbretonnien avatar lioheart avatar lozalojo avatar lozanoje avatar mclemente avatar nekrodarkmoon avatar nyhles avatar ollie2304 avatar osijr avatar patrickporto avatar plushtoast avatar rectulo avatar schultzcole avatar xdy avatar zraaa78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fvtt-module-polyglot's Issues

Disable highlight

Hello, I would like the option to disable the yellow highlighting. Thanks!
image

Language Module Integration

A module known as "Obsidian" or https://bitbucket.org/Fyorl/obsidian/src/master/ could work wonders as using both Obsidian and Polyglot just doesn't work, this is because Obsidian is using a different character sheet then the default and well it would be nice if Polyglot could recognize Obsidian's sheet, so maybe a support?

Yeah, I couldn't figure out the pull request if this is where it goes.

Can't set a custom language + anyone has ONLY a custom language can understand all the languages

Environment Details

Foundry VTT Version: 0.7.1

Operating System: [Linux]

How Are You Using Foundry: [Linux,Native Application (Electron), Chrome]

Which Game System: Dungeons and Dragons 5th Edition, version 0.95

Modules Enabled?: Yes

Module Version: 1.1.1

Description of the issue:

For help you with the tests here the token npc with a custom language i'm tring to use:

fvtt-Actor-Wight.json

(1) Can't set a custom language on a player for make understand that custom language to other

I'm want to set between two token 1 npc and 1 player (but it's mean nothing) a custom language.

  1. The npc already have a custom language "test"
  2. i set a custom language called "test" on the player
  3. With the npc i write something on the chat log,
  4. Go to the player token where i set a custom language with the same name "test" but can't understand what the npc have said.

img1

(2) A player with ONLY a custom language can understand all the other languages (Orchis,Elvish,ecc.)

  1. The npc spoke with the orchish or elvish language.
  2. set a custom language "test" and the Orchis language on the player, all ok
  3. remove the Orchish language and set only the custom language "test" on the player, now i can "understand" all the other languages.

img1

let me know if you need other informations.

Add option to display translated text below original text

It's not always clear that the other person is speaking in a different language, if you don't catch the symbol in the upper right corner.

Would it be possible to add the option of displaying the original text untranslated with the translated text below it?

Polyglot

Thank you.

Chat message created with a macro is always in Common

Hello all,

I am triggering a macro from a MultiLevelTokens drawing area to speak as a token located elsewhere in the dungeon. When a player enters the drawing, it calls the below macro with the following arguments:

args[0] = V7AHiqGDjtQGvGtE
args[1] = "The Spider Queen blesses House Auvryndar! The battle to break House Freth's hold on the passages below brings victory after victory. We have seized key positions formerly held by our enemy. The defeat of House Freth is inevitable. Praise Lolth!"
args[2] = Elvish
args[3] = 2

The args[0] token knows Elvish and I have tried to trigger the macro with a non-elvish speaking character and an elvish speaking character. It always comes out the same in comon.

Here are my versions :
Foundry VTT v0.6.6
System: D&D 5E v0.98
Polyglot v1.3
Multileveltokens v1.3.4
// Speak a message from a specific token
//From Kekilla#7036's bubble macro 
//arguments required => args[0] === token_id
////////////////////////args[1] === chatContent
////////////////////////args[2] === language
////////////////////////args[3] === time in seconds

setTimeout(function() {
    let t = canvas.tokens.get(args[0]);
    if(t.actor?.data.data.attributes.hp.value === 0) {
        console.log("Speaker Token has 0 HP");
    } else {
        //target token

        //set language?
        $(`#polyglot select option [value=${args[2]}]`).attr("selected","selected");

         ChatMessage.create(    
        { 
            speaker : { token : t, actor : t.actor, scene : canvas.scene },
            content : args[1],
            type : CONST.CHAT_MESSAGE_TYPES.IC,
        },{chatBubble : false});
        ui.notifications.notify(args[1]);

        if(region !== null) {
            region.data.hidden == false;
            region.update({flags: {"multilevel-tokens": {disabled: true}}});
        }
  }
}, (args[3]*1000));

Language Macro

I have some lore drops and hints on walls, that I use triggers to show on Journal what is written to players and would be nice to be able to show with a chat macro, with the user reading on the language instead; If already possible, would like to know what command to use.

Add ability to customize fonts

The json files for the fonts get overwritten by updates, users would want a way to customize them with a setting option (path to json to use? need for css?) which persists across upgrades.

Comprehend Languages - Feature Request

Is there an option to support the comprehend languages or tongues spell?

Maybe make it where that spell creates a status effect on a token and then anybody with that effect can unscramble any spoken text or journal entry.

For an easier implementation, could just let the GM temporarily unscramble the text by selecting the token of the player that cast the spell and then click the globe to unscramble it for that token.

When an ability has a limited number of charges, it can still be used even when there are no charges remaining.

One of my players has a feature that can only be used once per short/long rest, so i have given the ability 1 charge.

Screen Shot 2020-09-12 at 16 21 56

When it is used the first time, the charge depletes from 1 to 0. Ideally, if the player tried to use it again, they would not be able to, instead getting an error message/similar (like they do when they try to cast a spell when they don't have a spell slot). This is the default behaviour when better rolls is disabled (an error message and the ability isn't sent to the chat), but with better rolls active, this check is circumvented and the ability is used again when it shouldn't be available.

Feature Idea - Gradual Language Proficiency

Understanding and learning languages takes time. Unfortunately, the current form of Polyglot is either 100% or 0% understanding. No inbetween. Whilst this is functionally alright, I would greatly desire the ability to have languages understood in gradual amounts.

The ideas behind this is that only some words are runes instead of text. Or only pieces of words, though that would likely be far more complex to program. I am no programmer, myself. I simply thought up the idea, and decided to make noise about it. Whether or not this is possible, I could not say.

Regardless, I adore Polyglot, as it allows me to actually have differences in languages, and not just have to hope the players don't cheat. To whomever reads this, I hope you have a pleasant morning/afternoon/evening.

Polyglot Error when selecting tokens

I don't know if this is an escape character thing but I get this whenever I click on one of my characters with Polyglot active and the polyglot language dropdown does not appear.

Error: The values of the provided object must be unique in order to invert it.
at invertObject (foundry.js:1129)
at Function.get defaultLanguage [as defaultLanguage] (polyglot.js:49)
at PolyGlot.updateUserLanguages (polyglot.js:175)
at PolyGlot.controlToken (polyglot.js:82)
at Function._call (foundry.js:2496)
at Function.callAll (foundry.js:2456)
at Token.release (foundry.js:11661)
at Token.release (overrides.ts:9)
at TokenLayer.releaseAll (foundry.js:12285)
at TokenLayer.releaseAll (foundry.js:40319)

Languages that appear in the character sheet as available:
image

Custom Languages that are currently active in the settings (I have not removed the defaults):
Ovidic,B.A.S.I.C,Fae,Stoutkin,Elfkin,Fiendkin,Greenkin,Moan,Old Heartlandic,Arborkin,Ancient Clont,Thieves' Cant,Draconic,Druidic,Abyssal,Celestial,Wildtongue

Default:
Ovidic.

I had a lot of dashes and parenthesis before which I've dropped, so I don't know if that is affecting things?

This is happening on 0.7.9 / Polyglot 1.4.0.

Any suggestions?

Warning about bad maxzones for Thorass Font

Foundry 0.7.9, dnd5e 1.2.0, Firefox 84.0.2, Mac OS X 10.15.7. I get this warning in the console when loading the polyglot module:

downloadable font: maxp: Bad maxZones: 0 (font-family: "Thorass" style:normal weight:400 stretch:100 src index:0) source: https://[FOUNDRY SERVER URL]/modules/polyglot/fonts/Thorass.otf

Googling "bad maxzones" comes up with some discussions but no obvious culprit. I don't know if it is affecting the rendering. Maybe if I knew what language corresponds to the Thorass font, I could check.

Everyone understands common

Whenever I type something into chat and hear my players saying "Wrong language again!", I painfully realize my NPC doesn't have common as a language, but rather "custom", "any two languages" or similar. This obviously makes it impossible for me to write as the NPC and so I have to manually add common to each and every NPC I make or copy from a compendium.

So my request, please add two things:

  1. Every actor has a "common" language in their drop down regardless of whether they actually have it or not.
  2. Every actor defaults to "common" or the language that was last used with that actor.

Another workaround would be to just have polyglot default "global" or "unscrambled" instead of "common".

Thank you very much in advance.

REQUEST: Language Groups

In theory, everyone who speaks Auran can also understand Terran, Ignan, Aquan, and Primordial. Not to mention language groups that are mutually intelligible in homebrews. Could there be a way to add languages to a set so they can be mutually intelligible without losing the flavor of those languages being differently named? Thanks.

some languages are part of language families and should be interchangeable.

From 5e PHB, p. 123

Some of these languages are actually families of languages with many dialects. For example, the Primordial language includes the Auran, Aquan, Ignan, and Terran dialects, one for each of the four elemental planes. Creatures that speak different dialects of the same language can communicate with one another.

Polyglot option disappeared in native app

Since the update, I have no way of using the Module when I'm navigatig in the native app.
It works great in my browser, but not at all in the application itself.

Chat history and lag

  1. Refershing the game messes up the chat history. It shows the lastest ones from the 1 hour ago chat to as far back from 24 hours ago. The chat history returns back when the module is removed.
  2. Selecting and deselecting tokens generate a 2 sec lag (for the GM). I believe since each token will have different available languages and the GM has all languages available, the module takes time time to adjust it?

Manage All Languages

Currently, we can use Polyglot to add some custom languages, which is awesome - but I'd love to see the module take the next logical step, and allow complete control of the languages available in a campaign. For example, the world I'm setting up doesn't have any use for gith, so I'd like to be able to remove it from the available list entirely to reduce clutter.

Hide which lenguage was set on chat

I realizied when I set a lenguage that the players don't know it's possible to check wich lenguage it is by movimento the pointer at the words.

There os any way to hide that?

IMG-20200521-WA0009

Custom languages for players

It gives the ability for the DM to use Custom languages when he types for players, but it doesn't give the players the ability to type in those custom languages even if they Know them.

Feature request: Being able to see the langage used

Hi!
Tanks for the awesome module, it helps a lot with immersion, but I have one caveat that I could not fix myself. When someone speaks in Elvish, for example, there is no way to see (even for the GM) what language it is. It would be nice to have an option to see something like "(Elvish) scrambled text"

Thanks!

Having polyglot enabled prevents the configure settings from opening.

Throws the console error:

    at JSON.parse (<anonymous>)
    at ClientSettings.get (foundry.js:3031)
    at ExtendedSettingsConfig.getData (foundry.js:39119)
    at ExtendedSettingsConfig.getData (settings-extender.js:359)
    at ExtendedSettingsConfig._render (foundry.js:3854)
    at ExtendedSettingsConfig._render (foundry.js:4466)
    at ExtendedSettingsConfig.render (foundry.js:3824)
    at Settings._onSettingsButton (foundry.js:41794)
    at HTMLButtonElement.dispatch (jquery.min.js:2)
    at HTMLButtonElement.v.handle (jquery.min.js:2)```

Crash with DnD 0.91 and FVTT 0.6.0

After launching the game

foundry.js:2213 TypeError: canvas.tokens.controlledTokens is not iterable
    at PolyGlot.updateUserLanguages (polyglot.js:66)
    at PolyGlot.renderChatLog (polyglot.js:26)
    at Function._call (foundry.js:2210)
    at Function.call [as __furnace_original_call] (foundry.js:2195)
    at Function.callOriginalFunction (Patches.js:56)
    at Function.<anonymous> (Debug.js:42)
    at ChatLog._render (foundry.js:3865)
    at async ChatLog._render (chat-autoloader.js:43)
    at async Sidebar._render (foundry.js:24480)

Document in the README the out-of-character vs in-character situation

Is there a way to speak in a language out of character, as in without having a token which speaks it selected?

For example, if my players find a message scribbled on a wall in draconic, and i want to post a message so the players who can read draconic can understand it, i can't seem to find a way to easily do this if there isn't an NPC i can hijack on the map, and it's rarely worth it to make a journal entry for a quick message.

If i could just choose the language from the drop down then type out the message and post it, that would be really useful.
If possible, I don't just mean typing "/draconic message", because I am a forgetful moron and have ruined a couple of secret messages by forgetting to type /ic before writing the message, which instead posts the message OOC and in english/common rather than the language i have selected from the drop down.

Otherwise, thanks for this awesome module! It is such a cool idea and I love it!

Translation Issues w/ PF2E?

Issues are all with PF2E system. It seems to recognize their known languages for the purposes of selecting them in chat

  1. When GM selects an NPC and speaks in a language one of the PCs knows, it does not translate in their chat, and shows a red globe.
  2. When GM shares a journal entry written in a language known by one of the PCs, the glyphs still show up, giving no option to translate.

image
GM view: shows Isaac knows Draconic, and that the Charau-ka spoke in Draconic, but the globe shows red as if Isaac doesn't know the language.

image
Player view: the player is speaking draconic, but still does not seem to comprehend draconic.

image
Player view: This is a journal entry with text in both Draconic and Dwarven. The player is still Isaac, and is selected.

Module not working as of 0.7.3

When renderChatLog is called, the canvas isnt yet rendered and updateUserLanguages bugs the entire module. There is no canvas.tokens.controlled (canvas is null).

image

Could someone else confirm having this issue?

Make it work with journals

Journal owner could have a selection for the language, and if it's shown, anyone not speaking the language wouldn't be able to understand it

Unable to edit journal entries when Polyglot is enabled.

When Polyglot is enabled clicking the edit button in the top right of the text field in the journal causes all text to disappear and the edit UI does not appear at the top of the text field.

Text can be typed still, but no edits save.

Running on a Pi4B, narrowed down using Find the Culprit.

Savage Worlds

Is there any way you can add support for Savage worlds for this Module? I would love to have this for Savage Worlds.

Always default to default language?

I was hopeful with the new ability to pick a default language.... but that setting doesn't seem to actually do much. Even when set to 'Common', or left blank to be system default, when my character logs in the language is set to the first language he speaks, alphabetically. In this specific case that means logging in the chat window is set to Celestial before Common.

Further, it might be helpful to have the option to have the language revert back to the configured default language after every message is sent, and to only use a non-default language when explicitly chosen for that message. This would avoid the frequent problem we have in the game of players having to type things twice because they forgot to reset their language choice. This is especially problematic at the start of game when players are logged in with the wrong default language (and has unfortunately given the table a poor impression of the software).

Include Chatbubble as a part of language scrambling

As a GM, some users may wish to use FVTT's chatbubble during text conversation. Currently, chatbubbles are not affected by polygot. Perhaps a future implementation could include an option to use chatbubbles as well?

Thanks!

Chat Bubbles aren't always translated

I have a macro to replicate the module NPC Chatter, but with the added functionality of being able to choose a language from Polyglot. So on a timer, a random message is pulled from a table and displayed in Undercommon. Here's my code:

const chat = () => {
  // Roll for speech and choose a token
  const result = game.tables.getName("Xulgath Speech").roll().results[0].text;
  const activeScene = game.scenes.filter((x) => x.active)[0];
  const eligible = activeScene.data.tokens.filter((t) =>
    t.name.toLowerCase().includes("xulgath")
  );
  var speakToken = eligible[Math.floor(Math.random() * eligible.length + 0)];
  let speakActor = game.actors.entities.find((c) => c.name === speakToken.name);

  // Make the token speak
  $(`#polyglot select`).val("undercommon");
  console.log(speakToken, speakActor, activeScene, result);
  ChatMessage.create(
    {
      speaker: { token: speakToken, actor: speakActor, scene: activeScene },
      content: result,
      type: CONST.CHAT_MESSAGE_TYPES.IC,
      flags: {
        polyglot: {
          language: "undercommon",
        },
      },
    }
  );
  // chat bubble
  game.socket.emit("module.npc-chatter", {
    tokenId: speakToken._id,
    msg: result,
  });
  canvas.hud.bubbles.say(speakToken, result, false);
};

// Print one message immediately
chat();
// Timer
//NpcChatter.timer = window.setInterval(() => { chat(); }, 2000);

Every once in a while, independent of the message being printed and token speaking, the message is not translated in the chat bubble. You can see in the screenshot below, all 3 messages print in the chat log correctly.

image

Here's the error thrown in the console in these cases
image

Currently implementing both the flag and the selector mentioned in this issue. If the selector isn't implemented, no chat bubbles are translated (in essence, the flag doesn't apply, since it's only on the chat message).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.