Hi there! You can find the script and its usage instructions here: Tongues Script Description I'm DMing a D&D campaign and wanted my players to actually speak some weird words while using other languages than Common and yet other users of the language get to understand them. I created this simple script which replaces words written by a same length word from the languages specific vocabulary lists. I had this idea after World of Warcraft's cross-faction communication system which translates your words when they are displayed to an opposite faction's player as they "don't understand your language". I wanted to share in order to other groups take advantage of this. The final result is a pseudo-translator which sends the translated text to everyone but whispers the orginal text to those who can speak the language used to translate. Note: the original text is always whispered to the GM, which could cause replication if you are also tagged as a character's controller since the script whispers both the GM and the characters. I hope someone find this useful! Changelog v1.0.0 - Release v2.0.0 - Improved parsing (special thanks to The Aaron) Now languages are loaded and parsed on script startup or whenever created, changed or deleted. Tongues will look for any handout prefixed with "Tongues: ". Restricted !tongues --create [name] command to only GMs. This command now also automatically prefixes languages handouts Added new examples & screenshots. v2.1.0 - Improved character parsing The script now searches for full names when checking the speakers of a language, no more nicknames, now you must write the full name of the character. Leaving empty rows on a language list doesn't causes the script to malfunction. If no vocabulary exists (empty rows) for a language, every word will be translated by sequences of '?' depending on word length. Will not send whispers to characters without any player in its "Can Be Edited & Controlled By" field, avoiding replication of whispers for GMs when talking through an NPC. v3.0.0 - Improved translation via hash (special thanks to Corin S.) Tongues now uses a hash to translate words, resulting in getting always the same translation to a given word. May cause weird translated sentences if not enough vocabulary is available. v4.0.0 - Dictionary, ignoring text and language knowledge Dictionary functionality which allows translation of specific sets of words to a given translation (ex: [Hello, Goodbye: Hellobye] will translate every "Hello" or "Goodbye" to "Hellobye") . This feature also supports sentences (ex: [You will burn in hell: Ag naz logash] ). New languages created by the command --create have a new template with a functional example. Translation is done from top to bottom, that means if [Hello: Hi] is declared before [Hello: Hey], only the first one will apply as every "Hello" will be translated to "Hi" first. Text between two $ symbols are ignored by the script. (ex: A message such as "Hi $John$ how are $you today$" will translate as "Az John jag nag you today"). Ignored text will be displayed in grey color when translating. Tongues now supports knowledge of a language, when writting down the speakers of language you must specify their level of knowledge with a ":" next to its name followed by a percentage (ex: Mannimarco:100%, Goblin Warrior: 50%) . This affects both speaking and understanding of a language. Every word has a difficulty between 1 and 100, a language speaker only will speak/understand those words that meet their % of knowledge. Any words not translated by the speaker (character who is sending the message doesn't have enough knowledge) will display in blue color when translating. Any words not understood by the listener (character who is reading the message doesn't have enough knowledge) will display in red color when translating. If you don't want to use this feature just give every speaker a knowledge of 100%. Read me inside Github is updated including the new features. v4.0.1 - Fixed GM Notes parsing Fixed an issue when parsing GM Notes not seprated by space after comma. Also, when speakers are written without a knowledge value after a ":" the script defaults the knowledge level to 100. Preventing parsing errors when swaping to the new version or just don't want to use the knowledge feature and keep GM Notes cleaner. v4.1.0 - Non-english characters parsing Now tongues parses every Unicode letter as a valid character for translation. v4.3.1 - New configuration commands Github's repository readme has a new section with all the available commands with their usage and examples. New command: !tongues --ability which creates/updates a token macro named "Tongues" for all the languages the selected character knows. New command: !tongues --set (language:knowledge%) which adds or updates the selected character's name on the provided language handout. You can optionally provide a knowledge % for the provided language, which will be added to the character's name on the handout. New command: !tongues --unset (language) which removes the selected character's name from the provided language handout. Both !tongues --set and - -unset commands after adding or removing a character from the handout will seek for an ability macro named "Tongues" on the selected character, if found, a command !tongues --ability will be executed for the character affected. v4.4.0 - New configuration command for GMs New command: !tongues --speaker (name) which saves the name to be used as the speaker's name when a !tongues (language) (message) command is issued by a GM without a token selected. This speaker name is saved across API Sandbox restarts so you will find that once you used this command once, the script will always remember your last saved name. Speaker name defaults to John Smith on fresh scripts. Examples & Screenshots I'm also leaving a few screenshots of some languages I configured for my own game for you to take as example: Disclaimer: my english is not perfect since i'm not a native speaker

Nice! I notice you're parsing the handout on every message, you could do that once at startup, then have an on('change:handout',...) event to reparse it if it ever changes. That should make message display much faster.

