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 .
×

Import/Export sharing of Journal Monsters

As a GM I'd love to see a meta feature to import/export journal monsters/npcs for sharing between campaigns and members. Bonus XP for bundling associated macros for the exported critter. One could envision a Manual of Monsters at a GM's fingertips with macros for the critter powers/actions... 'twould reduce the tedium of assembling a campaign in Roll20 by leverage some technology. A JSON'ed affair perhaps.
1380134724
Lithl
Pro
Sheet Author
API Scripter
The API can create characters (with attributes and abilities), as well as handouts. While it can't really reach outside the sandbox (that's the purpose of a sandbox) to grab such info from some shared database, a set of hard-coded scripts could be created to be selected from by the GM. Paste script, run script, monster character sheet/handout is in the journal. If/when we get a script distribution mechanism similar to the Market, this could be a lot easier.
Thanks for the info, Brian. I'll look into the API re creating characters via script. For those less tech saavy or inclined, the ability to generate a script From a roll20 character would be an interim solution to sharing (if i'm understanding all this!). Can the API create macros as well as attributes/abilities, btw? thanks again.
1380173805
Lithl
Pro
Sheet Author
API Scripter
The API cannot create macros at this time, although it can edit existing macros (changing the macro's name, the macro body, and what players can see it). Characters, character Attributes, character Abilities, and Handouts are the only things that can currently be created from whole cloth within the API. These scripts might help for starting up a sort of "monster database": on('ready', function() { var name = 'CHARACTER_NAME'; // Replace with character name var character = findObjs({ _type: 'character', name: name })[0]; var attributes = findObjs({ _type: 'attribute', _characterid: character.id }); var abilities = findObjs({ _type: 'ability', _characterid: character.id }); log(character); log(attributes); log(abilities); }); The above script will run when the sandbox spins up. In the text box at the bottom of the page, it will print out all of the data on the character on a single line, followed by that character's attributes on a second line and the character's abilities on a third line. Copy those three lines for the "monster database" and store it somewhere. on('ready', function() { var monsterData = 'MONSTER_DATA'; // Replace with the first line output from the previous script var monsterAttributes = 'MONSTER_ATTRIBUTES'; // Replace with the second line output from the previous script var monsterAbilities = 'MONSTER_ABILITIES'; // Replace with the third line output from the previous script monsterData = JSON.parse(monsterData); monsterAttributes = JSON.parse(monsterAttributes); monsterAbilities = JSON.parse(monsterAbilities); var character = createObj('character', { _avatar: monsterData._avatar, // I'm actually not certain this line will work; _avatar is normally read-only // but createObj is kind of special name: monsterData.name, bio: monsterData.bio, gmnotes: monsterData.gmnotes, archived: monsterData.archived, inplayerjournals: monsterData.inplayerjournals, controlledby: monsterData.controlledby }); _.each(monsterAttributes, function(attr) { createObj('attribute', { _characterid: character.id, name: attr.name, current: attr.current, max: attr.max }); }); _.each(monsterAbilities, function(abil) { createObj('ability', { _characterid: character.id, name: abil.name, description: abil.description, // The description doesn't seem to actually be accessible from the normal // interface, so this will probably always be the empty string action: abil.action }); }); }); This second script requires copying the output from the previous script. It will create the character (with description, gm notes, attributes, and abilities) in the new campaign. It will not copy the default token, and I'm not certain whether setting the avatar (the image that appears next to it in the journal and appears next to it in the chat) will work.