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.

[Script] 5e Shaped Support Script

Yeah want the auto import. I am just going to wait a bit then. Awesome work your doing btw!
Just a quick update on testing Lucian, simply put the script is kicking some serious booty!  I have upgraded well over half of my campaign right now, manually doing spells is really the only time consuming thing.  Between the ShapedSupport, Token-Mod and the TokenAction script it only takes me 10-15s per mob to convert it over to the new sheet. Fantastic job on the script man, can't thank you enough!
Ditto, (and thanks for the note and direction)
1459526211
Lucian
Pro
API Scripter
Kevin said: Just a quick update on testing Lucian, simply put the script is kicking some serious booty!  I have upgraded well over half of my campaign right now, manually doing spells is really the only time consuming thing.  Between the ShapedSupport, Token-Mod and the TokenAction script it only takes me 10-15s per mob to convert it over to the new sheet. Fantastic job on the script man, can't thank you enough! Thanks for the support! FYI auto-spell import should be working later today - just in testing atm. Lucian
Lucian, The Aaron already wrote a script to give an avatar to each character without one. So that saves you the troubles of making it for me. (if you were intending to do so)
1459527790
Lucian
Pro
API Scripter
Rick V. said: Lucian, The Aaron already wrote a script to give an avatar to each character without one. So that saves you the troubles of making it for me. (if you were intending to do so) Cool. Well in that case I'm not sure there's a lot more I can offer you - I think the rest you just have to suck up I'm afraid :-(
1459538740
Lucian
Pro
API Scripter
Version 0.3.0: Automatic spell import. Now, when you import a monster, either from JSON or from statblock, the script will parse its spell list and attempt to populate all of the spell details from any JSON spell data that is installed. Things to note: After importing something with lots of spells like the Lich, the update when you open the sheet and click "import" on the overlay will take a *long* time, and will complete in several stages. Like 30 seconds long. Be patient. I noticed a bug with spell import while doing this - save stats weren't being set properly because the stats were written with lowercase in the JSON, but the sheet expects title case. There will be an updated JSON file available shortly to fix this - but everything else works ok in the meantime. 
Lucian H. said: Version 0.3.0: Automatic spell import. Now, when you import a monster, either from JSON or from statblock, the script will parse its spell list and attempt to populate all of the spell details from any JSON spell data that is installed. Does this also work with the compendium, or do we have to add JSON data for the spells?
1459545069
Lucian
Pro
API Scripter
alexander h. said: Lucian H. said: Version 0.3.0: Automatic spell import. Now, when you import a monster, either from JSON or from statblock, the script will parse its spell list and attempt to populate all of the spell details from any JSON spell data that is installed. Does this also work with the compendium, or do we have to add JSON data for the spells? Sadly the Compendium is not accessible programmatically (either by sheetworkers or the API), so you have to use the JSON files.
1459546465
Kryx
Pro
Sheet Author
API Scripter
Well the JSON will give us better results anyways - especially as soon as we add the FX features. :)
Lucian H. said: Version 0.3.0: Automatic spell import. Now, when you import a monster, either from JSON or from statblock, the script will parse its spell list and attempt to populate all of the spell details from any JSON spell data that is installed. Things to note: After importing something with lots of spells like the Lich, the update when you open the sheet and click "import" on the overlay will take a *long* time, and will complete in several stages. Like 30 seconds long. Be patient. I noticed a bug with spell import while doing this - save stats weren't being set properly because the stats were written with lowercase in the JSON, but the sheet expects title case. There will be an updated JSON file available shortly to fix this - but everything else works ok in the meantime.  Most probably a pie in the sky wish list item however since you are talking about JSON. For those of us who are not super savy with how the JSON is formatted is there a possibility of getting the format, maybe even a complete template that we can use to add to the current JSON entries for home brewed monsters and spells?
1459570985

