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

@Brunhine: I can't take credit for this macro. It was created by someone else for use with the original importer script. I updated it to work with this one though. It'll bring up a query.  All you have to do is start typing the name of the monster you're looking for. !shaped-import-monster --?{Select Monster|Aarakocra|Aboleth|Abominable Yeti|Acolyte|Adult Black Dragon|Adult Blue Dracolich|Adult Blue Dragon|Adult Brass Dragon|Adult Bronze Dragon|Adult Copper Dragon|Adult Gold Dragon|Adult Green Dragon|Adult Red Dragon|Adult Silver Dragon|Adult White Dragon|Aerisi Kalinoth|Air Elemental|Air Elemental Myrmidon|Allosaurus|Ambush Drake|Ancient Black Dragon|Ancient Blue Dragon|Ancient Brass Dragon|Ancient Bronze Dragon|Ancient Copper Dragon|Ancient Gold Dragon|Ancient Green Dragon|Ancient Red Dragon|Ancient Silver Dragon|Ancient White Dragon|Androsphinx|Animated Armor|Ankheg|Ankylosaurus|Ape|Arcanaloth|Archmage|Assassin|Avatar of Death|Awakened Shrub|Awakened Tree|Awakened Zurkhwood|Axe Beak|Azbara Jos|Azer|Baboon|Badger|Balor|Bandit|Bandit Captain|Banshee|Baphomet|Barbed Devil|Barlgura|Basilisk|Bastian Thermandar|Bat|Bearded Devil|Behir|Beholder|Beholder Zombie|Berserker|Black Bear|Black Dragon Wyrmling|Black Earth Guard|Black Earth Priest|Black Pudding|Blagothkus|Blink Dog|Blood Hawk|Blue Dragon Wyrmling|Blue Slaad|Boar|Bone Devil|Bone Devil Polearm|Bone Naga (Guardian)|Bone Naga (Spirit)|Brass Dragon Wyrmling|Bridesmaid of Zuggtmoy|Bronze Dragon Wyrmling|Brown Bear|Bugbear|Bugbear Chief|Bulette|Bullywug|Burrowshark|Cambion|Camel|Captain Othelstan|Carrion Crawler|Cat|Cave Bear|Centaur|Chain Devil|Chamberlain of Zuggtmoy|Chasme|Chimera|Chuul|Chuul Spore Servant|Clay Golem|Cloaker|Cloud Giant|Cockatrice|Commoner|Constrictor Snake|Copper Dragon Wyrmling|Couatl|Crab|Crawling Claw|Crocodile|Crushing Wave Priest|Crushing Wave Reaver|Cult Fanatic|Cultist|Cyclops|Dao|Dark Tide Knight|Darkmantle|Death Dog|Death Knight|Death Slaad|Death Tyrant|Deep Gnome (Svirfneblin)|Deer|Demilich|Demogorgon|Derro|Derro Savant|Deva|Dire Wolf|Displacer Beast|Djinni|Doppelganger|Draft Horse|Dragon Turtle|Dragonclaw|Dragonfang|Dragonsoul|Dragonwing|Dralmorrer Borngray|Drannin Splithelm|Dretch|Drider|Drider Spellcaster|Droki|Drow|Drow Elite Warrior|Drow Mage|Drow Priestess of Lolth|Drow Spore Servant|Druid|Dryad|Duergar|Duergar Darkhaft|Duergar Kavalrachni|Duergar Keeper of the Flame|Duergar Soulblade|Duergar Spore Servant|Duergar Stone Guard|Duergar Xarron|Duodrone|Dust Mephit|Eagle|Earth Elemental|Earth Elemental Myrmidon|Efreeti|Elephant|Elizar Dryflagon|Elk|Empyrean|Erinyes|Eternal Flame Guardian|Eternal Flame Priest|Ettercap|Ettin|Evil Mage|Faerie Dragon (Blue)|Faerie Dragon (Green)|Faerie Dragon (Indigo)|Faerie Dragon (Orange)|Faerie Dragon (Red)|Faerie Dragon (Violet)|Faerie Dragon (Yellow)|Fathomer|Feathergale Knight|Female Steeder|Fire Elemental|Fire Elemental Myrmidon|Fire Giant|Fire Snake|Flameskull|Flamewrath|Flesh Golem|Flumph|Flying Snake|Flying Sword|Fomorian|Fraz-Urb'luu|Frog|Frost Giant|Frulam Mondath|Galeb Duhr|Gar Shatterkeel|Gargoyle|Gas Spore|Gelatinous Cube|Ghald|Ghast|Ghost|Ghoul|Giant Ape|Giant Badger|Giant Bat|Giant Boar|Giant Centipede|Giant Constrictor Snake|Giant Crab|Giant Crocodile|Giant Eagle|Giant Elk|Giant Fire Beetle|Giant Fly|Giant Frog|Giant Goat|Giant Hyena|Giant Lizard|Giant Octopus|Giant Owl|Giant Poisonous Snake|Giant Rat|Giant Rat (Diseased)|Giant Scorpion|Giant Sea Horse|Giant Shark|Giant Spider|Giant Toad|Giant Vulture|Giant Wasp|Giant Weasel|Giant Wolf Spider|Gibbering Mouther|Githyanki Knight|Githyanki Warrior|Githzerai Monk|Githzerai Zerth|Glabrezu|Gladiator|Gnoll|Gnoll Fang of Yeenoghu|Gnoll Pack Lord|Goat|Goblin|Goblin Boss|Gold Dragon Wyrmling|Gorgon|Goristro|Gray Ooze|Gray Ooze (Psychic)|Gray Slaad|Graz'zt|Green Dragon Wyrmling|Green Hag|Green Slaad|Grell|Grick|Grick Alpha|Griffon|Grimlock|Grisha|Guard|Guard Drake|Guardian Naga|Gynosphinx|Half-Ogre (Ogrillon)|Half-Red Dragon Veteran|Harpy|Hawk|Hell Hound|Hellenrae|Helmed Horror|Hezrou|Hill Giant|Hippogriff|Hobgoblin|Hobgoblin Captain|Hobgoblin Warlord|Homunculus|Hook Horror|Hook Horror Spore Servant|Horned Devil|Howling Hatred Initiate|Howling Hatred Priest|Hunter Shark|Hurricane|Hydra|Hyena|Ice Devil|Ice Devil Spear|Ice Mephit|Ice Toad|Imix|Imp|Intellect Devourer|Invisible Stalker|Iron Golem|Ixitxachitl|Ixitxachitl Cleric|Jackal|Jackalwere|Jamna Gleamsilver|Juiblex|Kenku|Killer Whale|Knight|Kobold|Kraken|Kuo-Toa|Kuo-Toa Archpriest|Kuo-Toa Monitor|Kuo-Toa Whip|Lamia|Langdedrosa Cyanwrath|Lemure|Lich|Lion|Lizard|Lizard King/Queen|Lizardfolk|Lizardfolk Shaman|Mage|Magma Mephit|Magmin|Male Steeder|Mammoth|Manes|Manticore|Marid|Marilith|Marlos Urnrayle|Mastiff|Medusa|Merfolk|Merrow|Mezzoloth|Mimic|Mind Flayer|Mind Flayer Arcanist|Minotaur|Minotaur Skeleton|Miraj Vizann|Monodrone|Mormesk the Wraith|Mud Mephit|Mule|Mummy|Mummy Lord|Myconid Adult|Myconid Sovereign|Myconid Sprout|Naergoth Bladelord|Nalfeshnee|Narrak|Needle Blight|Neronvain|Nezznar the Black Spider|Night Hag|Nightmare|Noble|Nothic|Nycaloth|Ochre Jelly|Octopus|Ogre|Ogre Zombie|Ogremoch|Olhydra|One-Eyed Shiver|Oni|Orc|Orc Eye of Gruumsh|Orc War Chief|Orcus|Oreioth|Orog|Otyugh|Owl|Owlbear|Panther|Pegasus|Pentadrone|Peryton|Pharblex Spattergoo|Phase Spider|Piercer|Pit Fiend|Pixie|Planetar|Plesiosaurus|Poisonous Snake|Polar Bear|Poltergeist|Pony|Priest|Pseudodragon|Pteranodon|Purple Worm|Quadrone|Quaggoth|Quaggoth Spore Servant|Quaggoth Thonot|Quasit|Quipper|Rakshasa|Rat|Rath Modar|Raven|Razerblast|Red Dragon Wyrmling|Red Slaad|Redbrand Ruffian|Reef Shark|Remorhaz|Revenant|Rezmir|Rhinoceros|Riding Horse|Roc|Roper|Rug of Smothering|Rust Monster|Saber-Toothed Tiger|Sacred Stone Monk|Sahuagin|Sahuagin Baron|Sahuagin Priestess|Salamander|Satyr|Scarecrow|Scorpion|Scout|Sea Hag|Sea Horse|Severin|Shadow|Shadow Demon|Shambling Mound|Shield Guardian|Shoalar Quanderil|Shrieker|Sildar Hallwinter|Silver Dragon Wyrmling|Skeleton|Skyweaver|Slaad Tadpole|Smoke Mephit|Solar|Spectator|Specter|Spider|Spined Devil|Spirit Naga|Sprite|Spy|Steam Mephit|Stirge|Stone Giant|Stone Golem|Stonemelder|Storm Giant|Succubus/Incubus|Swarm of Bats|Swarm of Beetles|Swarm of Centipedes|Swarm of Insects|Swarm of Poisonous Snakes|Swarm of Quippers|Swarm of Rats|Swarm of Ravens|Swarm of Spiders|Swarm of Wasps|Talis the White|Tarrasque|The Pudding King|Thri-kreen|Thri-kreen (Psionic)|Thug|Thurl Merosska|Tiamat|Tiger|Treant|Tribal Warrior|Triceratops|Tridrone|Troglodyte|Troglodyte Champion of Laogzed|Troll|Twig Blight|Tyrannosaurus Rex|Ultroloth|Umber Hulk|Unicorn|Vampire|Vampire Spawn|Vampire Spellcaster|Vampire Warrior|Vampiric Ixitxachitl|Vampiric Ixitxachitl Cleric|Vanifer|Veteran|Vine Blight|Violet Fungus|Vrock|Vulture|Warhorse|Warhorse Skeleton|Water Elemental|Water Elemental Myrmidon|Water Weird|Weasel|Werebear|Wereboar|Wererat|Weretiger|Werewolf|White Dragon Wyrmling|Wiggan Nettlebee|Wight|Will-o'-Wisp|Windharrow|Winged Kobold|Winter Wolf|Wolf|Worg|Wraith|Wyvern|Xorn|Yan-C-Bin|Yeenoghu|Yestabrod|Yeti|Yochlol|Young Black Dragon|Young Blue Dragon|Young Brass Dragon|Young Bronze Dragon|Young Copper Dragon|Young Gold Dragon|Young Green Dragon|Young Red Dragon|Young Red Shadow Dragon|Young Remorhaz|Young Silver Dragon|Young White Dragon|Yuan-ti Abomination|Yuan-ti Malison Type 1|Yuan-ti Malison Type 2|Yuan-ti Malison Type 3|Yuan-ti Pureblood|Zombie|Zuggtmoy}
@Kaelev: I like this... I might have an idea for this actually... great, now I'm getting no sleep.... Thanks!
1459671657
Kryx
Pro
Sheet Author
API Scripter
I believe having more sheets in a campaign makes it significantly more laggy. I would not recommend importing near 600 sheets. showTargetAC is off by default, right?
1459671806
Lucian
Pro
API Scripter
Kryx said: I believe having more sheets in a campaign makes it significantly more laggy. I would not recommend importing near 600 sheets. showTargetAC is off by default, right? <whistles nonchalantly whilst quietly adjusting the defaults to a more sensible value> And yes, --all seems batty to me as well, but apparently people wanted it.
Lol. I get it I get it. Perhaps it wasnt smart to want to import everything..... 
1459677381
Lucian
Pro
API Scripter
Version 0.4: Brunhine's Config UI (Thanks!), --all import (use with extreme caution!), modified replace/overwrite behaviour Brunhine has written a simple UI to help people struggling with my techy CLI for changing configuration options. If you run !shaped-config on its own it will be displayed, and it is displayed after you set each config option !shaped-import-monster now supports a --all option. USE WITH EXTREME CAUTION. This will import every monster that you have defined in the JSON files into your campaign - that could easily be hundreds of new characters. It will take a long time, and will go in batches of 20 to avoid crashing the API. !shaped-import-monster and !shaped-import-statblock will now look for characters with the same name as the one being imported and fail if one is already present. This avoids the accidental creation of duplicates. If you want to replace an existing character, you should pass the new --replace option !shaped-import-monster now allows you to import multiple monsters with a token selected. In this case it will set the avatar of the created/updated characters to be that of the selected token, but won't set the token to represent any of the characters If you have a linked token selected and you run !shaped-import-statblock,  or  !shaped-import-monster  with a single monster listed on the command line, it will fail unless you specify --overwrite. If you do specify --overwrite, it will overwrite the existing linked token with the newly imported character. Note that the difference between --overwrite and --replace is that overwrite  will only overwrite a linked token - it will not replace characters by name. --replace is quite aggressive, and you are advised to use it with caution - it has the potential to overwrite a lot of information, particularly when used to import multiple monsters at once. Using it with --all  is VERY DANGEROUS . You have been warned! It sounds a bit complicated, but hopefully this should actually be a bit more intuitive in practice. Let me know if you have any problems.
1459677759
Lucian
Pro
API Scripter
Rick V. said: Lol. I get it I get it. Perhaps it wasnt smart to want to import everything.....  Well, it's written now, you've got to use it whether you like it or not :-P
For !shape-config commands, do we need to run them on each monster we import or is it a one time thing?
Kaelev said: For !shape-config commands, do we need to run them on each monster we import or is it a one time thing? The config commands set the default value for any new character sheet, which means it should set these values for any monster imported.
Kaelev said: For !shape-config commands, do we need to run them on each monster we import or is it a one time thing? They are a one time thing.   All of the "new character" options are applied to every new character sheet you create, and all "token" options are applied to the token you have selected when you import stats and associate to a character sheet. 
JSON formatter for Curse of Strahd Monsters for Monster Importer:  Anyone have any cool tools/excel formatting to take a stat block and turn it into a JSON formatted file? I was going to start working on putting together the Curse of Strahd Monsters, for personal use of course. Let me know... Thanks.
1459705976
Lucian
Pro
API Scripter
Greg B. said: JSON formatter for Curse of Strahd Monsters for Monster Importer:  Anyone have any cool tools/excel formatting to take a stat block and turn it into a JSON formatted file? I was going to start working on putting together the Curse of Strahd Monsters, for personal use of course. Let me know... Thanks. Actually, anyone who can get npm and gulp set up on their machine can do this using the test framework of the script. If you stick .txt files in the test/data directory and run 'gulp test' it will create corresponding .json files in the same directory. It would be trivial to stitch them together into one file afterward.
1459708093

