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

Languages macro

I am using the D&D 5E (2014) Character Sheet. Using a Scriptcard I would like to get a list of Player Characters, look at their repeating_proficiencies and if they are proficient in a select language whisper a message to them, if they are not proficient with the selected language use a rollable table to send gibberish to them. So, using a macro I would select a language such as Thieves-cant and enter some text such as "the City Watch is on its way!". All Player Characters that are proficient in Thieves-cant would be whispered the message and those that are not would get nonsense. Is this possible?
Hey Hultz, With a ScriptCard this should be totally possible. I have ScriptCard that reports the languages for a party that I could pretty easily modify to allow this to work. I can post an example here in a bit if you are interested.
Ok so here is one possible way of doing it in ScriptCards: !script {{ --/|CONFIGURATION VARIABLES --&GibberishTableName|gibberishText --&reentrySeparator|%% --#title|Whisper in Language --#whisper|gm --#reentrant|Whisper[&SendingPlayerID] --/|Get PC tokens --/|Currently this uses the PC tokens on the current page with the player ribbon --/|PC tokens means tokens linked to a character and that character is controlled by a player --~|array;pagetokens;PCArray;[*P:id];pc --/|Throw an error if no PC tokens are found --?[@PCArray(length)] -eq 0|>LogMessage;fatal;No PC Tokens Found;ERROR;No PC tokens found on page [*P:name] --~|array;define;LangArray --~|hash;define;LangHash --%tid|foreach;PCArray --~|array;fullrepeatingsection;_ProfArr;[*[&tid]:t-represents];repeating_proficiencies;prof_type:name;: --%_Prof|foreach;_ProfArr --?"[&_Prof]" -ninc "language:"|% -->libArray_Push|LangArray;[&_Prof(after,:)] -->libHash_Push|LangHash;[&_Prof(after,:)];[*[&tid]:character_name] --%| --%| --&RQ|? --&RQ|+{ --&msg| --%lang|foreach;LangArray --&msg|+ [rbutton][&lang]::WhisperInLanguage;[&RQ]Enter message for [&lang]}[&reentrySeparator][&lang][/rbutton] --%| --+|[c][&msg][/c] --:Done| --X| --:WhisperInLanguage|MessageTextFromRollQuery;Language --~|array;define;UnspokenArray --&msgText|[&reentryval(split,[&reentrySeparator],0)] --&language|[&reentryval(split,[&reentrySeparator],1)] --#title|Message in [&language] --#whisper|gm,[:LangHash("[&language]")] --+|[&msgText] --%_wilTID|foreach;PCArray --?"[:LangHash("[&language]")]" -ninc "[*[&_wilTID]:character_name]"|>libArray_Push;UnspokenArray;[*[&_wilTID]:character_name] --%| --?[@UnspokenArray(length)] -eq 0|ENDWHISPER --~UnspokenList|array;stringify;UnspokenArray;, --*|Send Gibberish to remaining players [&UnspokenList] [rbutton]Send Gibberish::SendGibberish;[&UnspokenList][/rbutton] --:ENDWHISPER| --^Done| --:SendGibberish| --#title|Message in ? --#whisper|gm,[&reentryval] --=gibberish|[T#[&GibberishTableName]] --+|[$gibberish.tableEntryText] --^Done| --:LogMessage|MessageLevel;EmoteText;MessageTag;MessageContent --#emoteText|[%2%] --+[%3%]|[%4%] --?"[%1%]" -eq "fatal"|Done --<| --/|Will check if the entry is already present --/|This will avoid duplicate entries from the path functions --:libArray_Push|ArrayName;StringToPush;AllowDuplicatesBoolean(optional,default:0) --?[%3%] -eq 1|_lapPUSH --~_lapArrChk|array;indexof;[%1%];[%2%] --?"[&_lapArrChk]" -ne "ArrayError"|< --:_lapPUSH| --~|array;add;[%1%];[%2%] --<| --:libHash_Push|HashName;Key;Value --?"[:[%1%]("[%2%]")]X" -ne "X" -and "[:[%1%]("[%2%]")]" -ne "undefined"|&_lhpNewValue;[:[%1%]("[%2%]")],[%3%]|&_lhpNewValue;[%3%] --h:[%1%]("[%2%]")|[&_lhpNewValue] --<| }} For the setup, you set the variable at the top of the ScriptCard `--&GibberishTableName|` to the name of your rollable table, currently the name in my testing was gibberishText. This does assume that the currently active page, ie the one with the player ribbon, has your player's tokens on it and the tokens are setup so they are linked to a character and that character has a player set in the controlledby field. The Scriptcard will grab all the PC tokens setup that way and go through them to get a list of all the languages spoken and whisper it to the GM, presumably you: When you click on one of the language buttons, it will pop up a roll query textbox to input your message: Note that there is a variable at the top of the Scriptcard named `--&reentrySeparator|` with a current value of %%. This is used to separate the message you enter from the language you chose. That means your message cannot contain the sequence %%. If for some reason you want to include %% in your messages, change that variable to some sequence you won't use. When you enter your message it will then whisper to the players that speak that language: Right now the script also includes the GM in the whisper of these messages, that can be changed by removing gm from --#whisper lines in the WhisperInLanguage and the SendGibberish procedures. Due to some limitations in how ScriptCards composes messages, if there are players that do not speak the language, a whisper to the GM will appear with a button to send gibberish message to the remaining players. Click the Send Gibberish button and the Scriptcard will roll on the table set in GibberishTableName and then whisper to the gm and remaining players a message like: Hopefully that is helpful to you. Let me know if you have any questions about this.
Thank you Joshua N. I will take a look at this and try it on my players.
There is also the Tongue Script since you're a PRO user <a href="https://app.roll20.net/forum/post/7473699/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/7473699/slug%7D</a>
Thank you for the response. I am going to give the Tongue Script a try. In my testing/learning it seems a bit buggy but I think that it is just me not completely understanding how to use it.
Just as a counter-point, and for new users not ready to play with the API or ScriptCards just yet, here is what I do.&nbsp; 1. Create an empty character for the language (ex. name it "langGoblin" for Goblin) 2. Assign each PC who can speak that language ownership of it.&nbsp; When someone (PC or monster) speaks that language, send a whisper to the language character (ex. "/w langGoblin Get them!"); only those players with characters who have rights will see the message.&nbsp; To embellish, you can add "/emas Goblin shouts at his comrades" on the line before or after One important point, though, is do not change the speaking "as" in the chat window to the language character; just whisper to it as the normal character.&nbsp; For a macro, you can embed the list of languages ( "/w ?{In |Goblin, langGoblin|Dwarven, langDwarven|etc.} ?{Message} )
I like that trick Mark. Seems pretty handy. Hultz, out of curiosity, did the ScriptCard work for you? Was it missing features of the Tongue Mod?
Joshua, I tried the Scriptcard and it did work but there are some features that it doesn't support. With the Tongue Mod it sends gibberish that is consistent with the original message being sent but the part that sold me was it being able to do partial translations, if I have a PC that has been dealing with goblins for a long while, even though the PC does not know the Goblin language I can have them pick up say a 50% knowledge of it. I like this feature. Now I am dealing with the macros to set the PCs to know a given language, currently it only works with some languages and tells me that the language in question is not a viable language. One of my criteria is that I can transmogrify a language to another game and I think that I may be having issues with that.
Ahh I thought you wanted random entries from a table if they didn't know the language. The Scriptcard could be modified to not pick up table text pretty easily and replace with random character strings as desired. I wasn't aware of the Tongues script but replacing text in a Scriptcard is pretty easy. This could even be set to pick up some value of how much translation could be done. I originally just made it how I interpretted what you were asking for in your post. But if you have something that works for you, very cool. Let me know if you are interested in modifying the Scriptcard to pick up any new features.
Thank you Joshua N. You do good work but for now I will be going with the API Script. For those of us that do not have a Pro subscription your solution is a good one.
That one still requires a Pro sub cause ScriptCards is a mod. Maybe I'll modify it up to do what the Tongues mod does one day but I've got other projects first before I rewrite all the Mods in ScriptCards.