Edited 1459571060
Getting errors with the new version. I get this when I try to do a JSON import:  Shaped Scripts Error. An error occurred. Please see the log for more details.  When I look to the log, I see this:  "ShapedScripts 1459570844228 ERROR : TypeError: Cannot call method 'hydrateSpellList' of undefined" "ShapedScripts 1459570844232 ERROR : TypeError: Cannot call method 'hydrateSpellList' of undefined\n at evalmachine.<anonymous>:1699:12\n at Function._.map._.collect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:172:24)\n at _.(anonymous function) [as map] (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:1496:34)\n at Object.shapedModule.importMonstersFromJson (evalmachine.<anonymous>:1698:7)\n at Command.handle (evalmachine.<anonymous>:2577:9)\n at Object.processCommand (evalmachine.<anonymous>:2660:11)\n at Object.shapedModule.handleInput (evalmachine.<anonymous>:1577:24)\n at eval (eval at <anonymous> (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), <anonymous>:65:16)\n at Object.publish (eval at <anonymous> (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), <anonymous>:70:8)\n at eval (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28), <anonymous>:1143:12)"
Robert said: Getting errors with the new version. I get this when I try to do a JSON import:  Shaped Scripts Error. An error occurred. Please see the log for more details.  When I look to the log, I see this:  "ShapedScripts 1459570844228 ERROR : TypeError: Cannot call method 'hydrateSpellList' of undefined" "ShapedScripts 1459570844232 ERROR : TypeError: Cannot call method 'hydrateSpellList' of undefined\n at evalmachine.<anonymous>:1699:12\n at Function._.map._.collect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:172:24)\n at _.(anonymous function) [as map] (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:1496:34)\n at Object.shapedModule.importMonstersFromJson (evalmachine.<anonymous>:1698:7)\n at Command.handle (evalmachine.<anonymous>:2577:9)\n at Object.processCommand (evalmachine.<anonymous>:2660:11)\n at Object.shapedModule.handleInput (evalmachine.<anonymous>:1577:24)\n at eval (eval at <anonymous> (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), <anonymous>:65:16)\n at Object.publish (eval at <anonymous> (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), <anonymous>:70:8)\n at eval (eval at <anonymous> (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28), <anonymous>:1143:12)" Same here...
Also get something like that at the moment
1459581125
Lucian
Pro
API Scripter
Sorry guys, my bad - changed something without properly testing all the command again - I think I need to add some more unit tests for the main script itself to stop this sort of thing happening! New version shortly.
1459582957
Lucian
Pro
API Scripter
Version 0.3.2: Fixed bug with JSON import. Also added some basic functionality for configurable gender pronouns. It's not the most user-friendly thing at the moment, but I believe it works. To add a new set of pronouns you need to add an entry to the genderPronouns array in the configuration. The initial configuration has 3 sets of pronouns, and, being javascript it's a zero-based array (sorry, this is very techie at the moment), so you need to do something like this: !shaped-config --genderPronouns[3].matchPattern non-specific gender !shaped-config --genderPronouns[3].nominative they !shaped-config --genderPronouns[3].accusative them !shaped-config --genderPronouns[3].possessive their !shaped-config --genderPronouns[3].reflexive themselves When you import spells with an emote containing a gender pronoun placeholder, it will check the gender of the character and see if it matches against the matchPattern of each genderPronoun definition in turn - in this case it will look for 'non-specific gender'. If it finds a match, it will use that set of pronouns. The patterns are actually regular expressions, if you want to get fancy with it, so you can do things like 'none|not applicable|none of your business' if you want to At some point I may get round to making this a  bit friendlier but at least it's something for now!
That update fixed it. Thanks! Everything working so far!
1459596834
Lucian
Pro
API Scripter
Shadowspawn said: Most probably a pie in the sky wish list item however since you are talking about JSON. For those of us who are not super savy with how the JSON is formatted is there a possibility of getting the format, maybe even a complete template that we can use to add to the current JSON entries for home brewed monsters and spells? So at the moment this isn't super easy because the JSON needs to get compiled up by a gulp script in order to be used by the main script. I'll give some thought about how we can make this a bit more user-friendly.
1459597282
Lucian
Pro
API Scripter
Version 0.3.3: Minor update to the gender pronouns functionality. Fixed some minor bugs and also added the ability to set a default: !shaped-config --genderDefaultIndex 1 where '1' is a zero-based index into the list of currently configured gender pronoun information (see previous post for details). Again, sorry that this is not particularly user-friendly, but I guess not that many people will need to fiddle with this, and I have plans for making all this config stuff much nicer in the future.
1459599464

