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

Stephen L. Welcome Package Issue

So I am using the API script Welcome Package, by Stepehn L., in a character vault for my friends and we seem to have hit a snag that it won't let anyone make character sheets using the 'CreateACharacter' macro anymore. It worked fine before, the only things that have changed since I installed it was that I now have the Guildmaster's Guide to Ravnica and the Ebberon books as well as I made two of them GM's to try and see how that function worked
1590008022
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Does an error message appear in your API console log when they click the macro for it? Please copy-paste the contents of your log from that into this thread. That could help me track down the issue.
1590077044
Stephanie B.
Forum Champion
Sheet Author
(Replying as non-staff user) HI, Stephen. I created a game 3 weeks ago and added the Welcome Package. There is no CreateACharacter macro in my game at all: I just restarted the API sandbox before reloading and taking this screen shot. There are no error messages in the sandbox. When a new player joins the campaign, a character is automatically generated for them. It's just the macro that broke.
1590077671

Edited 1590080774
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Ah, thanks for clarifying. I'll look into it when I have some spare cycles. This script hasn't been changed in 2 years though...
1590083195

Edited 1590083793
Ada L.
Marketplace Creator
Sheet Author
API Scripter
For anyone having problems with the script, please try this new version. If it fixes the problem, I'll make a pull request for it. If it doesn't fix the problem, this version has some new debugging features built in. Please copy-pasta any error messages that come up in your API console log to this thread. const WelcomePackage = (() =&gt; { 'use strict'; const CREATE_CHARACTER_CMD = '!welcomePackageCreateCharacter'; const CSS = { 'menu': { 'background': '#fff', 'border': 'solid 1px #a88cd5', 'border-radius': '5px', 'font-weight': 'bold', 'margin-bottom': '1em', 'overflow': 'hidden' }, 'menuBody': { 'padding': '5px', 'text-align': 'center' }, 'menuHeader': { 'background': '#a88cd5', 'color': '#fff', 'text-align': 'center' } }; const observers = []; let isReady = false; /** * Report an error to the GM and log its stack trace. * @param err The error. */ function _error(err) { log(`WelcomePackage ERROR: ${err.message}`); log(err.stack); sendChat('WelcomePackage API', `/w gm ERROR: ${err.message} --- See API console log for details.`); } /** * Event handler for when a player logs into the game. * @private * @param {Player} player */ function _handlePlayerOnline(player) { if (player.get('_online') &amp;&amp; !playerIsGM(player.get('_id'))) createPlayerCharacter(player); } /** * Registers a function to be notified when a character is created * @param {function} func */ function onAddCharacter(func){ if('function' === typeof func){ observers.push(func); } } /** * Notifies all registered functions when a character is created * @param {Character} character */ function notifyAddCharacter(character){ observers.forEach((f)=&gt;f(character)); } /** * Creates a character creation macro for a player if they don't already * have the macro. * @param {Player} player */ function addCharacterCreateMacro() { const macroName = 'CreateACharacter'; let allPlayers = findObjs({ _type: 'player' }); _.each(allPlayers, player =&gt; { let playerId = player.get('_id'); let macro = findObjs({ _type: 'macro', _playerid: playerId, name: macroName })[0]; if(!macro) { log(`WelcomePackage: Creating "CreateACharacter" macro for player ` + `${player.get('_displayname')}`); createObj('macro', { _playerid: playerId, name: macroName, action: `${CREATE_CHARACTER_CMD} ?{Character Name:}` }); } }); } /** * Creates a character for a player if they don't already have any characters. * @param {Player} player * @param {string} [name] The name of the character. If this is provided, * the character will be created regardless of whether * the player has a character already. */ function createPlayerCharacter(player, name) { let playerId = player.get('_id'); let who = player.get('_displayname'); // Check if there are any characters already controlled by the player. let characters = findObjs({ _type: 'character' }).filter(character =&gt; { return character.get('controlledby').includes(playerId); }); // Create the new character if there are none, or if a name has been // provided for a character being explicitly created through the macro. if(characters.length === 0 || name) { if(!name) { log(`WelcomePackage: Creating first-time character for player ` + `${player.get('_displayname')}`); name = `${who}'s character`; } let character = createObj('character', { controlledby: playerId, inplayerjournals: 'all', name }); // Disable the Charactermancer for the new character by creating // the "version" attribute. This will be set to its correct value later // by the character sheet's worker. createObj('attribute', { name: 'mancer_confirm_flag', characterid: character.id, current: '1' }); createObj('attribute', { name: 'l1mancer_status', characterid: character.id, current: 'completed' }); setTimeout(() =&gt; { notifyAddCharacter(character); showCharacterLink(who, character); }, 1000); } } /** * Shows a player the link to their new character with a welcoming message. * @param {string} who The player's display name. * @param {Character} character */ function showCharacterLink(who, character) { let menu = new HtmlBuilder('.menu'); menu.append('.menuHeader', 'Welcome!'); let content = menu.append('.menuBody'); content.append('div', 'A blank character has been created for you to start building: '); content.append('a', character.get('name'), { href: '<a href="http://journal.roll20.net/character/" rel="nofollow">http://journal.roll20.net/character/</a>' + character.get('_id'), style: { color: '#a08' } }); let html = menu.toString(CSS); sendChat('Welcome Package', '/w ' + who + ' ' + html); } // When a player logs in, create a character for them if they don't have one. on('change:player:_online', player =&gt; { if(isReady) _handlePlayerOnline(player); }); on('ready', () =&gt; { try { // Create the global macro for the script (visible to all players) // if it doesn't already exist. addCharacterCreateMacro(); log('*** Initialized Welcome Package v1.3.2 ***'); isReady = true; // Wait some amount of time to give other scripts a chance to finish // loading. Then process any pending logged in players. setTimeout(() =&gt; { try { // Once we're loaded, create a character for any player that doesn't // have one. let players = findObjs({ _type: 'player' }); _.each(players, player =&gt; { _handlePlayerOnline(player); }); } catch (err) { _error(err); } }, 5000); } catch (err) { _error(err); } }); /** * Process chat commands. */ on('chat:message', msg =&gt; { let playerId = msg.playerid; if(msg.content.startsWith(CREATE_CHARACTER_CMD)) { let player = getObj('player', playerId); let argv = msg.content.split(' '); let name = argv.slice(1).join(' '); createPlayerCharacter(player, name); } }); return { OnAddCharacter: onAddCharacter, onAddCharacter }; })(); _.noop(WelcomePackage);
Here is the message that it just popped up.&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again docker: Error response from daemon: failed to create endpoint campaign-7208545-_Fm8YXPU9U8HJ0pnUBF6pQ on network bridge: adding interface veth7cea1e4 to bridge docker0 failed: exchange full. Iam very new to the whole API script so I will try to figure out how to put that new script in. Thank you.
Okay I was able to figure out how to input the script and it worked, thank you very much.
1590156857
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Cool. I'll create the pull request for the changes then.
Is there a way to change the script so the new character sheets are only seen by the player in control rather than available to view by all players?
1591363024
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes, that is technically possible to do. I'm not sure that I'll make that change to it unless there's an overwhelming number of users who want it.
1591366438
GiGs
Pro
Sheet Author
API Scripter
It sounds like a good thing for a config setting. It does seem to be a bit of a fringe use though.&nbsp; Bear in mind, Thomas, players can see that there is a character sheet, but they cant actually view the character sheet tab of other character sheets. If you havent done this. create an alt account, invite it to your game, and then log in using it and look at the other player sheets you can see. You can't see the actual Character Sheet tab unless you control the sheet.
1591370438

Edited 1591370549
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is the script that I use for this purpose. It might suit your requirements more closely. New characters are assigned to the player: Add Player Character I edited line 35 (the sendChat line) to include links to character creation handouts.
1591372683
Ada L.
Marketplace Creator
Sheet Author
API Scripter
keithcurtis said: This is the script that I use for this purpose. It might suit your requirements more closely. New characters are assigned to the player: Add Player Character I edited line 35 (the sendChat line) to include links to character creation handouts. Why isn't this in One-Click? It looks nice! Better than my Welcome Package script even...
1591374273
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ask the Aaron? :)
1591374423
The Aaron
Roll20 Production Team
API Scripter
Uh... laziness?&nbsp; Hmm.&nbsp; I think there's a bug with it I need to sort out...&nbsp; yeah, ok, I'll add it to my list...
1591383669
Ada L.
Marketplace Creator
Sheet Author
API Scripter
No rush. If you do get the script into shape for it to be in One-Click, I'll probably retire this script in favor of it.
1591383958
The Aaron
Roll20 Production Team
API Scripter
Fair enough.&nbsp; I'll have to be sure I have feature parity then. =D
GiGs said: It sounds like a good thing for a config setting. It does seem to be a bit of a fringe use though.&nbsp; Bear in mind, Thomas, players can see that there is a character sheet, but they cant actually view the character sheet tab of other character sheets. If you havent done this. create an alt account, invite it to your game, and then log in using it and look at the other player sheets you can see. You can't see the actual Character Sheet tab unless you control the sheet. Yeah, I know about that thank you. I help run an arena style game that sees a lot of influx of new players and just trying to keep things neat on the player's end. I'll check out the other script that you have for the starter sheet too @KeithCurtis
1591395467
GiGs
Pro
Sheet Author
API Scripter
Thomas H. said: Yeah, I know about that thank you. I help run an arena style game that sees a lot of influx of new players and just trying to keep things neat on the player's end. That makes a lot of sense.