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
This post has been closed. You can still view previous posts, but you can't post any new replies.

5e Shaped Companion Script Thread 2

When using the script to make token action buttons for saves that use the drop down queries, the Roll Template output does not indicate that the roll is a save. Can this be fixed please?
Disabled or deleted all scripts but the shaped script and the custom library. Reverted the character sheet to 6.1.1. Same problem. This is my bigger campaign. Is it possible that I'll crash with an infinite loop every time I try it just because of the size?
Okay, in the infinite loop thread it says it throws the error if the process takes more than 30 seconds. That's what's going on all right. My other campaign only take 20 seconds to import. This one is just bigger. Not sure if there's any solution.
1474098610
Lucian
Pro
API Scripter
Hi Robert, I guess it must be a performance issue of some sort, but I'm not sure why the size of the campaign would slow the script down that much :-/ Could you PM a campaign invite and I'll take a look when I get a chance?
1474098808
Lucian
Pro
API Scripter
@Doug E: The script just calls the sheet macro for this - if you want this changed you'll need to post in the sheet thread on the Character Sheets Forum. I think most people use the chat window version which may be why this has been overlooked.
1474124273

Edited 1474124619
Are you referring to the sheet macro button on the sheet? It only sends to chat and that functions well. Or is there a hidden macro built into the sheet for the query? Edit: Nevermind, I think I found what you are referring to.
1474152033
Lucian
Pro
API Scripter
Hey Doug, Yeah, there's a hidden macro that's built into the sheet to generate the query. I just set up a token action to call that. The query macros are horrific and very fragile which is why they tend to get less love than the chat window output (which is, as you say, what the macro buttons on the sheet use). You can set up the token actions to refer to either, but obviously they only work as well as the sheet macros that implement them...
Might have missed it somewhere, but I'd like to generate some token actions (!shaped-abilities --attacks) for the monsters. They are all on NPC sheets, so the command does not seem to work. What is my best option? Thanks in advance.
1474156763
Kryx
Pro
Sheet Author
API Scripter
Use actions instead of attacks for NPCs
1474184571
Lucian
Pro
API Scripter
Yeah, as Kryx says, you want "!shaped-abilities --actions". If you have a macro you can happily do "!shaped-abilities --actions --attacks" because it will only generate token actions for what's actually there and you won't have both unless you've done something very odd.
1474187886
Lucian
Pro
API Scripter
Hi Robert, I've checked out your campaign quickly and it is certainly a performance issue of some sort. I'm not sure where exactly it lies because when the problem happens Roll20 swallows all the script logging output that would have been generated :-( It's going to take me a while to track it down, I will try and spend some more time later today. What I need to warn you (and others) is that there's a very real possibility that this is not so much a script problem so much as a general Roll20 issue that is just triggered by what we're doing with the script. In general, Roll20 doesn't respond at all well to loading campaigns with huge numbers of items in the journal.  Just loading your campaign on a blank map, the firefox memory page shows the tab using 1.5GB of RAM and it chews my CPU really badly. I don't have the fastest laptop, but it's still a reasonably recent quad-core i5 with 16GB of RAM + dedicated nVidia graphics - and I know a lot of people who game on Roll20 with much lower spec machines. Your players may really struggle if they have slower machines. People do like the idea of importing the whole monster list into the campaign so that you've done all the work up front (finding tokens, setting everything up etc) but sadly Roll20 really isn't optimised for this sort of thing and you will find that lots of things start to creak at the seams (not just the API scripts). If you really want to do this, I'd strongly recommend using the Transmogrifier to move things over from an "offline" campaign so that you can keep your live campaign down to a bare minimum. All that said, I will try and debug this a bit further for you to see if there's something we can improve - or failing that, a more specific performance bug that we can submit to Roll20. Cheers,
1474196118
Lucian
Pro
API Scripter
Ok, so on the performance issue, I'm afraid it turns out that it is indeed a problem with Roll20. In a campaign like Robert's (which has 750 character objects in the journal), retrieving an attribute object takes > 0.5 seconds.  Short of me writing a custom caching layer for character attributes, which I'm not going to get into now, there's not a lot I can do to work around this. For the time being the recommendation will have to remain that you keep your campaign journals as small as possible, only including what you actually need to run them rather than trying to build up a library of everything you might want :-( I have submitted a performance bug to Roll20 with a minimal testcase, but given that this is likely very campaign-dependent I  don't hold out much hope for them making progress on it quickly. Sorry guys :-/
It definitely helps to keep a blank repository game for characters and transmogrify them. But it is so quick to create monsters on the fly when they can be dragged from the compendium or use the script to import that I usually don't keep them. But that's me.
Yeah, I set up a nice token, set the visibilities, and set up all the attachers, so that it reminds me of things that affect saving throws and attacks, so even with the SRD, it takes me five to ten minutes to set up a monster. Oh, and spells. I tried archiving stuff, but that didn't seem to really help.
1474233596
Kryx
Pro
Sheet Author
API Scripter
Roll20 isn't built to have hundreds of character sheets - it not something Lucian and I can greatly improve upon. :(
1474235264

Edited 1474380680
I am using the latest version of the script through 1-click and I am getting the following error "5eShapedCompanion 1474234762247 INFO : Summary of adding entities to the lookup: {\"errors\":0,\"spells\":{\"withErrors\":0,\"skipped\":0,\"deleted\":0,\"patched\":0,\"added\":408}}" "5eShapedCompanion 1474234762249 INFO : Details: {\"errors\":[], there is a lot more to the 3rd line but I did not want to post that much.  I have tried the latest 5e spells from the example files and also the slightly older version from a campaign that works.  I get the same error either way and also with the monster file.  I can understand why the newest version might not work, but the older file should be working. EDIT: It seems to be working now. not sure what was going on.  I am on the old spell script.
1474236383
Lucian
Pro
API Scripter
Hi Ken, That's not an error. That's just the script reporting that it has successfully loaded all of the spells - thus the "INFO" tag. If it  said "ERROR" you would have something to worry about. Do you have other reason to believe that it's not working?
Yeah, nothing was working and I had to keep hitting restart sandbox.  It all seems to be working now.  maybe it was a connection issue.
Cool. I've made a campaign for each product. MM, Tyranny of Dragons, etc. I'll use them as repositories. Hey, is there a way to set the default the bubbles autofill with. I tried to figure it out from the docs, but couldn't. I'd like to get the Blue Circle to connect to AC on default. I just figured out last night that's it's auto-rolling individual HP on dragging a token onto the board. That is SO awesome.
Man, I wish Transmogrifier allowed either searching or sorting.
1474246743

Edited 1474246846
Robert D. said: Cool. I've made a campaign for each product. MM, Tyranny of Dragons, etc. I'll use them as repositories. Hey, is there a way to set the default the bubbles autofill with. I tried to figure it out from the docs, but couldn't. I'd like to get the Blue Circle to connect to AC on default. I just figured out last night that's it's auto-rolling individual HP on dragging a token onto the board. That is SO awesome. Run the command !shaped-config, then go to Token Defaults, then Token Bar Options and set those as you wish. Quick tip, sometimes the bars won't be configured after import still, if so, run !shaped-apply-defaults on the token.
Sweet! Is there a way to set Roll 2 on all characters in the library? I'm figuring that one is too much to hope for, but I'd feel foolish if it turns out the answer was yes. :)
Robert D. said: Sweet! Is there a way to set Roll 2 on all characters in the library? I'm figuring that one is too much to hope for, but I'd feel foolish if it turns out the answer was yes. :) !shaped-config again, then New Characters and change the Roll Options setting
I meant existing characters.
1474271106
Jakob
Sheet Author
API Scripter
Robert D. said: I meant existing characters. ChatSetAttr works in principle, but suffers from the same slowdown + 'infinite loop detected' issue for large campaigns if you try to apply it to many chars at once.
1474273766
Lucian
Pro
API Scripter
Hi Robert, As Jakob implies, there's nothing in the companion script that's useful for "mass token adjustments", unfortunately. Credible options are: Use CharSetAttr on blocks of characters as Jakob suggests Get someone to custom write you a small script to fix all the characters in your campaign - probably not going to be me at this point, I'm afraid, sorry Use !shaped-config to set up your defaults as you want them and then have a macro with a button to run !shaped-apply-defaults, and just do this piecemeal as you slap tokens down onto the map
TokenMod is close to what you want to do. It can already set properties on tokens. Changing that to set properties on characters - CharSetAttr - is probably not that hard. You could take TokenMod, and change it a little so it can set attributes on linked characters. Or ask TheAaron to make the modification for you. He does have a Patreon as well.
It's not worth the effort, I just catch characters as they come. Thought I should ask, though, just in case.
Sorry for the long-winded explanation, but I think I may be having an issue with importing from a statblock and saving throw modifiers. I copy/pasted info from the AL pdf and everything imported great. However, I noticed that the saving throw mods were off.  Saving throws for npcs/monsters are calculated by adding ability mod and prof bonus (per MM page 8). Since this creature is CR 3 prof bonus would be +2 .  It gets prof with STR (18) and DEX (16) saves so it should be +6 +5. After importing those were set at +9 +8!  I noticed there was a checkbox in edit mode so I unchecked. It got closer, but now it says +7 +6.  Everthing in Bonuses and Penalties is set to 0. So I'm not sure why it is calculating it this way. Am I missing something?
1474471543
Kryx
Pro
Sheet Author
API Scripter
Saving throws are automatically calculated, but will adjust for poor math in source material (which I would believe to be the case here). This is a sheet function. Can you post the stat block?
The Stone Dwarf Medium humanoid (dwarf), neutral Armor Class 15 (natural armor) Hit Points 67 (9d8 + 27) Speed 30 ft. STR DEX CON INT WIS CHA 18 (+4) 16 (+3) 16 (+3) 10 (+0) 12 (+1) 15 (+2) Saving Throws Str +6, Dex +5, advantage against poison Skills Athletics +6, Intimidation +4 Senses passive Perception 13 Languages Common, Dwarfish Challenge 3 (700 XP) Brave. The stone dwarf has advantage on saving throws against being frightened. Actions Multiattack. The stone dwarf makes two hand axe attacks. Hand Axe. Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 7 (1d6 + 4) slashing damage.
Just imported another one and it is doing the same thing. It defaults to checking a checkmark which gives more than should be. When unclicked it has one more than should be.
1474474880
Lucian
Pro
API Scripter
4.4.7 (2016-09-21) Features import: Automatically set default token for new characters where available ( 8be1d30 ) Now that Roll20 have released the functionality to do this, I've made the script automatically configure the default token to be the selected token when importing a monster. Should save everyone a tiny bit of extra time! Hopefully soon Riley will deliver on the SheetWorkers being executed via the API, and then we can get rid of the stupid "push the button on the overlay to import" nonsense + we can fix the bug with some token actions not being created properly, so !shaped-apply-defaults won't be necessary either. With luck that should translate to being able to import and configure a new monster with a single command.... which would be several kinds of awesome :-)
1474475853
Lucian
Pro
API Scripter
Dvergr76 said: Just imported another one and it is doing the same thing. It defaults to checking a checkmark which gives more than should be. When unclicked it has one more than should be. Ok, so I just tried this and couldn't reproduce - it was working fine for me. Then I realised that my test campaign was on sheet 6.0.4, so I upgraded to 6.3.0 and tried again, and the issue appeared. The problem comes because the sheet is, for some reason, putting an extra +4 and +3 to Str and Dex saving throws respectively. If you delete the little 4 and 3 that are next to the saves in edit mode you'll see the numbers go back to the expected values. I checked the JSON import data that the script is producing and it looks correct. Kryx, this looks like it must be a regression in the sheetworker code that parses saving_throws_srd that was introduced somewhere between 6.0.4 and 6.3.0.... (Translation for the non-technical: this looks like it's a problem with the sheet rather than the script)
1474475886
Kryx
Pro
Sheet Author
API Scripter
Dvergr, I've created&nbsp;<a href="https://github.com/mlenser/roll20-character-sheets/issues/161" rel="nofollow">https://github.com/mlenser/roll20-character-sheets/issues/161</a> to handle the issue with that monster. For now you can just remove the bonuses that the sheet adds (see the yellow boxes next to the checkbox for saving throws while in edit mode)
Kryx, I have removed the bonuses the sheet adds, but I'm still getting +1 added to the proficient saving throws.&nbsp; +4 (Str) +2 (prof) should = Str +6 &nbsp;| +3 (Dex) +2 (prof) should = Dex +5, but it shows Str +7 | Dex +6. For now I will just have to remember to subtract 1 to those rolls and the other imports if it comes up in tonight's game. Thanks for opening the ticket though.
1474483281
Kryx
Pro
Sheet Author
API Scripter
You unchecked the box, you didn't remove the bonus. See the "3" next to the box? make that 0 and check the box.
ah, ok. That shit blended right in, lol.
Also, sorry I'm not a coder or anything. Just a gamer. I'd rather not have to deal with all this technical crap. I'm hoping one day I can just set and forget, instead of having to copy/paste, copy/paste, copy/paste updates to the sheet. It'll get there one day. Right?
1474483985

Edited 1474484067
Dvergr76 said: Also, sorry I'm not a coder or anything. Just a gamer. I'd rather not have to deal with all this technical crap. I'm hoping one day I can just set and forget, instead of having to copy/paste, copy/paste, copy/paste updates to the sheet. It'll get there one day. Right? You can do that already by setting the sheet to the "Shaped Sheet" instead of Custom, and the API to be the One Click version. It just means that you'll only get updates when they get merged with roll20. It's more stable, but you won't get the latest features that Kryx & Lucian have released until roll20 merge it in. That's what normal and Plus users do (for the sheet at least).
Yeah, I know. Then I have to wait when stuff breaks. Don't mind me. Just venting. I love this sheet. Burnt out on the maintenance though. :-(
1474491263
Kryx
Pro
Sheet Author
API Scripter
Unfortunately that's the nature of software. Without an extensive test suite or dedicated testers any new development is bound to cause some bugs.
1474499039
Zym
Sheet Author
I think these sheets are amazing. I am in the same zone as Dvergr76, and I really respect the developers here for answering questions and teaching new things. We're learning slowly.&nbsp; Plus, just from the API from Kryx, Lucian and Aaron getting some really good feedback from players. Top form for running RPGs games.&nbsp; So credit where credit is deserved.
Kryx said: Unfortunately that's the nature of software. Without an extensive test suite or dedicated testers any new development is bound to cause some bugs. I know Kryx. Just bustin' yer ballz buddy.
I had a question regarding the API companion script. I wanted to grant sight/take away sight based on the entries in the token defaults section. --------------------------------------------------------------------- Token Defaults Note that all of the settings under Token Defaults are applied to tokens only when !shaped-import-monster, !shaped-import-statblock or!shaped-apply-defaults are run. Numbered Tokens If this is 'on', new tokens will have %%NUMBERED%% appended to their name to work with Aaron's TokenNameNumbered script. Please search for this on the API forum for more details. Show Name Tag If this is 'on', the token will show its name tag to anyone who has permission to see it Show Name to Players If this is 'on', and Show Name Tag is also 'on', players will be able to see the token's name. Light Radius Default light radius emitted from token (Note that this value will be overriden by a value derived from a monster's senses attribute where available) Dim Radius Start of dim light within the above-specified light radius (Note that this value will be overriden by a value derived from a monster's senses attribute where available) Show other players Whether light emitted from the token is visible only to the controlling player(s) or to all players Has Sight If 'on' then controlling players will be able to see areas of maps with dynamic lighting enabled based on the position of this token Light angle Emitted light will be cast in arc this many degrees wide. LOS angle the token's vision will be limited to an arc this many degrees wide Light multiplier The multiplier affects how far the token can see from existing light sources. This is a good way to simulate a character who has the ability to see further than normal in low light situations or has an alternate form of vision that might allow them to navigate in the dark. For example, someone who can see twice as far in low light would have a multiplier of two. ----------------------------------------------------- I know I can change these in the token defaults section but I only want to grant sight to my players. In addition I want to be able to create a macro which would grant darkvision and another which would take it away by adjusting the Light and Dim Radius properties of the token selected. If this isn't possible or if this has be addressed in a new thread somewhere I apologize. I found 2 threads that you'd created on the subject and both were closed. Darkvision I just simulate by giving them light out to 60 feet with a Dim Radius of 0. This can be done by the token defaults settings which you can apply with !shaped-apply-defaults and I have a macro here which I use to set up new tokens that utilizes some of the script commands. I was hoping I could access the functionality of the Token Defaults with similar strings. !shaped-abilities --attacks !shaped-abilities --initiative !shaped-abilities --spells !shaped-abilities --rests !shaped-apply-defaults Perhaps something like !shaped-tokendefault-light-20 or something to that effect to grant light out to 20 feet. It would be for granting and modifying players sight rapidly. I know of the torch script but it doesn't cover what I'm trying to accomplish.
I use Tokenmod. Another fine product from the Scriptomancer, Aaron. And a macro that changes the light and sight of a token... !token-mod --set ?{Vision|Torch, light_radius#40 light_dimradius#20 light_hassight#yes light_angle#360 light_otherplayers#yes|Lamp, light_radius#30 light_dimradius#15 light_hassight#yes light_angle#360 light_otherplayers#yes|Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#60 light_hassight#yes light_otherplayers#yes|Hooded Lantern, light_radius#60 light_dimradius#30 light_hassight#yes light_angle#360 light_otherplayers#yes|Candle, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#yes|No light source, light_radius#5 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Blinded, light_hassight#no light_angle#360 light_otherplayers#no|Darkvision, light_radius#60 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Darkvision (90'), light_radius#90 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Warlock Devil's Sight, light_radius#120 light_dimradius#=120 light_hassight#yes light_angle#360 light_otherplayers#no|No light source(Dusk), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no } To use the companion script I think is possible but I believe it would require changing the config defaults and then selecting the token and then apply defaults.
1474787676
Lucian
Pro
API Scripter
Hi Ian, The script allows you to configure defaults for new characters and tokens, but it seems like you want something that will allow you to change light/vision settings just for some tokens. Well, as Doug pointed out, you probably just want to use TokenMod - this kind of thing is out of scope for the companion script, because it really doesn't have much to do with the Shaped character sheet itself or monster import. You should note that if you import monsters using !shaped-import-monster or !shaped-import-statblock, it will automatically configure their token vision using the values from the "senses" attribute. (Side note: I guess there's nothing stopping me from having !shaped-apply-defaults do the same for PCs based on the values in the various Vision boxes.... will make an enhancement request for this...) Is this for dealing with spells/items that grant darkvision temporarily? That seems like an unusual case given how many races get darkvision already in 5e. If not, I'm not sure I understand why you wouldn't just configure the vision settings manually for a PC token and then just save that as the default token for that character - that way you never have to worry about any of this after you've first configured the PC - which is hopefully a relatively rare operation unless you are running a *particularly* deadly campaign! I'm concerned that maybe you're making your life substantially harder than it needs to be....
1474797006
Lucian
Pro
API Scripter
4.4.8 (2016-09-25) Bug Fixes apply-defaults: Ensure !shaped-apply-defaults saves the default token so that the changes persist ( 314b61d ), closes #230 token-numbering: %%NUMBERED%% shouldn't be applied to PC tokens even if this feature is enabled ( d74c529 ), closes #231 Features token-vision: Automatically set vision for PCs from senses when running !shaped-apply-defaults. Previously this only worked for NPC tokens. ( 8ad9077 ), closes #229
APIs down right now? I can't get the sand box to spin up.
Working now.