Edited 1459708559
I actually just created an excel sheet with the formatting, but I have some questions and need someone to check the JSON output.  I created it for custom monsters and so I have something to use that doesn't require any installation or Internet.  I personally don't mind typing stuff in; I hate copying and pasting stat blocks because of all the parsing that has to be done. 
1459709629

Edited 1459709674
Lucian
Pro
API Scripter
Version 0.4.1 - Fixed archmage * spells (but JSON files are still wrong - these should be updated soon) Version 0.4.2 - Custom JSON/JS support for adding new monsters and spells To add new monsters or spells, you need to create a JSON file that matches the samples in the github project - look at resources/srdSample.json for an example of the monster JSON. There are lots of examples of the spell JSON kicking around as well - PM me if you have trouble finding them. Once you have a JSON that you are happy with, you need to register it with the script by creating a new API script with the following contents: on('ready', function() { ShapedScripts.addMonsters(PASTE YOUR JSON HERE); }); You can substitute 'addSpells' if you are adding spells. Please note that your JSON needs to include a version number like the existing samples, i.e.: { "version": "0.1.1", "monsters": [ //Monster objects go here ] } The current format versions are 0.1.1 for monsters and 0.1.2 for spells. I'm looking at introducing some validation that will provide more helpful feedback if you get things wrong in your JSON.
Lucian H. said: Rick V. said: Lol. I get it I get it. Perhaps it wasnt smart to want to import everything.....  Well, it's written now, you've got to use it whether you like it or not :-P Ooohh kay... I will.. :D
Found another spell import issue: mephit innate spellcasting. Each have one spell but it's not formatted the same as other instances of innate spellcasting. Easy to fix on the user end though, since it's just one spell. Another random thing I noticed is that a very small minority of creature's attacks don't import. Examples: the Balor and the Spine Devil.
Hmm the --all does nothing in my game.
1459713329

Edited 1459713368
Lucian
Pro
API Scripter
Rick V. said: Hmm the --all does nothing in my game. Hi Rick, What's the exact command you are runnning? Do you get any log output? Oh - and what version of the script are you on (it gets printed in the log if you're in doubt) Lucian
It gives back version 4.1. Got it just from Github. !shaped-import-monster --all --replace and tried !shaped-import-monster --replace --all
1459713761
Lucian
Pro
API Scripter
What log output do you get from the API?
Nothing. Not even en error in chat.
1459713947
Lucian
Pro
API Scripter
Could you try turn on TRACE level logging (use the config UI) and see what logging it gives you?
1459713974
Lucian
Pro
API Scripter
Oh - and make sure to resave the script after you turn on TRACE logging to restart the API
1459714202

Edited 1459714359
Getting this error when trying to use the auto ammo on an existing character. This issue goes away with creating a new character sheet. "ShapedScripts 1459714147547 ERROR : TypeError: Cannot call method 'get' of undefined\n at Object.shapedModule.checkForAmmoUpdate (evalmachine.:2387:46)\n at Object.checkForAmmoUpdate (evalmachine.:1290:36)\n at Object.shapedModule.handleInput (evalmachine.:1742:27)\n at Object.handleInput (evalmachine.:1290:36)\n at eval (eval at (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), :65:16)\n at Object.publish (eval at (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), :70:8)\n at eval (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28), :1143:12)\n at /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560\n at hc (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)\n at Kd (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)"
"ShapedScripts 1459714166596 TRACE : shapedModule.checkInstall ending with return value undefined" "ShapedScripts 1459714166596 TRACE : shapedModule.registerEventHandlers starting with this value: {\"configOptionsSpec\":{\"tokenSettings\":{\"bar1\":{},\"bar2\":{},\"bar3\":{}},\"newCharSettings\":{},\"genderPronouns\":[{}]},\"configUI\":{\"generalOptions\":{},\"tokenOptions\":{},\"newCharOptions\":{}}} and args {}" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"chat:message\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"add:token\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166598 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"change:token\"}" "ShapedScripts 1459714166598 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166600 TRACE : shapedModule.registerEventHandlers ending with return value undefined"
1459714478
Lucian
Pro
API Scripter
Peter P. said: Getting this error when trying to use the auto ammo on an existing character. This issue goes away with creating a new character sheet. "ShapedScripts 1459714147547 ERROR : TypeError: Cannot call method 'get' of undefined\n at Object.shapedModule.checkForAmmoUpdate (evalmachine.:2387:46)\n at Object.checkForAmmoUpdate (evalmachine.:1290:36)\n at Object.shapedModule.handleInput (evalmachine.:1742:27)\n at Object.handleInput (evalmachine.:1290:36)\n at eval (eval at (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), :65:16)\n at Object.publish (eval at (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28)), :70:8)\n at eval (eval at (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:77:28), :1143:12)\n at /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560\n at hc (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)\n at Kd (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)" That's not a very helpful error - I need a better guard in there - but I think this means it can't find the ammo entry that corresponds to what you've entered for the attack - make sure that there is an ammo entry with the appropriate name and that you've entered a value in the quantity field for this ammo entry.  I will make it provide a more helpful error in future.
1459714562
Lucian
Pro
API Scripter
Rick V. said: "ShapedScripts 1459714166596 TRACE : shapedModule.checkInstall ending with return value undefined" "ShapedScripts 1459714166596 TRACE : shapedModule.registerEventHandlers starting with this value: {\"configOptionsSpec\":{\"tokenSettings\":{\"bar1\":{},\"bar2\":{},\"bar3\":{}},\"newCharSettings\":{},\"genderPronouns\":[{}]},\"configUI\":{\"generalOptions\":{},\"tokenOptions\":{},\"newCharOptions\":{}}} and args {}" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"chat:message\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"add:token\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166598 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"change:token\"}" "ShapedScripts 1459714166598 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166600 TRACE : shapedModule.registerEventHandlers ending with return value undefined" Hi Rick, Have you got the monster and spell files installed? Do you not get anything else in the log after you run !shaped-import-monster --all ? Lucian
Lucian H. said: Rick V. said: "ShapedScripts 1459714166596 TRACE : shapedModule.checkInstall ending with return value undefined" "ShapedScripts 1459714166596 TRACE : shapedModule.registerEventHandlers starting with this value: {\"configOptionsSpec\":{\"tokenSettings\":{\"bar1\":{},\"bar2\":{},\"bar3\":{}},\"newCharSettings\":{},\"genderPronouns\":[{}]},\"configUI\":{\"generalOptions\":{},\"tokenOptions\":{},\"newCharOptions\":{}}} and args {}" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"chat:message\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"add:token\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166598 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"change:token\"}" "ShapedScripts 1459714166598 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166600 TRACE : shapedModule.registerEventHandlers ending with return value undefined" Hi Rick, Have you got the monster and spell files installed? Do you not get anything else in the log after you run !shaped-import-monster --all ? Lucian Yeah I now get output. Mostly that it can't make it and asks if I meant to use --replace?
1459714801
Lucian
Pro
API Scripter
Could you send me a campaign invite so I can have a look?
It decrements in the roll, but not on the sheet, I had to make another character sheet for it to effect the field.
Couldn't be happier at the moment.  This has made campaign set up so much easier... One small snag I ran into while importing deep gnome.  To import Deep Gnome  you have to type !shaped-import-monster  --Deep Gnome (Svirfneblin).  I had to go to the code to find out that the (Svirfneblin) was there.  Might hang some people up.
Rick V. said: Lucian H. said: Rick V. said: "ShapedScripts 1459714166596 TRACE : shapedModule.checkInstall ending with return value undefined" "ShapedScripts 1459714166596 TRACE : shapedModule.registerEventHandlers starting with this value: {\"configOptionsSpec\":{\"tokenSettings\":{\"bar1\":{},\"bar2\":{},\"bar3\":{}},\"newCharSettings\":{},\"genderPronouns\":[{}]},\"configUI\":{\"generalOptions\":{},\"tokenOptions\":{},\"newCharOptions\":{}}} and args {}" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"chat:message\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166597 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"add:token\"}" "ShapedScripts 1459714166597 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166598 TRACE :   roll20.on starting with this value: {} and args {\"0\":\"change:token\"}" "ShapedScripts 1459714166598 TRACE :   roll20.on ending with return value undefined" "ShapedScripts 1459714166600 TRACE : shapedModule.registerEventHandlers ending with return value undefined" Hi Rick, Have you got the monster and spell files installed? Do you not get anything else in the log after you run !shaped-import-monster --all ? Lucian Yeah I now get output. Mostly that it can't make it and asks if I meant to use --replace? I had an error similar to this... If i was trying to --replace a sheet that i had already --replaced before it wouldn't let me.  It kept popping up the error asking if i meant to replace an existing character. Maybe a similar issue for you.
Burton B. said: Couldn't be happier at the moment.  This has made campaign set up so much easier... One small snag I ran into while importing deep gnome.  To import Deep Gnome  you have to type !shaped-import-monster  --Deep Gnome (Svirfneblin).  I had to go to the code to find out that the (Svirfneblin) was there.  Might hang some people up. I pushed Lucian a feature just now that should make the importing a bit easier for weird cases / tough spellings like that. expect to see it soon hopefully.
Just had another case where the script import function stopped working on a campaign. It happened when I was clicking import on a character sheet. My suggestions to folks importing large amounts of npcs: 1. After setting up the settings, !shaped-import-monster everything but don't use the --all function.  Instead, pre set up a text file to input them in batches that align to a folder tree structure. Do not click import on the character sheets yet since that is what caused the script to crap out on me twice. 2. Put the stuff in the aforementioned folder tree. It runs fine when it's in folders. No slow down with about 12 or so to a folder or subfolder. 3. When everything is set up in folders, make a back up. You can transmorgify stuff in with it later if !shaped-import-monster craps out. 4. Now go to each sheet and click import.
1459756027
Lucian
Pro
API Scripter
Robert said: Just had another case where the script import function stopped working on a campaign. It happened when I was clicking import on a character sheet. My suggestions to folks importing large amounts of npcs: 1. After setting up the settings, !shaped-import-monster everything but don't use the --all function.  Instead, pre set up a text file to input them in batches that align to a folder tree structure. Do not click import on the character sheets yet since that is what caused the script to crap out on me twice. 2. Put the stuff in the aforementioned folder tree. It runs fine when it's in folders. No slow down with about 12 or so to a folder or subfolder. 3. When everything is set up in folders, make a back up. You can transmorgify stuff in with it later if !shaped-import-monster craps out. 4. Now go to each sheet and click import. Yeah, this is kind of frustrating. I've seen it happen occasionally. There appear to be two related problems: You can kill the API server with the script itself - especially with --all - and it just stops responding to commands. This is almost impossible to debug because I get no warning, no output and no access to object/memory dumps to see what's going on. If you put the API into an infinite loop, you get this behaviour. Log output is only sent once each command completes, so it looks like nothing is happening. Now, as far as I am aware, there's nothing in the monster import that could get into an infinite loop, and if this was the problem, I would expect it to be reliably repeatable but I will recheck the code to be sure. The only other thing I can think is that  perhaps I'm leaking objects somewhere along the line and repeated imports are eventually exhausting the memory of whatever VM/sandbox the thing runs under. I would have expect to see some sort of error message (you certainly get one if you overflow the stack, for example), but I guess it's possible that it just slowly sulks and dies instead. There are a couple of things I can do to try and reduce the memory footprint of the script, and I can do some analysis to look for possible object leaks as well, but without the right tools it's really just stabbing in the dark. It also seems possible to kill the client. Sending *lots* of chat messages at once to the client locks it up hard, for example. I've also noticed that deleting a creature with lots of attributes (e.g. Lich with lots of spells) can take a long time. I believe that there's a bug where deleting attributes is triggering sheet workers incorrectly, so --replace may be stressing the client more than it needs to. When importing big creatures I'm sure you've all noticed how long the sheetworkers take to complete the import. It wouldn't at all  surprise me if the Roll20 client has object leaks and slowly dies if you do too much with it. There's not a lot I can do about this. I guess Kryx could take a look at the sheetworkers and see if he can streamline any of them, but I suspect that most of the problem lies on the Roll20 side :-(
1459756277
Kryx
Pro
Sheet Author
API Scripter
@Lucian: Why did you setup each spell as an option with --? For example: " !shaped-import-spell --Fireball --Cure Wounds " Why not a comma separated list like " !shaped-import-spell --Fireball, Cure Wounds ". That would make it much easier to copy + paste from the monster manual or another source. Plus I think an array type syntax makes more sense.
1459757280
Lucian
Pro
API Scripter
Kryx said: @Lucian: Why did you setup each spell as an option with --? For example: " !shaped-import-spell --Fireball --Cure Wounds " Why not a comma separated list like " !shaped-import-spell --Fireball, Cure Wounds ". That would make it much easier to copy + paste from the monster manual or another source. Plus I think an array type syntax makes more sense. I have a generic command parser that recognises anything that starts with -- as an option. I then have an option handler registered with it that attempts to parse otherwise unrecognised options by comparing them with the spell list, so this made it simpler. I guess there's no reason why I couldn't have it split each option on ',' as well. I'll look at it when I've finished what I'm currently working on. As to making more sense... well there are a lot of GNU CLI utilities that work this way, so I'm not sure I'm completely out there. At least I didn't make you do " !shaped-import --spell:Fireball --spell:Cure Wounds "  :-P Cheers,
1459791801
Lucian
Pro
API Scripter
Version 0.4.3:   More JSON improvements + Brunhine's Entity Picker Requires updated JSON files! So, for all you would-be house-rulers and customisers, I've made the JSON loading process a little more robust and a little more friendly. When you import monsters it now validates them on load and reports errors. There have been some changes to the format and also to the API for adding them: The format is now self-describing and requires a version number: {  "version":"0.2",  "monsters": [ {....} ] } To add files you now call a single method: ShapedScripts.addEntities(JSON GOES HERE); in an on('ready') handler as described in my previous posting.  There are new versions of the example files available that use this new system If your JSON file has an additional top-level property "patch":true , it will be treated as a patch to existing information: It will amend a spell/monster that exists with the same name Properties in the patch file will overwrite those in the existing spell or monster Properties not specified in the patch file will remain the same You can change the name of a monster/spell by including a "newName" property in the patch object You can remove a spell/monster entirely by including a single property "remove":true in the patch object The monster JSON is validated and will display errors in chat if there are problems. Spells are not yet validated but probably will be soon Brunhine has kindly added another piece of UI to the script. If you call !shaped-import-monster or !shaped-import-spell with no parameters, it will display a button that allows you to launch a roll query with a list of all available monsters/spells - useful for those hard-to-type monsters or when you can't find quite the right form of the name
This is frustrating.  I've done the repeating field, and I'm still getting the error. One character sheet works, while others don't.
1459800538
Lucian
Pro
API Scripter
Hey Peter, There's a new version of the script that has slightly better logging in this area. Could you update (you will also need the latest JSON files as well, sorry) and see if you get anything more helpful in the logs so we can try and resolve this? Thanks,
1459801920

Edited 1459803663
Lucian H. said: Hey Peter, There's a new version of the script that has slightly better logging in this area. Could you update (you will also need the latest JSON files as well, sorry) and see if you get anything more helpful in the logs so we can try and resolve this? Thanks, Alright, with the new version, It's stating "ShapedScripts 1459801389004 ERROR : No ammo attribute found corresponding to name Arrows" How would I solve this. It's odd that it's working for one character, but not others. I've tried to compare the two attributes, but I don't see any differences. Note, I don't have the JSON, as by the script's description, it's not necessary,  as I don't need the spells or monsters.
1459804145
Lucian
Pro
API Scripter
Hi Peter, Ok, that's progress. Next step: add the following as a new script to your campaign: on('chat:message', function(msg){     if(msg.content === '!dumpChar') {         var characterId = getObj('graphic', msg.selected[0]._id).get('represents');         log(findObjs({type:'attribute', characterid:characterId}));     } }); Then select a token that represents the broken character and run !dumpChar from the chat window. Go back to the API log, and find the line that has the list of attributes. It will be very long and look something like this: [{"name":"strength","current":"10","max":"","_id":"-K9wwmJWAlcrM01cpHir","_type":"attribute","_characterid":"-K9wwhAhpV2M7FO5ctpy"},{"name":"strength_mod","current":0,"max":"","_id":"-K9wwmJcKS9mUeOsttRs","_type":"attribute","_characterid":"-K9wwhAhpV2M7FO5ctpy"},{"name":"dexterity","current":"16","max":"","_id":"-K9wwmJiP7bhzMMm2-gQ","_type":"attribute","_characterid":"-K9wwhAhpV2M7FO5ctpy"},{"name":"dexterity_mod","current":3,"max":"","_id":"-K9wwmJtE_FYW9DEFqL9","_type":"attribute","_characterid":"-K9wwhAhpV2M7FO5ctpy"},....... Could you PM me that line? With that hopefully I'll be able to solve the problem. Failing that I might not you to invite me as a GM in your campaign, but lets see how we get on with this first. Cheers, Lucian
1459804211
Lucian
Pro
API Scripter
PS You are right - the JSON is not necessary. I only mentioned it because if you were using it, upgrading the script requires you to upgrade the JSON.
So, good news, I just changed the token to represent the correct character. I had several copies of the same token so I hadn't kept up with it. and it seemed to have fixed the issue. It was probably using the sheet I first assigned to it, which is why it couldn't find the field.
1459808052
Lucian
Pro
API Scripter
Great! I'm glad that you've managed to get it sorted!
The all command just returns the query macro for me. :(
1459808495
Lucian
Pro
API Scripter
Saevar L. "Liquid-Sonic" said: The all command just returns the query macro for me. :( I'd strongly advise against using it anyway - I'm thinking of removing it. It will probably kill your API sandbox and will make your campaign very laggy afterwards. Importing nearly 600 monsters in one go is generally not a clever thing to do.
Lucian H. said: Saevar L. "Liquid-Sonic" said: The all command just returns the query macro for me. :( I'd strongly advise against using it anyway - I'm thinking of removing it. It will probably kill your API sandbox and will make your campaign very laggy afterwards. Importing nearly 600 monsters in one go is generally not a clever thing to do. Comment it out. with a note about removing the comment - if you do this... you are at fault. period  :D
Is there a place where I can find JSON files? I only saw a limited list in the test area, and googling didn't turn up anything for me, unfortunately. I'm assuming we just add the JSON file to our list of API scripts, correct?
1459814804
Lucian
Pro
API Scripter
Version 0.4.4: Automatic HD processing When you roll HD, it decrements them automatically, unless this would take you below zero, in which case it prints a warning in the chat. If it decrements the HD, it will also apply the rolled HP to your current HP total. Also, for Kryx, because I guess he deserves it: you can now pass monsters and spells as comma separated lists if you want to. It will try each parameter as a complete string first, in case anyone adds monsters with commas in the name, and if that doesn't match, it will split on commas and match like that. If somehow you end up with a spell or a monster with a comma in the name, be sure to use the full -- syntax to avoid ambiguity.