Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Tongues - a simple language script

1527873248

Edited 1527873265
getting an error code For reference, the error message generated was: SyntaxError: Invalid regular expression: /[dwarvish/: Unterminated character class SyntaxError: Invalid regular expression: /[dwarvish/: Unterminated character class at new RegExp (<anonymous>) at apiscript.js:18702:27 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:182:9) at translate (apiscript.js:18701:11) at commandSpeak (apiscript.js:18686:25) at handleInput (apiscript.js:18908:21) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1634:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
1527874127
The Aaron
Pro
API Scripter
It's because you have "[dwarvish]" in the name of your language.  Many punctuation marks have special meaning to regular expressions and this script is not escaping them.  It could be fixed in the script, but in the interim removing the punctuation from your language name should fix it.
thank you!
Anyone have a Druidish language handout? I'm not really sure what that would look like if making my own. And I'm lazy. There, I said it.
Because the new/updated editor sucks, I can't post screenshots so bear with me. I ran across a small error in the script. I am logged in as GM and, in another browser, as a test player. When I use the script (GM screen; Ariel token) I get the expected chat output: Ariel:  Diel fa thori'dal do Shando. O fandu. 7:21PM (From Tongues - GM):  [Elvish] This is something in Elvish. I think. However, what my test player (Jack Ryan) sees is incorrect: Ariel:  Diel fa thori'dal do Shando. O fandu. (From Tongues [Jack Ryan]):  Ryan [Elvish] This is something in Elvish. I think. Clearly, it was not Jack Ryan speaking. It was Ariel. Also, the "Ryan [Elvish]" part doesn't need the "Ryan" either. Any idea why this is happening?
1530190471
The Aaron
Pro
API Scripter
It says [Jack Ryan] because that is the character that is hearing the message.  That lets you distinguish who heard something if you have more than one character. It has Ryan on the front of the message because it isn't quoting the speaker, so the message it sent was: /w Jack Ryan [Elvish] This is something in Elvish. I think. which interpreted only the first part of the name as the character/player to find.
sounds like your test player does not have the language set as known on the language handout
1530332383

Edited 1530332447
Any Ideas what im doing wrong? Followed the instructions perfectly I think. EDIT: Tried adding them both manually typing and VIA the automated way of the script neither seem to work as a player.
1530338295
The Aaron
Pro
API Scripter
Try formatting the GM notes part as Code. Sounds weird, but was working to fix some other scripts...
the auto way requires link sheets and the manual way needs the exact sheet name 
Seems to work when there is only one character but as soon as i put a second it does not work. The Aaron said: Try formatting the GM notes part as Code. Sounds weird, but was working to fix some other scripts... How would that look?
lordmage said: the auto way requires link sheets and the manual way needs the exact sheet name  Sheets are linked, it puts just puts Bardin Brighthammer in the notes
Think it might have something to do with the new text editor? It seems to happen when I use a Comma and then a space you can see the whole text box glitch for second and then I cant even get one player to register without clearing the whole thing closing it going back in. Very strange.
Anyone else experiencing this issue?
Anthony V. said: Anyone else experiencing this issue? I'm taking a look into it, maybe the new text editor changed the way the API works.
Sarkamist said: Anthony V. said: Anyone else experiencing this issue? I'm taking a look into it, maybe the new text editor changed the way the API works. Appreciate it!
The Aaron said: Try formatting the GM notes part as Code. Sounds weird, but was working to fix some other scripts... Tried this didn't work, thank you though!
The Aaron said: It says [Jack Ryan] because that is the character that is hearing the message.  That lets you distinguish who heard something if you have more than one character. It has Ryan on the front of the message because it isn't quoting the speaker, so the message it sent was: /w Jack Ryan [Elvish] This is something in Elvish. I think. which interpreted only the first part of the name as the character/player to find. This behavior doesn't make sense to me. If I'm the player playing Jack Ryan, what scenario would allow me to see something in the chat that Jack doesn't hear? And if this is the case, shouldn't it read "to Jack Ryan" for clarity? 
1530535538
The Aaron
Pro
API Scripter
If you had two characters and one understood the language being spoken and the other did not, you’d still get two messages, but one would have the translation and the other would have the message about thinking it’s some language.  The “To name” things is just a stylistic choice the author didn’t make, you’d have to take that up with them. 
Anyone get the script to work with multiple characters yet?
If it helps, it appears the script is picking up the formatting from the GMnotes box and is then adding it to the character name so that they don't then match: ["<p><a>Anthellind","100%"] ["</a><a> </a><a>Gitz","100%"] ["</a><a> </a><a>Laskra","100%"] ["</a><a> </a><a>Corbin","100%"] ["</a><a> Memdahl","100%</a> <br></p>"]
1530561352
The Aaron
Pro
API Scripter
Changing this line: var languageSpeakers = gmnotes.split(','); to: var languageSpeakers = gmnotes .replace(/<.*?>/g,'') .split(','); should fix that.
1530563632

Edited 1530563641
It worked kind of still doesn't identify multiple people. Works for the first person listed. The Aaron said: Changing this line: var languageSpeakers = gmnotes.split(','); to: var languageSpeakers = gmnotes .replace(/<.*?>/g,'') .split(','); should fix that.
1530563959
The Aaron
Pro
API Scripter
What does the text you insert for multiple people look like?
Morthos:100%,  Himo:100%
1530564503

Edited 1530564643
Looks like the text is getting Hyperlinked somehow? Edit: I got it figured out I had an unnecessary space in between sorry for the bother
1530565150
The Aaron
Pro
API Scripter
Ah, you could fix that with: var languageSpeakers = gmnotes.replace(/<.*?>/g,'').split( /\s*,/s*/ );
I'm loving this script! Thanks Sarkamist! I had asked for a Druidic translation/dictionary a few days ago but no one seems to have made one (or hadn't shared yet) so I made one myself. I used Gaelic since it seemed more authentic. It's got a nice difference from the other languages. Here it is for anyone else who may want it. Vocabulary: Druidic 1-letter words: [A, E, I, O, V]  Druidic 2-letter words: [Aí, Bó, Cú, Di, Eo, Gá, Mí, Ní, Ór, Rá, Ré, Rí, Sí, Tí]  Druidic 3-letter words: [Ádh, Áer, Bán, Brí, Clé, Cnó, Dlí, Dún, Éan, Eas, Fál, Gáu, Iúl, Lád, Meá, Míl, Píb, Rún, Slí, Tré, Upa]  Druidic 4-letter words: [Aoir, Ársa, Bain, Búad, Cáin, Caor, Clós, Dámh, Díth, Druí, Eala, Fach, Feis, Gaol, Glám, Iodh, Léim, Lúan, Mael, Meol, Naoi, Nath, Púca, Ráth, Ríon, Saoi, Scál, Sián, Táin, Toit, Treá, Túis, Uath]  Druidic 5-letter words: [Ábhar, Amhra, Aosán, Badbh, Beith, Brugh, Caint, Céile, Clárú, Cráin, Cúige, Dáimh, Dlúth, Duais, Éasca, Éicse, Eolas, Fáidh, Feadh, Fíorú, Fuath, Gáeth, Gnách, Imbas, Léine, Locht, Mearú, Mídhe, Mothú, Naofa, Nuáil, Ogham, Páigh, Racht, Scáil, Spéir, Támas, Tuath, Uacht]  Druidic 6-letter words: [Aíocht, Ánruth, Cáinte, Cóiriú, Deilín, Dúchas, Easáin, Fásach, Gruaim, Immram, Láthar, Méirín, Naonúr, Óenach, Piseog, Rudach, Sárlán, Síogaí, Téagar, Tiontú, Upthóg]  Druidic 7-letter words: [Áilgeis, Asarlaí, Bochtóg, Cliatha, Dásacht, Dúshlán, Eabhadh, Fáthlia, Foclóir, Gaeilge, Iallach, Láthair, Néallta, Orthrus, Pádraig, Rabhadh, Sciotán, Síofróg, Tairbhe, Toitriú, Uaithne]  Druidic 8-letter words: [Agallamh, Ardartha, Baisleac, Caoilíth, Cnúdánaí, Dáthabha, Duilliúr, Éalúdach, Faisnéis, Gruagach, Íocluibh, Laighean, Lúachrán, Mealladh, Méarnáil, Nascaire, Ríastrad, Saigheán, Síúlacht, Soiscéal, Tagairtí, Toríocht, Uisneach, Urnaidhm]  Druidic 9-letter words: [Athmhothú, Bruidhean, Cathbhadh, Díthreabh, Fiadhrádh, Gúbreatha, Ilchiallú, Lánlaidhí, Móideacht, Neimheadh, Partholón, Rúraíocht, Sasanaigh, Tálcheann]  Druidic 10-letter words: [Athgabháil, Béalaíocht, Cláirseach, Méarsmeach, Idirchrios, Smaoineamh, Tréadhacht]  Druidic 11-letter words: [Ársachumadh, Cleathainsí, Fiannaíocht, Grianchloch, Macgnímrada, Síofrógacht, Taispeánadh]  Druidic 12-letter words: [Ádhmharaighe, Bándhraíocht, Díonghabháil, Iarrairdeall, Mionnfháinne, Scrothaíocht, Tairngreacht, Upthaireacht] Druidic 13-letter words: [Briatharchath, Comhtheaghmas, Dinnsheanchas, Frithbhuachán, Gabhlairdeall, Seandálaíocht] Druidic 14-letter words: [Breachtraíocht, Leathdhraíocht, Néaladóireacht, Réamhfhuireach, Samhlchaiteamh] Dictionary: [Fae, Fey, Fairie, Fairy, Faery, Faerie, Fair Folk: Sídhe] [Lover, Sweetheart, Mistress: Leanhan] [Banshee: Bean Sídhe] [Invisible, Invisibility:Feth fiadh] [Grave, Cairn: Leacht] [Healing: Leigheas] [May the gods guard and guide you: Go gcumhdaí is dtreoraí na déithe thú]
Thanks for sharing! Added it for my druid in my campaign! Ben L. said: I'm loving this script! Thanks Sarkamist! I had asked for a Druidic translation/dictionary a few days ago but no one seems to have made one (or hadn't shared yet) so I made one myself. I used Gaelic since it seemed more authentic. It's got a nice difference from the other languages. Here it is for anyone else who may want it. Vocabulary: Druidic 1-letter words: [A, E, I, O, V]  Druidic 2-letter words: [Aí, Bó, Cú, Di, Eo, Gá, Mí, Ní, Ór, Rá, Ré, Rí, Sí, Tí]  Druidic 3-letter words: [Ádh, Áer, Bán, Brí, Clé, Cnó, Dlí, Dún, Éan, Eas, Fál, Gáu, Iúl, Lád, Meá, Míl, Píb, Rún, Slí, Tré, Upa]  Druidic 4-letter words: [Aoir, Ársa, Bain, Búad, Cáin, Caor, Clós, Dámh, Díth, Druí, Eala, Fach, Feis, Gaol, Glám, Iodh, Léim, Lúan, Mael, Meol, Naoi, Nath, Púca, Ráth, Ríon, Saoi, Scál, Sián, Táin, Toit, Treá, Túis, Uath]  Druidic 5-letter words: [Ábhar, Amhra, Aosán, Badbh, Beith, Brugh, Caint, Céile, Clárú, Cráin, Cúige, Dáimh, Dlúth, Duais, Éasca, Éicse, Eolas, Fáidh, Feadh, Fíorú, Fuath, Gáeth, Gnách, Imbas, Léine, Locht, Mearú, Mídhe, Mothú, Naofa, Nuáil, Ogham, Páigh, Racht, Scáil, Spéir, Támas, Tuath, Uacht]  Druidic 6-letter words: [Aíocht, Ánruth, Cáinte, Cóiriú, Deilín, Dúchas, Easáin, Fásach, Gruaim, Immram, Láthar, Méirín, Naonúr, Óenach, Piseog, Rudach, Sárlán, Síogaí, Téagar, Tiontú, Upthóg]  Druidic 7-letter words: [Áilgeis, Asarlaí, Bochtóg, Cliatha, Dásacht, Dúshlán, Eabhadh, Fáthlia, Foclóir, Gaeilge, Iallach, Láthair, Néallta, Orthrus, Pádraig, Rabhadh, Sciotán, Síofróg, Tairbhe, Toitriú, Uaithne]  Druidic 8-letter words: [Agallamh, Ardartha, Baisleac, Caoilíth, Cnúdánaí, Dáthabha, Duilliúr, Éalúdach, Faisnéis, Gruagach, Íocluibh, Laighean, Lúachrán, Mealladh, Méarnáil, Nascaire, Ríastrad, Saigheán, Síúlacht, Soiscéal, Tagairtí, Toríocht, Uisneach, Urnaidhm]  Druidic 9-letter words: [Athmhothú, Bruidhean, Cathbhadh, Díthreabh, Fiadhrádh, Gúbreatha, Ilchiallú, Lánlaidhí, Móideacht, Neimheadh, Partholón, Rúraíocht, Sasanaigh, Tálcheann]  Druidic 10-letter words: [Athgabháil, Béalaíocht, Cláirseach, Méarsmeach, Idirchrios, Smaoineamh, Tréadhacht]  Druidic 11-letter words: [Ársachumadh, Cleathainsí, Fiannaíocht, Grianchloch, Macgnímrada, Síofrógacht, Taispeánadh]  Druidic 12-letter words: [Ádhmharaighe, Bándhraíocht, Díonghabháil, Iarrairdeall, Mionnfháinne, Scrothaíocht, Tairngreacht, Upthaireacht] Druidic 13-letter words: [Briatharchath, Comhtheaghmas, Dinnsheanchas, Frithbhuachán, Gabhlairdeall, Seandálaíocht] Druidic 14-letter words: [Breachtraíocht, Leathdhraíocht, Néaladóireacht, Réamhfhuireach, Samhlchaiteamh] Dictionary: [Fae, Fey, Fairie, Fairy, Faery, Faerie, Fair Folk: Sídhe] [Lover, Sweetheart, Mistress: Leanhan] [Banshee: Bean Sídhe] [Invisible, Invisibility:Feth fiadh] [Grave, Cairn: Leacht] [Healing: Leigheas] [May the gods guard and guide you: Go gcumhdaí is dtreoraí na déithe thú]
Narolas said: This is a fantastic script, I'm going to have a lot of fun with this and my players will love it. If you want to setup custom languages quickly (like me for Golarion : Varisian, Keleshite, Taldane, etc..), i'm using&nbsp; <a href="http://chaoticshiny.com/langreplace.php" rel="nofollow">http://chaoticshiny.com/langreplace.php</a> with a lorem ipsum or some large text, then using the Google sheet (linked in this thread) to quickly fill up a bunch of words in no particular order. I've noticed that when I try "!tongues --set (name)", it adds the selected token's character name in the handout, but it adds a "null" before the name. Is that normal behaviour ? Noticed the same, any solution to this?
Anthony V. &nbsp;said: Narolas &nbsp;said: This is a fantastic script, I'm going to have a lot of fun with this and my players will love it. If you want to setup custom languages quickly (like me for Golarion : Varisian, Keleshite, Taldane, etc..), i'm using&nbsp; <a href="http://chaoticshiny.com/langreplace.php" rel="nofollow">http://chaoticshiny.com/langreplace.php</a> &nbsp;with a lorem ipsum or some large text, then using the Google sheet (linked in this thread) to quickly fill up a bunch of words in no particular order. I've noticed that when I try "!tongues --set (name)", it adds the selected token's character name in the handout, but it adds a "null" before the name. Is that normal behaviour ? Noticed the same, any solution to this? I fixed it by adding a line in the commandCreate function to write a space in gmnotes.&nbsp; newLanguage.set({ notes: text, gmnotes: ' ' });
1530810386

