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

[WelcomePackage][5e Shaped] Default configurations

1534735723

Edited 1534735748
When I use the Welcome Package API with the 5e Shaped character sheet, it bypasses my configurations and gives my players a default, rather than the setting I made in !shaped-config.  Is there a way I can get these two kids to talk nice to eachother and bring my players something they won't have to set up manually (all the use resource API functions, Sanity houserule, Name/ AC/ Targeting attacks and spells, etc.)?  Seems weird that it just produces a named character sheet that the API can link to, but never set up correctly.
If not, is there a macro I can make that will do all the same things, as a simplifier, to an existing sheet (maybe using CSA)?
1534743179

Edited 1534743236
Jakob
Sheet Author
API Scripter
Wolf Thunderspirit said: If not, is there a macro I can make that will do all the same things, as a simplifier, to an existing sheet (maybe using CSA)? Yep, for sure, this is probably the easiest option. Just look at the list of attributes you get with a manually-created sheet which differ from the default, then set them all in a CSA macro. They will probably be at the end of the attributes listing.
1534744428
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Wolf Thunderspirit. It might be best to try and contact the author of the Welcome Package script directly: Stephen L. He would be most likely to have the insight you need.
1534781784
Lucian
Pro
API Scripter
Hey Wolf, Unfortunately changes made by the API don't trigger other API scripts. So when Welcome Pack creates a character, it won't fire off a "new character" event for the Shaped Companion to pick up on. The best solution to this would probably be to have Welcome Pack expose its own simple event publishing API so that other scripts could listen for new characters created by it. I can hook into that with Shaped and trigger the configuration stuff when a new character is made. Cheers,
keithcurtis said: Hi Wolf Thunderspirit. It might be best to try and contact the author of the Welcome Package script directly: Stephen L. He would be most likely to have the insight you need. Already have, he told me to contact Sheet Author ... lol
1534855461
The Aaron
Pro
API Scripter
I added the Observer pattern and sent a pull request:&nbsp;<a href="https://github.com/Roll20/roll20-api-scripts/pull/690" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/690</a>
1534856094
Jakob
Sheet Author
API Scripter
The Aaron said: I added the Observer pattern and sent a pull request:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/pull/690" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/690</a> Nice! All these scripts getting some reactive programming updates lately makes me feel bad that ChatSetAttr isn't an Observable yet...
1534856371
The Aaron
Pro
API Scripter
Well, if you want some assistance adding that... =D Honestly, I've been meaning to write an API level event system for a long time, I should probably do that and the hundred other things I haven't done yet...
1534857867

