Vocabulary
Vocabularies are keywords that are mapped to one or multiple different strings. If such a vocabulary is found in a string it will be replaced by a string from the vocabulary's "pool".
Using them is pretty simple: You just need to put a % in front and behind the vocabulary keyword to mark it as a keyword.
An example would be:
sendMessage('Hello %name%');
This example replace the %name% with a random string from the vocabulary's pool. So if the pool of strings for the vocabulary "name" consists of: pig, slut and slave it might show up as "Hello slut", "Hello pig" or "Hello slave".
To create or register such a vocab you have two different possibilities. The first one is to simply use the given function:
registerVocab(String vocabName, Strings pool)
Shows an image file of a certain type.
Parameters:
vocabName - The name ofthe vocab that you want to register
pool - An enumaration of strings that should be in the pool for the given vocabulary
Example:
registerVocab("name", "pig", "slut", "slave");
The other method would be to create a corresponding file inside the Vocabularies folder of your personality. You can name it however you like but it needs to be a .txt file. The content looks as follows:
slut
pig
slave
The lines are the strings for the vocabulary pool. The vocabularies directory is scanned automatically on startup and thus it does not require any interaction other than creating said file.
There is also the possibility to create a runnable vocabulary. Runnable vocabularies execute a function once they are found in a string and then they are replaced by the string that the function returns. How to create a runnable vocab you might ask? Just place a .js instead of a .txt file inside the vocabularies directory. The .js file should contain nothing but a function named like this: fileName + Vocabulary. Which means the first letter is always small. For example if your file is named GoodToKnow.js the file's content should look like this:
function goodToKnowVocabulary() {
var answers = ["Good", "Very good", "Excellent", "Perfect", "Great", "Marvelous", "Wonderful", "Splendid"];
if(randomInteger(1, 10) == 1) playSound("Audio/Spicy/QuestionAndShortWords/Good/*.mp3");
return answers[randomInteger(0, answers.length - 1)];
}
This vocabulary returns a random string from the answers list and in 1/1o cases it plays a sound file.
subname -> The name of the sub
domname -> The name of the dom
domfriend1name -> The name of the first dom friend
domfriend2name -> The name of the second dom friend
domfriend3name -> The name of the third dom friend
Vocabularies can refer to other vocabularies which means you can have a vocabulary called "slut" whose pool consists of "bitch, slut, %name%" and then you could have your "name" vocab. If the "slut" vocab is now used and %name% is selected it will replace %name% with a corresponding string from "name"'s pool. Vocabularies also do not mind about the case. Which means the vocabulary "name" can also be called using %NaMe%.