Edited 1530810409
New version available here . I hope I fixed the errors reported lately on this post. v4.5.2 - Bugfixes &amp; One-Click Install Hopefully fixed all the bugs related to handout parsing. I've been asked to add the script to One-Click install feature and I'm working on it. Thank you all!
Before I go breaking anything, I figured I'd ask: Can I move the Tongues language handouts to a folder and still have them work? Or do they need to remain on the root?
1530820578
The Aaron
Pro
API Scripter
I'm sure you're fine to move it.&nbsp; The folder structure in Roll20 is invisible to the API without explicitly looking for it.
1530823892
Pantoufle
Pro
Sheet Author
Translator
Hello Ben, Having all my handouts in a folder I can assure you that it's ok! :)
Anyone else having an issue with the new version of the script? It keeps crashing my API Sandbox with this error
1530998659

Edited 1530998803
Anthony V. said: Anyone else having an issue with the new version of the script? It keeps crashing my API Sandbox with this error Does it happen when you use the speak command or everytime you restart the API?
Sarkamist said: Anthony V. said: Anyone else having an issue with the new version of the script? It keeps crashing my API Sandbox with this error Does it happen when you use the speak command or everytime you restart the API? Only when i use the speak command
1530998985

Edited 1530999011
Anthony V. said: Only when i use the speak command Ok, could you share with me your current Tongues handouts? Did you try with different languages? Which one/ones you tried to use?
Sarkamist said: Anthony V. said: Only when i use the speak command Ok, could you share with me your current Tongues handouts? Did you try with different languages? Which one/ones you tried to use? Tried creating a new one from scratch and that worked! So just needed to do that!
1531001012

