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] Languages

1450217449

Edited 1485477453
Introduction: This script is a re-work of "WhatSaywithUnknown.js" by derekkoehl which is an enhancement on "What Did He Say?" by Stephen S. It replaces the character sheet method for picking a language with a command line interface. It also includes features for creating languages, deleting languages, and, setting the character sheet language attribute name that the script uses for compatibility with all character sheets Setup: If the character sheets in your campaign do not use "prolanguages" as the attribute name for langauges then you must use the !setLanguageTag command as described below in order to set this script up for your campaign. Additionally, you can manually change the language tag identifier in the script itself by editing line 24 of the script like this: ex) Line 24 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; languageTag = "languages", You can also add languages by adding to the pushLanguage function calls near line 83 of the script like this: ex) Line 83 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pushLanguage("English",4,"Common"); Manually changing the scrip will prevent you from having to re-set and re-add the language tag, and your custom languages. Users will be notified, in game, if the language attribute is not set up properly. Source Code: <a href="https://github.com/Roll20/roll20-api-scripts/tree/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/</a>... Command 1: ! theLanguage { theText } Example: !Draconic hello there dragonborn Result: - If the player who enters this is speaking as a character that has Draconic, under the languages on their character sheet, they will say "hello there dragonborn" in Draconic. Any player who is currently online and is speaking as a character that also has Draconic on their character sheet will be whispered "hello there dragonborn". Others will be whispered symbols representing the language. - If the player who enters this is speaking as a character that does not have Draconic(under languages on their character sheet), they will "pretend to speak" Draconic. - If the player who enters this is speaking as a player , they will be notified that players cannot speak character languages. - GMs can speak any language with any player or character Command 2: ! setLanguageTag { attribute name } Example: !setLanguageTag playerlanguages Result : - If the player who enters this is a GM and playerlanguages is the name of a character sheet attribute in the campaign, the script will use "playerlanguages" when it searches character sheet attributes for player's languages (instead of the default "prolanguages") Command 3: ! deleteLanguage {language name} Example: !deleteLanguage Dwarven Result: - If the player is a GM, Dwarven will be deleted as a language Command 4: ! createLanguage {language name} {seed number} {parent language} Example: !createLanguage English 5 Common Result: - If the player is a GM, English will be created as a seed 5 language of Common Default Languages : Abyssal, Aquan, Auran, Celestial, Draconic, Druidic, Dwarven, Elven, Giant, Gnome, Goblin, Gnoll, Halfling, Ignan, Infernal, Orc, Sylvan, Terran, Thieves'Cant, Undercommon, Unknown Notes : Please post here or message me if you find any bugs or have ideas for features that I can add to this script
1450300705

Edited 1450386364
Update : Version 1.1.0 is out, It fixes all known bugs and Implements 3 extra commands. !setlanguagetag, !createlanguage, and !deletelanguage Descriptions of these new commands are in the post above Update: Version 1.1.1 standardizes the script to make it more compatible with others
Hey Script looks awesome and looking forward to getting it running in one of my campaigns, however I cant seem to get it to run for more than a few seconds before it crashes. Think you can help? and would it be easier to do that here or via PM? Thanks&nbsp;
I have experienced a similar problem where the script will crash after a long period of inactivity, and The Aaron told me that this is caused by a known issue on the Roll20 side that they are trying to fix. I have not had any issues using the script for periods up to and over a few hours of active game play, however. If you post the error that the API Scripts page displays, or some other information, I will try and figure out if your running into a different problem though!
Hey sorry didn't notice your reply. I was testing it out some more it seems it will only work if i am the only one in the game at the time once a player connects it crashes on the next command.&nbsp; Error is : ReferenceError: whoSpoke2 is not defined skimmign through right now i cant see a simple issue but I am a little brain dead at the moment has been a long day. Let me know if i can provide anythign else&nbsp; I know Ive run into some issues with polling, dispalying or whispering player/char names I have run into issues with spacing or special chars but thats pretty much been resolved since they updated the ability to "" the name but still i tested it again in a fresh camapign with all unique one word simple player & char names and still same thign works fine with just me as GM or player once one of my players joins and is applicable to recieve a whisper it crashes (if i do fake ones first it seems to let me get a few of those off before crashging)&nbsp;
<a href="https://github.com/anthonytasca/roll20-api-scripts" rel="nofollow">https://github.com/anthonytasca/roll20-api-scripts</a>... That should fix it! Thanks for pointing that out to me, It slipped through the cracks in one of my updates.
ahhh wow i should have caught that too on my first read through, anyway thanks for the help and script is looking good :]&nbsp;
1452226359
The Aaron
Pro
API Scripter
Nice! &nbsp;=D
This looks like a great program, just one question: Do I have to re-set !setLanguageTag languages every time, or does it somehow retain that information? -Phnord
1452231275

