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

Import macros between campaigns

1486513525

Edited 1486513950
The transmogrifier is AWESOME! It saved me a TON of time. Thank you! Thank you! Thank you! Posting both to say ty and also to cast my vote for macros being added to it if that is ever possible. My blind player requires an individual macro for every attack, skill, save, and check and he's in 2 campaigns now, perhaps 3 in the future. So I've gotta move em by hand. No big deal though.  They're all short/simple. What I might do if we start another one is just copy the campaign, then delete everything else. That might be the fastest way with current options.  Or if the character sheets ever get a simpler text-call system. Ie if you could type some shorthand of the current macro in chat %bob perception and roll perception for a character named bob, we wouldn't need macros. Current macro function is @{reese|Escape-Artist-macro} which is a lot to type for someone who typos almost as often as I do.
1486513818

Edited 1486513825
Do character macros not carry over inside the transmogrifier? If so, then you could move all of those macros inside the select person's character sheet and then move that character to the new campaign. Then all you have to do is remake the character, but the specific macros would still be available.
Are they attached to the character?!?! I didn't think of that.  I thought they were attached to the campaign.
A macro can be attached to a character if it is created inside the journal entry for the character. Specifically on this  screen  in the entry.
Ah crud, they're not that kind of macro, but maybe they SHOULD be. I'll test that next. Thank you!
1486514793
Lithl
Pro
Sheet Author
API Scripter
Kyle G. said: A macro can be attached to a character if it is created inside the journal entry for the character. Specifically on this  screen  in the entry. Specifically, a "macro" is a child of a player, and is called with #macro-name, while an "ability" is a child of a character, and is called with %{ability-name}, %{character name|ability-name}, %{selected|ability-name}, etc.
1486527239

Edited 1516115563
The Aaron
Pro
API Scripter
I have a special place in my heart for accessibility, particularly because I have a good friend who is blind.  Here's a script that will store all of a players macros in a handout named "Macros: Player Display Name" so you can transmogrify them to a different game, then use this script to restore them.  It requires my  Base64 script, so be sure to install that. on('ready',function(){     'use strict';     var keyFormat = function(text) {         return (text && text.toLowerCase().replace(/\s+/,'')) || undefined;     },     matchKey = function (keys,subject){         return subject && !_.isUndefined(_.find(keys,(o)=>(-1 !== subject.indexOf(o))));     },     simpleObject = function(o){         return JSON.parse(JSON.stringify(o));     },     saveToHandout = function(name,data){         var handout=findObjs({             type: 'handout',             name: name         })[0] || createObj('handout',{             name: name         });         handout.set({notes: data});     },     getFromHandout = function(name,callback){         var handout=findObjs({             type: 'handout',             name: name         })[0];         if(handout){             handout.get('notes',callback);         } else {             callback('');         }     },     packForPlayer = function(player){         let mcount = 0,         macros = Base64.encode(JSON.stringify(_.chain(findObjs({type:'macro',playerid: player.id}))         .tap((o)=>{ mcount=o.length; })         .map(simpleObject)         .map((m)=>{             m.playerid=m._playerid;             m.type=m._type;             return _.omit(m,['_type','_playerid','_id']);         })         .value()));         sendChat('',`/w gm <div style="border: 1px solid #eee;background-color:white; border-radius:.25em; padding: .1em .25em;">Packing ${mcount} macros to handout: <b>Macros: ${player.get('displayname')}</b></div>`);         saveToHandout(`Macros: ${player.get('displayname')}`,macros);     },     unpackForPlayer = function(player){         getFromHandout(`Macros: ${player.get('displayname')}`,(m)=>{ if(m.length){ m=JSON.parse(Base64.decode(m)); }             let macros = _.isArray(m) ? m : [];             sendChat('',`/w gm <div style="border: 1px solid #eee;background-color:white; border-radius:.25em; padding: .1em .25em;">Unpacking ${macros.length} macros from handout: <b>Macros: ${player.get('displayname')}</b></div>`);             _.each(macros,(mdata)=>{                 mdata.playerid=player.id;                 createObj('macro',mdata);             });         });     };     on('chat:message',function(msg){         if('api' === msg.type && msg.content.match(/^!(?:pack|unpack)-macros/) && playerIsGM(msg.playerid) ){             let op=msg.content.match(/^!pack/) ? packForPlayer : unpackForPlayer,             args=_.map(_.rest(msg.content.split(/\s+--/)), (o)=>o && o.toLowerCase()),             keys=_.map(args,keyFormat);             _.chain(findObjs({type: 'player'}))             .reject(_.isUndefined)             .filter((o)=>{                 return matchKey(keys,keyFormat(o.get('displayname')));             })             .uniq()             .each(op);         }     }); }); The commands are: !pack-macros --<player name fragment> [--<player name fragment> ...] !unpack-macros --<player name fragment> [--<player name fragment> ...] Here are some examples: Store all macros for a player named Bob the Slayer (all of these work): !pack-macros --Bob the Slayer !pack-macros --bobtheslayer !pack-macros --bob !pack-macros --theSlayer In the case of the shorter name fragments, it will do every matching player (so if you did --bob and you have Bob the Slayer and Bob the not-Slayer , it would do both of them). You can specify multiple separate player fragments: !pack-macros --vince --brian --stephen --russ Unpack has identical syntax.  If a handout with the same name ( Macros: Bob the Slayer ) already exists for a player, it will be overwritten with the new data.  This version doesn't check if a macro already exists and will blindly create macros again, if they are in the handout.  Let me know if that's an enhancement you'd like added. Cheers and ping me if you need help!
Wow Aaron!, Thanks from myself and Josh! We really appreciate it! We're still using the init-me script you wrote for him to roll initiative & add him to the turn tracker.  Tytytytytytytytytyttyt
1486674708
The Aaron
Pro
API Scripter
No worries.  Seriously, if it's for accessibility, hit me up direct.  =D Happy Rolling!