Edited 1531002252
Sarkamist said: Anthony V. said: Only when i use the speak command Ok, could you share with me your current Tongues handouts? Did you try with different languages? Which one/ones you tried to use? New problem The language is coming up as "???"
Anthony V. said: First of all try with a larger word like "crossbow" for example. The script works downwards, if you input a 6 character length word and there are no words available for that length, it will search for a 5-length word and so on. If the script can't get any words it replaces the characters with ?. So make sure words of a different length are getting translated correctly and look for any error on 3, 2, and 1-length words format (correctly closed [ ] and commas). If you can't find any of those, make sure it happens on every language you try or only with your Celestial handout. Come back to me with a screenshot of any languages that fail to translate for you if you can't figure out any of the possible problems I explained.
Sarkamist said: Anthony V. said: First of all try with a larger word like "crossbow" for example. The script works downwards, if you input a 6 character length word and there are no words available for that length, it will search for a 5-length word and so on. If the script can't get any words it replaces the characters with ?. So make sure words of a different length are getting translated correctly and look for any error on 3, 2, and 1-length words format (correctly closed [ ] and commas). If you can't find any of those, make sure it happens on every language you try or only with your Celestial handout. Come back to me with a screenshot of any languages that fail to translate for you if you can't figure out any of the possible problems I explained. Happening with all languages
1531060268