Edited 1452316494
Unfortunately, each time you restart the script you will have to set the language tag as well as re-create new languages, and, I don't think there is a way to fix this without editing your copy of the script like this: You can manually change the language tag in the script itself by editing line 24: ex) Line 24 &nbsp; &nbsp; &nbsp; &nbsp; languageTag = "languages", You can add languages by adding to the pushLanguage function calls near line 83 of the script: ex) Line 83 &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pushLanguage("English",4,"Common");
Thanks!
I am having an issue that it is not seeing any users actually have the language in their character sheet.&nbsp; I have verified it is pointed to the correct attribute (prolanguages)&nbsp; and have verified that they user in fact has the name spelled correctly within their language area.&nbsp; Any ideas?&nbsp; It displays it to everyone, however, as if they do not have that language.&nbsp; I have even created a new language attribute and assigned it to that with the same outcome.
One thing that may be causing the problem is that users are required to be "Speaking As" the character that can speak that language; Under the chat box is a drop down menu that allows a user to select which character or player they are speaking as. If you are still having trouble I may be able to join your game and test it with you in the future =)
1454106666
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://app.roll20.net/forum/post/2302560/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/2302560/slug%7D</a> This could be fun to work in this as well...&nbsp; Text&nbsp;immersion things are more fun than one would think.
I am not understand any of this right now. &nbsp;So, I'm going to ask a question at the level I need to hear the answer: I have a character sheet with a bunch of languages listed, with checkboxes next to each language. &nbsp;The player is suppose to check whatever language he knows. &nbsp;I would like to use this script in such a way that if I send a message in "Pale-Skin-Dark-Hair-Elvish" only the people who have "Pale-Skin-Dark-Hair-Elvish" as a checked language can read it. &nbsp;How do I do that?
1455737935

Edited 1455738062
The Aaron
Pro
API Scripter
With this script, you would need to setup a language "character" for "Pale-Skin-Dark-Hair-Elvish", then look at each character for the ones that have that language and add the players to the "Pale-Skin-Dark-Hair-Elvish" character. &nbsp;(I think) &nbsp;Nope, was completely wrong.. =D
All of the character sheets that I have tested this for have had text field inputs for adding languages, not check boxes, so there may be an issue for the character sheet type that your using. Either way, character sheets generally have a language attribute recognized by the roll 20 API and if any player who is speaking as a character that has "Pale-Skin-Dark-Hair-Elvish" says something in that language, then all other characters who have "Pale-Skin-Dark-Hair-Elvish" in their character's language attribute field will receive that message. Different character sheet templates also use different names for the language attribute, such as prolanguages or languages. You will have to make sure that this attribute name is used by the script by setting it with the !setlanguagetag chat function or by editing the code directly as suggested above. If that doesn't help you out then let me know which character sheet template you are using and I can try to debug the problem.
I am using the Iron Kingdoms character sheet, with lots of modifications (I'm running Iron Kingdoms games and using the experience to help improve the sheet). &nbsp; I would like to use checkboxes because they are easy, Or radio buttons, because I can have one without a value. &nbsp;But I am willing to work anything into the sheet code that allows easy adaption of the API code. So, say I have a radio button with the name="attr_ios elf-toggle", and a values of "" and "lang-ios_elf". &nbsp;I can install "lang-ios_elf" as a language in the API (using the method described above to add languages). &nbsp;And then anyone with that checked can type at eash other, and everyone who has "ang-ios_elf" checked will understand it? &nbsp; If this is so, is there a way I can have "@{speaking character} is yammering something in his native language you don't understand. &nbsp;He may be making fun of you," appear in the chat for non-speakers?
1455824725

Edited 1455825119
I just looked at the Iron Kingdoms character sheets and it appears that they do not record the names of known languages under any character attributes accessible by the API. This script is dependent on the API function: getAttrByName(characterName,attributeName); In line 158 of the script, the languages that a character knows is determined by this function, using the languageTag as the attributeName. This doesn't look like it can be done using the original Iron Kingdoms character sheet template.. You may be able to edit the template to fix this however Edit: Also, yes the script shows unreadable symbols to people who cant speak the language. This was a cool feature from the original script added by Stephen S.
1459100704

Edited 1459103361
Hi there, first time using the Roll 20 API's, and this beats the hell out of having to have a bunch of language translators on the side for immersion sake. However, I have absolutely NO idea what I'm doing :). Of the three listed&nbsp; here , which do I put into the API Editor? Can you explain how I'd go about adding custom languages,as most of my Pathfinder games I run are in a homebrew universe of my own creation (I know it's been explained, but I sincerely don't understand it). Sorry for my lack of knowledge on the subject, I just REALLY want to use this script. Thanks for taking the time to read! Tanis EDIT:&nbsp;Alright, so I figured out which script to use, but whenever I use it nothing happens, and none of my text appears (A macro box that a player set up and rolled, however, minimizes to show just a black line). Any idea what's going on? (Sorry for the deleted post, realized I could save space by editing, and I thought it'd remove the entire message, sorry about that)
1459115373

Edited 1460505351
Silvyre
Forum Champion
Tanis A. said: (A macro box that a player set up and rolled, however, minimizes to show just a black line). Any idea what's going on? Sounds like a Roll Template bugged out—the game's Creator should be able to fix this by Clearing the game's Chat Archive (note: not Clearing your Current Chat Log ). A GM might want to copy/back up your Chat Archive before it gets cleared.
1461287698

Edited 1461287909
AliceSteel
Sheet Author
API Scripter
What syntax does the script expect in the languages attribute? Is it case sensitive in it? PS: Do you intend to configure this script to be compatible with 1-click install soonish? It appears to merely be lacking the folder structure currently.