Edited 1459599765
Just tried importing a Mage and an Acolyte. Two characters get made instead of one. No spells imported in either. Edit: Restarted script a couple times. Now just one character gets made. Cant get spells to auto import though.
1459599585
Lucian
Pro
API Scripter
Robert said: Just tried importing a Mage and an Acolyte. Two characters get made instead of one. No spells imported in either. Can you paste exactly what commands are you running?
!shaped-import-monster --mage
1459600240
Lucian
Pro
API Scripter
Ok, so that command works fine for me. Can you make sure that you have the latest versions of both the script from my Github, and also the monster and spell files. If you're getting two copies of the character, can you also make sure that you don't have two copies of the script installed - that's what it sounds like.
Ah, there we go, I think maybe my monster/spell files werent up to date. Thanks!
1459600744
Lucian
Pro
API Scripter
If you're getting two copies of the character, you should also double check that you don't have multiple copies of the main script installed - that could cause you a lot of problems if you do!
One thing I noticed, spells that have an asterix (because they are "cast before combat") get the spell names imported with the asterix but the script doesnt recognize them as the spell. So, it gets imported as a cantrip with no spell info. Example: Archmage
1459602076
Lucian
Pro
API Scripter
@Robert Nice catch! I dealt with the restrictions for innate spellcasting e.g. (self only) but I forgot about the prepared * thing. Will fix in the next version.
Lucian H. said: Shadowspawn said: Most probably a pie in the sky wish list item however since you are talking about JSON. For those of us who are not super savy with how the JSON is formatted is there a possibility of getting the format, maybe even a complete template that we can use to add to the current JSON entries for home brewed monsters and spells? So at the moment this isn't super easy because the JSON needs to get compiled up by a gulp script in order to be used by the main script. I'll give some thought about how we can make this a bit more user-friendly. Better answer than I was expecting. Thanks!
I may have found another issue. Just tried a Goblin Boss and his Reaction ability did not import. Same issue with Hobgoblin Warlord and Kuo-Toa. Reactions not importing.
1459612230
Lucian
Pro
API Scripter
Robert said: I may have found another issue. Just tried a Goblin Boss and his Reaction ability did not import. Same issue with Hobgoblin Warlord and Kuo-Toa. Reactions not importing. That's because the reactions are not in the JSON. No idea why not. Will put it on the list - thanks for the feedback!
1459612275
Lucian
Pro
API Scripter
In the meantime if you're keen to get on with it, you could always use the statblock import for these monsters - but I guess it doesn't take long to type in the reaction by hand as well...
Well, just counted, theres only 17 monsters in the MM with a reaction. Not a huge deal.
1459613718
Lucian
Pro
API Scripter
Yeah, it's not many, but it should work. Otherwise I'll just end up answering the same question over and over -  the best defence against having to do user support is to make your code behave in an unsurprising fashion :-P
Weird, after a bit, script seems to not respond to commands to import monsters. Tried to reload it, etc, to no avail.
1459619536