Do players also have the ability to send a foreign language text? If so, does the GM get the translation? For instance, if the two PC elves in the party wanted to make fun of the barbarian's haircut and still keep all their limbs, and would the GM be aware of what is being said?

keithcurtis said: Do players also have the ability to send a foreign language text? If so, does the GM get the translation? For instance, if the two PC elves in the party wanted to make fun of the barbarian's haircut and still keep all their limbs, and would the GM be aware of what is being said? Yes, only GMs can create a language template, but every player in the game can use the speak command, the script was created after that purpose. If the token they have selected represents a character and that character's name appears on the GM Notes of the language, the script will do the job. If the character is not listed on the GM Notes, a "you can't speak that language" message is sent to the player using the command. Regardless the characters it controls, the GM always gets the original text whispered. In my game my players are supposed to run the command, then say by voice the translated text and then any speaker of the language can see what that really means in their chat as the whisper works like some kind of "subtitles" for what a player is saying.

The Aaron said: Nice! I notice you're parsing the handout on every message, you could do that once at startup, then have an on('change:handout',...) event to reparse it if it ever changes. That should make message display much faster. Took your suggested approach to parsing handouts and it really works much faster. Thank you for that. Will upload the changes as soon as I can.

New version is now available. v2.0.0 - Improved parsing (special thanks to The Aaron) Now languages are loaded and parsed on script startup or whenever created, changed or deleted. Tongues will look for any handout prefixed with "Tongues: " to load and parse them to make translations faster Restricted !tongues --create [name] command to only GMs. This command also will automatically prefix languages handouts it creates Added new examples & screenshots Thank you all!

I've made a little update v2.1.0 - Improved character parsing The script now searches for full names when checking the speakers of a language, no more nicknames, now you must write the full name of the character. This will prevent malfunction because of characters with similar names. Leaving empty rows on a language list now doesn't causes the script to malfunction. If no vocabulary exists (empty rows) for a language, every word will be translated by sequences of '?' depending on word length. Will not send whispers to characters without any player in its "Can Be Edited & Controlled By" field, avoiding replication of whispers for GMs when talking through an NPC. Thank you all!

This, uh, might not be proper coder's etiquette, but I made a slightly altered fork that uses a hash instead of a random selection, if you're interested. Results in the same word always being translated to a given word, though obviously there might be some overlap, and I'm not entirely sure if the distribution for translations will be roughly evenly distributed, but still.

Corin S. said: This, uh, might not be proper coder's etiquette, but I made a slightly altered fork that uses a hash instead of a random selection, if you're interested. Results in the same word always being translated to a given word, though obviously there might be some overlap, and I'm not entirely sure if the distribution for translations will be roughly evenly distributed, but still. That's great! I would like to take a look at that, can you provide a link?

Corin S. said: Here we are: https://github.com/cwstra/Tongues-Script Liked your approach more than the random one and implemented it into my own. I fixed an issue since hash can return negative values and then try to pick a word from a negative index of the array. Also I ensured that every word is hashed at lower case, resulting in the same translation for: "Hello" and "hello". Thank you very much! New version available . v3.0.0 - Improved translation via hash (special thanks to Corin S.) Tongues now uses a hash to translate words, resulting in getting always the same translation to a given word. May cause weird translated sentences if not enough vocabulary is available..

I installed the script and I like it. I've found it is a little wonky finding players whose names are on the GM portion of the handout. I've found it's mostly characters with multi-part names that seem problematic My players like it, but the script crashed while we were playing. I had to disable the script and reset the API. I didn't manage to copy the error unfortunately. If the script crashes again, I'll make sure to copy the error and share it here. Suggestion . Maybe make a folder with files for languages that we can copy and easily add to our games. Anyways, good job. Looking forwards to future updates.

That's exactly what this script allows. The players who can't speak cant will just see different text. Thieves cant is an interesting idea. I have Elvish and Giant setup for my Storm King's Thunder campaign. These are languages shared by some party members.

Spaceweasels said: I installed the script and I like it. I've found it is a little wonky finding players whose names are on the GM portion of the handout. I've found it's mostly characters with multi-part names that seem problematic My players like it, but the script crashed while we were playing. I had to disable the script and reset the API. I didn't manage to copy the error unfortunately. If the script crashes again, I'll make sure to copy the error and share it here. Suggestion . Maybe make a folder with files for languages that we can copy and easily add to our games. Anyways, good job. Looking forwards to future updates. I have names on my campaign like Therenvarys Ther Solaris or Eldon "Eyebrows" and the script is reading them well from the GM notes. Would you mind to explain how is it wonky? As for the error, the script may be unpolished, I also detected some errors and are trying to recreate and solve them. If it ever happens again on your game and you post the error here I will try to fix it. Regarding the folder with languages I pick most of them from WoW's wiki language section. They have a lot of them and they provide the words the game uses to generate the language. Anyways, I will upload mine to the GitHub as examples.