Edited 1531060332
Anthony V. said: Sarkamist said: Anthony V. said: First of all try with a larger word like "crossbow" for example. The script works downwards, if you input a 6 character length word and there are no words available for that length, it will search for a 5-length word and so on. If the script can't get any words it replaces the characters with ?. So make sure words of a different length are getting translated correctly and look for any error on 3, 2, and 1-length words format (correctly closed [ ] and commas). If you can't find any of those, make sure it happens on every language you try or only with your Celestial handout. Come back to me with a screenshot of any languages that fail to translate for you if you can't figure out any of the possible problems I explained. Happening with all languages Is it working for everyone else? Does not seem to be even using the right amount of letters.
Seems fine to me:
1531066328

Edited 1531066340
The Aaron
Pro
API Scripter
For those for whom it is working, have you edited your language handouts since them editor update?
1531066430

Edited 1531070087
Terrelle S. said: Seems fine to me: you're using the newest version posted 3 days ago right? EDIT: If i go back to an older version it works fine for translating but still doesn't register more than the first person listed in the handout.
Sorry, i'm still running 4.5.1 The Aaron said: For those for whom it is working, have you edited your language handouts since them editor update?
Installed 4.5.1 after the editor update and everything worked fine. After I updated Tongues to 4.5.2 it crashed with the error posted above. So, I tried to recreate Orcish and this is what I get after updating the handout with the translation: 2:15PM (From Tongues): &nbsp;L. (GM) Orcish language template succesfully created! 2:17PM The Ancient One: &nbsp;???? ?? ? ??????? 2:17PM (From Tongues - GM): &nbsp;[Orcish] What am I saying? I had saved the translation in Notepad++ and pasted into the handout editor. There's definitely a huge bug here. Since the previous version (4.5.1) seems to still work, how do I find it? I don't know how to find it on github if it's possible.