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] Random adjective for monster names

1683932728

Edited 1683973893
Hi! I've  made a thing cause I couldn't find it. It gives random physical and personality adjectives to monster tokens. The above is a regular token before the script and below is some examples. I use it with the aura/tint color mod so it's compatible with that. I don't know how to post a script into the roll20 library so I'll just share the code so you can copy-paste it. The top has the personality traits, physical characteristic and percentage for "Average" physical characteristic so not every random monster is too quirky. After copy pasting just remove the ones you don't like and add more if needed. Although I would appreciate it if we made a dope list in this thread cause maybe I've skipped some really cool options. :D var RandomAdjective = RandomAdjective || (function () { 'use strict'; var adjectivesPersonality = [ 'Adaptable', 'Agreeable', 'Ambitious', 'Brave', 'Bright', 'Calm', 'Careful', 'Charismatic', 'Chatty', 'Cheerful', 'Compassionate', 'Creative', 'Decisive', 'Determined', 'Diplomatic', 'Easy-going', 'Emotional', 'Efficient', 'Energetic', 'Enthusiastic', 'Faithful', 'Fearless', 'Friendly', 'Funny', 'Gentle', 'Hardworking', 'Honest', 'Impartial', 'Intuitive', 'Inventive', 'Kind', 'Laid-back', 'Loyal', 'Lucky', 'Observant', 'Patient', 'Persistent', 'Polite', 'Quiet', 'Resourceful', 'Sensitive', 'Shy', 'Talkative', 'Tough', 'Versatile', 'Wild', 'Wise']; var adjectivesPhysical = ['Young', 'Old', 'Attractive', 'Cute', 'Ugly', 'Chubby', 'Thin', 'Small', 'Large', 'Exotic', 'Tall', 'Short', 'Muscular', 'Long-limbed', 'Greasy', 'Pale']; var averagePercentage = 50; giveAdjective = function(obj) { let isAverage = (randomInteger(100) <= averagePercentage); obj.set({'name': (isAverage ? '' : adjectivesPhysical[randomInteger(adjectivesPhysical.length - 1)]) + ' ' + adjectivesPersonality[randomInteger(adjectivesPersonality.length - 1)] + ' ' + obj.get('name')}); }, handleToken = function (obj) { let character = getObj('character', obj.get("_represents")); if(character === undefined || character.get("controlledby") === "") { giveAdjective(obj); } }, registerEventHandlers = function () { on('add:token', function (t) { _.delay(() => { handleToken(getObj('graphic', t.id)); }, 400); }); }; return { RegisterEventHandlers: registerEventHandlers }; }()); on('ready', function () { 'use strict'; RandomAdjective.RegisterEventHandlers(); }); Currently I see some trouble with it generating the adjectives to named npcs too - you have to assign yourself to their character sheets so it doesn't generate for them. Like this (as long as there's a controller, the name won't be generated):
Nice - I like it.  I bet you could even add logic to look for a rolltable called "NPC_Physical_Adjective" and "NPC_Personaility_Adjective".  If they exist, pull from the rolltable instead.  That way users can expand on the list of physical and personality traits if they desire.  
1683959849
GiGs
Pro
Sheet Author
API Scripter
I'd probably remove 'Average ' since it comes up so often, like obj.set({'name': (isAverage ? '' : adjectivesPhysical[randomInteger(adjectivesPhysical.length - 1)] + ' ') + adjectivesPersonality[randomInteger(adjectivesPersonality.length - 1)] + ' ' + obj.get('name')});
GiGs said: I'd probably remove 'Average ' since it comes up so often, like obj.set({'name': (isAverage ? '' : adjectivesPhysical[randomInteger(adjectivesPhysical.length - 1)] + ' ') + adjectivesPersonality[randomInteger(adjectivesPersonality.length - 1)] + ' ' + obj.get('name')}); Good idea!
Styx said: I'm having some issues with getting this to work. I have copy and pasted the script but no luck. hi! It gives the token the adjectives when you drag them onto the map. Can you private message me with more details? Maybe I can fix it if I know what's breaking (also maybe it is incompatible with a script you're using)