Terrelle S. said: I'm wondering if i can add a "language" such as "Thieves Cant" and have it set to translate only between people who know thieves cant? Thanks! Yes, as Spaceweasels replied that's the script purpose. I'm working on a dictionary functionality that will allow you to declare a specific translation for a given word which the script will take if available before trying to hash the word. That will work specially well for Thieve's Cant as you can translate things like "steal" to "buy" or "assassinate" to "hug", since Thieve's Cant is more of a code language.

Sarkamist said: I have names on my campaign like Therenvarys Ther Solaris or Eldon "Eyebrows" and the script is reading them well from the GM notes. Would you mind to explain how is it wonky? It was wonky, but after I restarted the API, everything seems fine now. I'll keep you posted.

Have a bunch of new features now available here . Examples on github are updated including the new features. v4.0.0 - Dictionary, ignoring text and language knowledge Dictionary functionality which allows translation of specific sets of words to a given translation (ex: [Hello, Goodbye: Hellobye] will translate every "Hello" or "Goodbye" to "Hellobye") . This feature also supports sentences (ex: [You will burn in hell: Ag naz logash] ). New languages created by the command --create have a new template with a functional example. Translation is done from top to bottom, that means if [Hello: Hi] is declared before [Hello: Hey], only the first one will apply as every "Hello" will be translated to "Hi" first. Text between two $ symbols are ignored by the script. (ex: A message such as "Hi $John$ how are $you today$" will translate as "Az John jag nag you today"). Ignored text will be displayed in grey color when translating. Tongues now supports knowledge of a language, when writting down the speakers of language you must specify their level of knowledge with a ":" next to its name followed by a percentage (ex: Mannimarco:100%, Goblin Warrior: 50%) . This affects both speaking and understanding of a language. Every word has a difficulty between 1 and 100, a language speaker only will speak/understand those words that meet their % of knowledge. Any words not translated by the speaker (character who is sending the message doesn't have enough knowledge) will display in blue color when translating. Any words not understood by the listener (character who is reading the message doesn't have enough knowledge) will display in red color when translating. If you don't want to use this feature just give every speaker a knowledge of 100%. Read me inside Github is updated including the new features. Hope you enjoy those new features!

I get an error with V4. Seems the trim function is undefined or causing a conflict. For reference, the error message generated was: TypeError: Cannot read property 'trim' of undefined
TypeError: Cannot read property 'trim' of undefined
at apiscript.js:491:78
at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)
at apiscript.js:487:35
at /home/node/d20-api-server/api.js:717:7
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400 I tried restarting my API, but I still get this error on startup.

Spaceweasels said: I get an error with V4. Seems the trim function is undefined or causing a conflict. For reference, the error message generated was: TypeError: Cannot read property 'trim' of undefined
TypeError: Cannot read property 'trim' of undefined
at apiscript.js:491:78
at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)
at apiscript.js:487:35
at /home/node/d20-api-server/api.js:717:7
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400 I tried restarting my API, but I still get this error on startup. This is probably because you still have your old languages, you need to update all the handouts and set the level of knowledge of every speaker (ex on GM Notes: "John, Charles" must be "John:100%, Charles:100%" now). If you don't want to use the knowledge level, just give every speaker a 100%.

Looks really great. One thing that I noticed, though: In the GM notes, it is important to keep a space after the comma. E.g. "Mighty Dragon: 100%, Charles:20%". If you write "Mighty Dragon:100%,Charles:20%", then Charles gets a language boost and becomes fluent in Draconic...

Arthur B said: Looks really great. One thing that I noticed, though: In the GM notes, it is important to keep a space after the comma. E.g. "Mighty Dragon: 100%, Charles:20%". If you write "Mighty Dragon:100%,Charles:20%", then Charles gets a language boost and becomes fluent in Draconic... Thanks for reporting this, will take a look at that.

Sarkamist said: This is probably because you still have your old languages, you need to update all the handouts and set the level of knowledge of every speaker That was exactly the problem. Works perfectly now.

Arthur B said: Looks really great. One thing that I noticed, though: In the GM notes, it is important to keep a space after the comma. E.g. "Mighty Dragon: 100%, Charles:20%". If you write "Mighty Dragon:100%,Charles:20%", then Charles gets a language boost and becomes fluent in Draconic... Fixed this in a little update. Available here . v4.0.1 - Fixed GM Notes parsing Fixed an issue when parsing GM Notes not seprated by space after comma. Also, when speakers are written without a knowledge value after a ":" the script defaults the knowledge level to 100. Preventing parsing errors when swaping to the new version or just don't want to use the knowledge feature while keeping GM Notes cleaner.