Edited 1459619570
Lucian
Pro
API Scripter
Robert said: Weird, after a bit, script seems to not respond to commands to import monsters. Tried to reload it, etc, to no avail. Hmmm. I thought I saw something like that earlier, but then it went away. Reloading the whole campaign generally fixes it. I wonder if (a) there's a situation in which the script runs away with itself in an infinite loop - that can produce this behaviour or (b) there's something more generally wrong with the Roll20 API today. I will try and investigate further.
1459619580
Kryx
Pro
Sheet Author
API Scripter
I had that happen sometimes on the old script - mainly rolling for HP. No idea what caused it.
1459619707
Lucian
Pro
API Scripter
Urgh. I guess that probably means it's a roll20 bug, but perhaps there are specific triggers for it that can be avoided. I mean, it's not like I've got anything better to do with the next 10 hours of my life or anything :-)
Tried again, deleted scripts, waited a bit, added them back. Script still won't accept commands.
1459623107
Lucian
Pro
API Scripter
@Robert Have you tried shutting all your browser windows that have the campaign open, as well as all the API script pages, waiting a bit, and then trying again? You need to make sure that the API sandbox completely spins down, which means closing *everything* down (and being sure that no one else is connected to your campaign either). Failing that, you may have to report a bug to Roll20 - a script shouldn't be able to put the campaign into that state even if it is broken!
Ya, Ill try again though. Deleted scripts, closed all windows. Will wait for a bit.
Well, still not working. I will file a bug report.
1459643505
Lucian
Pro
API Scripter
Ok, so I've been trying to make !shaped-import-monster --all work. The good news is that in doing so I've tidied up the overwriting/replacing behaviour and made it a bit more helpful (will document tomorrow, but there are options to replace characters by name now for those of you that want to do lots of imports at once). The bad news is that I don't think --all is going to be a viable option. I will debug a little more tomorrow, but initial testing suggests that even 50 at once gives Roll20 a bit of an aneurysm, and the full 558 just kills the API completely, with no error message. There's a possibility that I could try doing something horrific with setTimeout to dribble them in, but I suspect that the bottom line is that Roll20 just isn't built to handle this sort of thing. I'll spend a little more time on it, but failing that I want to move on to adding features that will have wider use for people rather than getting bogged down in this. 
1459644830

Edited 1459644844
Lucian
Pro
API Scripter
Ok, so I spoke too soon. The horrific setTimeout hack does actually work, and I now have a campaign with a *lot* of monsters in it :-) I confess I'm still mystified at quite why you crazy people really want to import everything all at once, but never mind :-) Anyway, its 3am now, so I think I'll wait until tomorrow before I think about pushing this code live.... watch this space.
Great work!  This is amazing.  One question though... how do i set the default on import to not show the target ac of an attack?  This isn't working for me, and I don't want target AC readily accessible to the PCs anyway.  I assume that I need to set the config of the newCharSettings to false for that but I can't figure out the code to do so.  Thanks in advance for your assistance... Also,  I'm a roll20 noob, does anyone have a suggestion as to the quickest way to add tokens and images for the NPCs, other than manually opening every sheet?
Burton B. said: Great work!  This is amazing.  One question though... how do i set the default on import to not show the target ac of an attack?  This isn't working for me, and I don't want target AC readily accessible to the PCs anyway.  I assume that I need to set the config of the newCharSettings to false for that but I can't figure out the code to do so.  Thanks in advance for your assistance... Also,  I'm a roll20 noob, does anyone have a suggestion as to the quickest way to add tokens and images for the NPCs, other than manually opening every sheet? You will type: !shaped-config --newCharSettings.showTargetAC false I have created a config GUI for the script. I pushed the code to Lucian and he has already picked it up. You should see it soon. That will make the config options much easier to work with.
1459657390

Edited 1459657525
Anybody having any success using  !shaped-import-monster --overwrite to overwrite existing monsters? Edit: Nevermind. Figured out you have to use  !shaped-import-monster --MONSTER NAME --overwrite
1459659386

Edited 1459703299
Brunhine
API Scripter
Burton B. said:  Also,  I'm a roll20 noob, does anyone have a suggestion as to the quickest way to add tokens and images for the NPCs, other than manually opening every sheet? Here's my workflow. It's pretty quick. Honestly, typing the command and spelling the name properly are the longest parts! I didn't show it here, but don't forget to open the sheet and click the "import" button before trying to use the npc.  (click the picture to play)
Brunhine,     Thanks for your help on both accounts.  That should speeds things up quite a bit for me.  Cheers.