Edited 1534857885
Jakob
Sheet Author
API Scripter
The Aaron said: Well, if you want some assistance adding that... =D Honestly, I've been meaning to write an API level event system for a long time, I should probably do that and the hundred other things I haven't done yet... Actually, I have one question about that. In TokenMod, you use JSON.parse(JSON.stringify(token)). That must be pretty slow. Do you know if Object.assign({}, token) works too?
1534859304
The Aaron
Pro
API Scripter
It doesn't do the same thing.&nbsp; JSON.stringify(token) is calling Roll20's serialization code (function toJSON() ), which exposes the properties in the format we are expecting.&nbsp; Object.assign() gives us the raw internal properties (this is for a character because I'm lazy that way...): { &nbsp;&nbsp;&nbsp;"attributes":&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"name":&nbsp;"foo4", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"bio":&nbsp;"", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"gmnotes":&nbsp;"", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"_defaulttoken":&nbsp;"", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"archived":&nbsp;false, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"inplayerjournals":&nbsp;"all", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"controlledby":&nbsp;"-JS3qKxIUPHLzSbK24ve", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"_id":&nbsp;"-LKRh66mxHoDFopfOQZi", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"_type":&nbsp;"character", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"avatar":&nbsp;"" &nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;"updatequeue":&nbsp;{}, &nbsp;&nbsp;&nbsp;"id":&nbsp;"-LKRh66mxHoDFopfOQZi", &nbsp;&nbsp;&nbsp;"fbpath":&nbsp;"/characters/-LKRh66mxHoDFopfOQZi", &nbsp;&nbsp;&nbsp;"_changing":&nbsp;false, &nbsp;&nbsp;&nbsp;"changed":&nbsp;{}, &nbsp;&nbsp;&nbsp;"_pending":&nbsp;false } Looking at that indicates that using something like: Object.assign({},token.attributes) Will (probably) give us what we expect: { &nbsp;&nbsp;&nbsp;"name":&nbsp;"foo5", &nbsp;&nbsp;&nbsp;"bio":&nbsp;"", &nbsp;&nbsp;&nbsp;"gmnotes":&nbsp;"", &nbsp;&nbsp;&nbsp;"_defaulttoken":&nbsp;"", &nbsp;&nbsp;&nbsp;"archived":&nbsp;false, &nbsp;&nbsp;&nbsp;"inplayerjournals":&nbsp;"all", &nbsp;&nbsp;&nbsp;"controlledby":&nbsp;"-JS3qKxIUPHLzSbK24ve", &nbsp;&nbsp;&nbsp;"_id":&nbsp;"-LKRi8t4mQv0ea_HLSJZ", &nbsp;&nbsp;&nbsp;"_type":&nbsp;"character", &nbsp;&nbsp;&nbsp;"avatar":&nbsp;"" } However, I'm not sure I like that very much as it relies on the implementation rather than the interface.&nbsp; toJSON() may be a bit slower, but it at least feels a bit safer.&nbsp; Honestly, I've not noticed any lag using JSON.parse(JSON.stringify(token)).&nbsp; Those are probably implemented in native code and running quite quickly, I'd have to do some benchmarks to see if they're even an issue in the API.
1534859917
Jakob
Sheet Author
API Scripter
Hmm, good to know! Then I'll just use JSON, that does seem a lot safer. Premature optimization and all that ... :D
1534860466
The Aaron
Pro
API Scripter
Totes. =D
I contacted Stephen L. and referred him to this thread. &nbsp;Hopefully he will be able to add something constructive to the discussion in order to find a resolution to the issue. &nbsp;For now, I have a document I reference on how to set up the character sheet manually. &nbsp;Still doesn't avoid the occasional player asking me why there is no Sanity attribute even though the Stats Rolling Macro rolls for it. &nbsp;lol. &nbsp;I think I might duplicate the link on the Stats rolling macro, so they can find it ... again ... even though its there in the Player's Menu ...
1534896804
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In the interim, you can&nbsp; create any number of blank character sheets that are assigned to All Players. You can even do prep work on them, like enabling a Sanity score. As long as your players aren't terribly concerned with secrecy, it should get them started.
The way we play, everything is secret until the player chooses to reveal: It's heavily involved in Storytelling, rather than hack-n-slash statistics. &nbsp;Almost all my players have a dark past or something the other players don't know. &nbsp;They usually don't reveal it until there is a trust between them. &nbsp;So yeah, I can't have universal open sheets. &nbsp;And besides, that would make the point of having the Welcome Package API useless.
This is what my players have to do to setup their sheets: &nbsp;If there was a list of commands I could set in a macro using CSA, I could just make them click that: Because of the automation process, the sheets are bypassing the configuration process and must be manually set up before you start working with them. &nbsp; 1) If you haven't done so already, and this is your very first time logging in, it will be named the same as your account name.&nbsp; Please change this to whatever name you want for your character . When you create new character's you are prompted for names, so this isn't necessary for your subsequent characters. 2) Below the name you will find " Character ",&nbsp; a gear &nbsp;icon , and a&nbsp; pencil icon . Click on the gear icon. 3) The first column is ok, move on to the second 4) Under the&nbsp; Actions &nbsp;box, uncheck&nbsp; Weight &nbsp;- I only worry about encumbrance if you're trying to move a house on your back. Put a checkmark in Automatically Use Ammo &nbsp;and&nbsp; Emote &nbsp;which will decrement arrows and such on use, and allow you some fancy wordplay on attacks and spells. 5) Under the&nbsp; Spells &nbsp;box, Check off&nbsp; Automatically Expend Spell Resources &nbsp;to use spell slots automatically 6) In the&nbsp; Houserules &nbsp;box, Check&nbsp; Automatically Revert (dis)advantage &nbsp;to automatically return to normal any die rolls you had at advantage or disadvantage. Also check off&nbsp; Sanity , as this allows you your saving throw vs Madness to appear, and a place to put the specified stat. 7) In&nbsp; Roll Templates , Select&nbsp; yes &nbsp;for&nbsp; Character Name on All Roll Templates , as well as checking both boxes below that ( Target's AC ... and&nbsp; Target's Name ...) 8) You're done, so click the&nbsp; Character &nbsp;icon under your name.
1534939190
The Aaron
Pro
API Scripter
Wolf Thunderspirit said: I contacted Stephen L. and referred him to this thread. &nbsp;Hopefully he will be able to add something constructive to the discussion in order to find a resolution to the issue. &nbsp;For now, I have a document I reference on how to set up the character sheet manually. &nbsp;Still doesn't avoid the occasional player asking me why there is no Sanity attribute even though the Stats Rolling Macro rolls for it. &nbsp;lol. &nbsp;I think I might duplicate the link on the Stats rolling macro, so they can find it ... again ... even though its there in the Player's Menu ... Honestly, he shouldn't have to do anything unless he doesn't like how I added the Observer Pattern to his script.&nbsp; &nbsp;Once that pull is picked up by Roll20 (Likely Tuesday), Lucian can Observe it from the Shaped Script.
1534943615
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Sorry, haven't been on in a few days and just now checked my inbox. The Observer pattern Aaron implemented in the script is fine with me.
1534945202
The Aaron
Pro
API Scripter
Cheers!&nbsp; Thanks Stephen.
The Aaron said: Wolf Thunderspirit said: I contacted Stephen L. and referred him to this thread. &nbsp;Hopefully he will be able to add something constructive to the discussion in order to find a resolution to the issue. &nbsp;For now, I have a document I reference on how to set up the character sheet manually. &nbsp;Still doesn't avoid the occasional player asking me why there is no Sanity attribute even though the Stats Rolling Macro rolls for it. &nbsp;lol. &nbsp;I think I might duplicate the link on the Stats rolling macro, so they can find it ... again ... even though its there in the Player's Menu ... Honestly, he shouldn't have to do anything unless he doesn't like how I added the Observer Pattern to his script.&nbsp; &nbsp;Once that pull is picked up by Roll20 (Likely Tuesday), Lucian can Observe it from the Shaped Script. What will actually happen at that point, in so far as a solution to the problem?
1534976667
The Aaron
Pro
API Scripter
Suddenly, everything will magically work. =D (assuming you have the newest versions of each script installed. )
Never assume ... lmao ...
1535016551
Lucian
Pro
API Scripter
Ok, I will keep an eye out for the new version of Stephen's script and then add the relevant bits to mine to support it.
Well, I'm in the hospital getting a toe amputated (#diabetesSux), so no rush here.
1535245309
The Aaron
Pro
API Scripter
Jakob said: Actually, I have one question about that. In TokenMod, you use JSON.parse(JSON.stringify(token)). That must be pretty slow. Do you know if Object.assign({}, token) works too? One more thing to be aware of is that Object.assign() will only do a shallow copy.&nbsp;&nbsp;
Lucian said: Ok, I will keep an eye out for the new version of Stephen's script and then add the relevant bits to mine to support it. I'm wondering if this is ready yet, as I've run my welcome package and its still bypassing the default configurations. &nbsp;I'm outta the hospital, say hello to Wolf "9 toes" Thunderspirit ... lol.
1535817715
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I made changes recently to fix this, but the pull request for it hasn't been merged yet.
Stephen L. said: I made changes recently to fix this, but the pull request for it hasn't been merged yet. copy that
1535853417
The Aaron
Pro
API Scripter
Wolf Thunderspirit said: &nbsp;I'm outta the hospital, say hello to Wolf "9 toes" Thunderspirit ... lol. I'm reminded of Logen "9 Fingers" from The Blade Itself by Joe Abercrombie.&nbsp; =D