Athedia said: Will there be the ability to target multiple tokens with this eventually? It is cool, just would be nice to send the message to multiple people You mean the ability to select multiple tokens and then using the command to make them all speak the same text in a given language? If not, care to give an example of what do you mean?

Hiya, love the script, but I have a small problem. Me and my group, being swedish and playing in swedish, have noticed that the script doesn't recognize and translate any of the "non-english" letters (Å, Ä and Ö). Can they be added or is that too much of a hassle?

Ravenknight said: Hiya, love the script, but I have a small problem. Me and my group, being swedish and playing in swedish, have noticed that the script doesn't recognize and translate any of the "non-english" letters (Å, Ä and Ö). Can they be added or is that too much of a hassle? I'm working exactly on this, currently trying to parse every unicode character in order to parse them as part of the translated words. I'm Spanish myself and play with my group in spanish, we spotted the problem with Ñ or characters with stress accent on them.

Sarkamist said: Athedia said: Will there be the ability to target multiple tokens with this eventually? It is cool, just would be nice to send the message to multiple people You mean the ability to select multiple tokens and then using the command to make them all speak the same text in a given language? If not, care to give an example of what do you mean? Yep, that was the idea instead of having to send it multiple times. If not thats fine

New version available here dealing with non-english characters problem. As for the ability to talk with every selected token, I'm working on it. v4.1.0 - Non-english characters parsing Now tongues parses every Unicode letter as a valid character for translation.

Sarkamist said: New version available here dealing with non-english characters problem. As for the ability to talk with every selected token, I'm working on it. v4.1.0 - Non-english characters parsing Now tongues parses every Unicode letter as a valid character for translation. Just in time for saturday's game. Thanks a lot!

Hmm, I don't get how this works. I set up a handout just as you said I believe (From Tongues): [Draconic] language template succesfully created! but I get this message: !tongues Draconic hello (From Tongues): Draconic does not exist as a Tongues valid language!

Omegaman said: Hmm, I don't get how this works. I set up a handout just as you said I believe (From Tongues): [Draconic] language template succesfully created! but I get this message: !tongues Draconic hello (From Tongues): Draconic does not exist as a Tongues valid language! Check that you have a handout named "Tongues: Draconic". You have to provide the handout's name without the "Tongues: " prefix. When using the !tongues --create command maybe you provided the name between brackets? If that's the case you have to use !tongues [Draconic] in order to speak the language. You can rename the handout manually to "Tongues: Draconic" in order to use !tongues Draconic (text) , the script will reparse it.

now if only it was simpler to use... aka gibberish for all pcs who dont have the language listed in there Other Proficiencies & Languages section. i would have to separate out each known language then use common spelling for each. then simply have the api scan the list to know which pc speaks which language. then a macro to call a list of languages to speak in. so in essence the pc clicks the macro and drop down selects a known to them language writes there message. that gets output to chat those with it see the message without gibberish. those without get gibberish. Gm sees all

Sarkamist said: Omegaman said: Hmm, I don't get how this works. I set up a handout just as you said I believe (From Tongues): [Draconic] language template succesfully created! but I get this message: !tongues Draconic hello (From Tongues): Draconic does not exist as a Tongues valid language! Check that you have a handout named "Tongues: Draconic". You have to provide the handout's name without the "Tongues: " prefix. When using the !tongues --create command maybe you provided the name between brackets? If that's the case you have to use !tongues [Draconic] in order to speak the language. You can rename the handout manually to "Tongues: Draconic" in order to use !tongues Draconic (text) , the script will reparse it. **Edit** I had to remove the brackets around Draconic on each line of the handout as well. Got it. That's nice. Now I just need macros to let people pick from the dropdown which language they want to use. Awesome work. I love it. Thank you for your help, this worked perfectly. Now, however, I notice another issue. This is the export when I say something and it shows the word Draconic over and over. and this is what the handout looks like

lordmage said: now if only it was simpler to use... aka gibberish for all pcs who dont have the language listed in there Other Proficiencies & Languages section. i would have to separate out each known language then use common spelling for each. then simply have the api scan the list to know which pc speaks which language. then a macro to call a list of languages to speak in. so in essence the pc clicks the macro and drop down selects a known to them language writes there message. that gets output to chat those with it see the message without gibberish. those without get gibberish. Gm sees all The script is intended to be both system and sheet agnostic, so configuring it to get the speakers of a language from their sheets attributes its not the intended behaviour. About the macro, it can be done on a sheet basis as character abilities are system & sheet agnostic. I like the idea, maybe in the future I configure a command which allows you to select a token and it automatically creates the macro for all the languages it can speak.

Omegaman said: *Edit** I had to remove the brackets around Draconic on each line of the handout as well. Got it. That's nice. Now I just need macros to let people pick from the dropdown which language they want to use. Awesome work. I love it. Glad you solved the issue and liked the script!