Advertisement Create a free account

[Script] D&D 5e Shaped NPC & Spell Importer

1428598778

Edited 1449566584
Kryx
Pro
Sheet Author
API Scripter
Download from GitHub Install: Be a mentor Create 3 API files in your campaign settings -> API scripts page. 5e-monsters, 5e-spells, and 5e-scripts. Copy the script from github (open it in RAW) to 5e-scripts Click save In the Output console on the same page it should print out "Shaped Scripts ready" Enter data for monsters and spells as outlined below. See github for examples. Save both files Select a token Run a command like "!shaped-spell --fireball" or "!shaped-spell --fireball, magic missile". Or import commands like "!shaped-monster --goblin". Example Monster file: fifthMonsters = {   monsters: [     {       "name": "Goblin",       "size": "Small",       "type": "humanoid (goblinoid)",       "alignment": "neutral evil",       "AC": "15 (leather armor, shield)",       "HP": "7 (2d6)",       "speed": "30 ft.",       "abilities": "STR 8 DEX 14 CON 10 INT 10 WIS 8 CHA 8",       "skills": "Stealth +6",       "senses": "darkvision 60 ft., passive Perception 9",       "languages": "Common, Goblin",       "challenge": "1/4",       "traits": [         "Nimble Escape. The goblin can take the Disengage or Hide action as a bonus action on each of its turns."       ],       "actions": [         "Scimitar. Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) slashing damage.",         "Shortbow. Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) piercing damage."       ]     }   ] }; Example spell file: fifthSpells = {   spells: [     {       "name": "Fireball",       "description": "A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.\nThe fire spreads around corners. It ignites flammable objects in the area that aren't being worn or carried.",       "higherLevel": "When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.",       "emote": "evokes a bright streak that flashes from {{GENDER_PRONOUN_HIS_HER}} pointing finger to a point and then blossoms with a low roar into an explosion of flame",       "source": "phb 241",       "range": "150 ft",       "target": "each creature in the aoe",       "aoe": "20 ft radius sphere centered on a point within range",       "components": {         "verbal": true,         "somatic": true,         "material": true,         "materialMaterial": "A tiny ball of bat guano and sulfur"       },       "duration": "Instantaneous",       "castingTime": "action",       "level": 3,       "school": "Evocation",       "save": {         "ability": "dexterity",         "damage": "8d6",         "damageType": "fire",         "saveSuccess": "half damage",         "higherLevelDice": "1",         "higherLevelDie": "d6"       },       "effects": "The fire spreads around corners. It ignites flammable objects in the area that aren't being worn or carried.",       "classes": [         "Cleric",         "Sorcerer",         "Warlock",         "Wizard"       ],       "domains": [         "Light"       ],       "patrons": [         "Fiend"       ]     }   ] }; Please let me know if you run into any issues. Please post the specific text you've used.
1428613703

Edited 1449566600
Kryx
Pro
Sheet Author
API Scripter
Importer: The importer will fix many many common errors. For example ldX will be converted to 1dX before parsing and spaces in many words will be removed ("slash ing" becomes "slashing". The list is ever expanding). Example Format: Fencer Medium beast, neutral Armor Class 8 (armor scraps) Hit Points 13 (2d8 + 4) Speed 30ft., burrow 20 ft., climb 80ft, fly 40ft. (hover), swim 150ft STR 10 (+0) DEX 14 (+2) CON 15 (+2) INT 6 (-2) WIS 8 (-1) CHA 5 (-3) Damage Resistances radiant Damage Vulnerabilities bludgeoning Damage Immunities poison Condition Immunities exhaustion, poisoned Senses blindsight 30ft. (blind beyond this radius), darkvision 60ft, tremorsense 20ft., truesight 5ft, passive Perception 9 Languages understands all languages it knew in life but can't speak Challenge 1/4 (50 XP) Actions Shortsword. Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) slashing damage. Shortbow. Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) bludgeoning damage. Javelin. Melee or Ranged Weapon Attack: +5 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 6 (1d6 + 3) acid damage. Bites. Melee Weapon Attack: +4 to hit, reach 0 ft., one creature in the swarm's space. Hit: 5 (2d4) piercing damage, or 2 (1d4) piercing damage if the swarm has half of its hit points or fewer. Snake Bites. Melee Weapon Attack: +6 to hit, reach 0 ft., one creature in the swarm's space. Hit: 7 (2d6) piercing damage, or 3 (1d6) piercing damage if the swarm has half of its hit points or fewer. The target must make a DC 10 Constitution saving throw, taking 14 (4d6) poison damage on a failed save, or half as much damage on a successful one. Poisoned Bite. Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 1 piercing damage, and the target must succeed on a DC 9 Constitution saving throw or take 2 (1d4) poison damage. Petrifying Gaze. If a creature starts its turn within 30 feet of the basilisk and the two of them can see each other, the basilisk can force the creature to make a DC 12 Constitution saving throw if the basilisk isn't incapacitated. On a failed save, the creature magically begins to turn to stone and is restrained. It must repeat the saving throw at the end of its next turn. On a success, the effect ends. On a failure, the creature is petrified until freed by the greater restoration spell or other magic. Tentacle. Melee Weapon Attack: +9 to hit, reach 10ft., one target. Hit: 12 (2d6 + 5) bludgeoning damage. If the target is a creature, it must succeed on a DC 14 Constitution saving throw or become diseased. The disease has no effect for 1 minute and can be removed by any magic that cures disease. After 1 minlilte, the diseased creature's skin becomes translucent and slimy, the creature can't regain hit points unless it is underwater, and the disease can be removed only by heal or another di sease-curing spell of 6th level or higher. When the creature is outside a body of water, it takes 6 (1d12) acid damage every 10 minutes unless moisture is applied to the skin before 10 minutes have passed. If I do not correctly parse the attack I put it into the effects area. Currently I parse all standard attack, damage, and saving throws. I need to do a lot more testing to ensure it works. Usage: See Install above Launch your campaign Open the token's properties and in the "GM Notes" section paste the creature's stat block from the MM Select the token In the chat type !shaped-import (or !build-monster or !shaped-parse) ("!shaped import --clean" will recreate the whole sheet) Wallah! (You'll see log details back on the API scripts page) v1.41 Multiattack supported. It is added as an ability. It references the normal actions and spits out the multiattack text. Legendary may work - I haven't tested it. I'm out of town for the weekend so I'll pick this up next week.
" The importer will fix many many common errors. For example ldX will be converted to 1dX before parsing and spaces in many words will be removed ("slash ing" becomes "slashing". The list is ever expanding)." Hold on, is this not better than the other importer? I don't remember it fixing that.
1428697660

Edited 1428698490
Kryx
Pro
Sheet Author
API Scripter
RMcD said: " The importer will fix many many common errors. For example ldX will be converted to 1dX before parsing and spaces in many words will be removed ("slash ing" becomes "slashing". The list is ever expanding)." Hold on, is this not better than the other importer? I don't remember it fixing that. Correct. This is a new feature that I found very helpful. Note: The other 5e importer is for the default sheet. This'll only work on the shaped sheet so they aren't competing with one another. I'd happily share this feature with JF. I'm also parsing the actions whereas the normal sheet doesn't.
1428705545

Edited 1428705883
Awesome, you do put a ton of effort into this stuff. 1. How does the RandomHP built into this work? Is it minimum a third, maximum anything, you can't hover over the number that appears when you drag it out. 2. It doesn't seem to be correctly converting the attacks. The attacks are still there on the Attributes&Abilities page but on the NPC's sheet under weapons or whatever they're not there. 3. The script posts no success message after conversion is complete, obviously I can look at the API page but it should say "Character Converted" or something. 4. The bars don't seem to be working for me either. The bars of my token remain the same before and after instead of changing to the NPC, etc thing. Edit: Okay I looked at the API which I don't do because I don't know how to program and it says that the random HP is set to average or higher, if it is set to average can it show both the average calculation and the roll when you pull it out. Also I don't think that's a good default, average or higher is literally just making the game harder where something like minimum 1/3, maximum 3/3 still makes it harder but allows for mobs to actually be weaker than average. Or you could do 1/4-3/4 range which changes no difficulty. ""set bars" "Setting bar1 to: id: -JlBmPieMStslrhYk-Ek current: undefined max: undefined" "Setting bar2 to: id: -JlBmPiDk9cwkVDj2MEt current: undefined max: undefined" "parsebar: HP" "Setting bar3 to: id: -Jm_SUSZJfyZ15fwHG5q current: 16 max: 16"" That's what I get for the API stuff. Edit 2: I definitely like the look of this character sheet and more importantly the amount of work you're doing in it, it moves a lot faster than the other one, but it's just the sunk cost of having done all of LMoP and all of my 10 PCs that I'd want to make as smooth a transition as possible to it when I do. To be fair it seems like it wouldn't take that long at the moment, there's only like 35 monsters, I'm just lazy.
1428736090
Kryx
Pro
Sheet Author
API Scripter
"Random" hp does indeed never take below average which does make the game harder. That is from JF's script. I'll make it take real average. Converting doesn't parse actions. Actions from the old parser are all cut up. I'll do some exploring to see if what is parsed from JF's script can be used otherwise I'll put in a command to just import the Actions (would require putting the Actions in gm notes) It does for import. Does it not for converting? I'll add it. I'll fix the bars. They were working for me when I checked, but I didn't extensively test. I understand not wanting to redo everything. Luckily PCs stay the same except armor. NPCs convert besides actions. If you have all the initial import data from JF's converter still in gm notes it's easier to just reimport. It will update the token. 35 isn't bad. I have over a hundred. :P Thanks for the feedback btw. I'll also port JF's 2.4 changes over.
For PCs it seems like Background in the bit with race, etc stuff, becomes the Background from the big box in Background and Race Info or whatever it's called in the normal character sheet I think they still have it being dumbly long. Since "Background" in the normal character sheet is not a tiny box most people put features and their backstory there, so it makes more sense to use Background Features to be that one, and the Background to be empty. Doesn't matter too much as it's a Crtl+X, Crtl+V job but when extrapolated over the thousands of character sheets that this might be converted from might be worth fixing. Also I would have assumed darkvision would be taken from the vision of the normal character sheet but Darkvision is empty and I have no idea where the vision box from the normal character sheet goes. Otherwise yeah, seems like PCs are super easy, awesome.
@Mark, finally got around to giving this a shot and I do like the form and feel of it for a PC, I like the condensed feel and such. From an NPC perspective though, having to dig through attacks, and spells if they aren't set as macros can be a bit encumbersome. Perhaps its just me but I would almost rather have a sep sheet, where the NPCs have their attacks on the first page and make you go digging for a skill on the second. For the couple monsters that I converted from the original NPC sheet it didn't bring the attacks in, and if the Represented/Name don't match it also fails, perhaps this is by design but it would create a bit of work for me to be able to fully convert as I save each token with the %%NUMBERED%% so if I turn on nameplates then its easier for the players to target etc. I use Aaron's script to randomly turn on a number for it. I'll make this suggestion to Aaron too but to overcome this if you could have each Token / or a Clone of the token generate a random COLOR symbol to make targeting easier if you got like 10 goblins or something, even having 2 blues/greens/yellows is better than having all monsters exactly the same or to have it generate a random token based on the table that its tied too etc.. Shrugs, I'm not sure how much work this would require but it would be awesome if you could have more than 1 sheet available for the players. So for those of us that like the Shaped can use it, without requiring everyone to also use it. Anyways great work, I look forward to seeing the improvments you've been working on.
1428784292

Edited 1428784481
Kryx
Pro
Sheet Author
API Scripter
Thanks for the feedback. I can make it a configurable option to have the "Actions" page be the default page in the import/convert script. That should accomplish what you desire, correct? (I need to allow setting the default of other settings options there as well) As mentioned in the script thread the attacks are not converted. There are a few issues here that the default script replaces a lot of default wording. I will try to undoubtedly that and convert the attacks, but I may have to create a command to just import attacks from the book from the gminfo area. Hopefully I can do the first. I agree that the numbered thing is cool and I want to incorporate it into my script, but it was kind of long. The only way I know of accessing a journal is through the name which is stored in the token name. If you know of a better way please do let me know. For now that name has to match. I'll see if I can come up with something. More than 1 sheet? Can you be more specific? Do you mean have some people use the default sheet and some the shaped sheet? Or other variations like the alternative sheet? Or something else? Campaigns can only use 1 sheet in campaign settings, but it is possible to have different views of sheets based on settings. I will likely work on alternative core sheets at some point if there is a desire
1428866625

Edited 1428867853
Kryx
Pro
Sheet Author
API Scripter
Rolling HP: Using a minimum of the average can be turned off with "shaped.monsterAsMinHp = false" at the top of the scripts page. I have now made this the default, but have left the option there for others. 12th April 2015 (1.43) You can now specify the default tab for a sheet. You can now specify the default settings for the "Settings" tab in the script. Changed the default to not use the average hp as a minimum Printed out a log message when a creature is done converting. Imported JF's 2.4 changes to this script Still need to do (will likely be done tonight or tomorrow): Convert/Reimport Actions. Hopefully convert. Will be a problem with multiattack - I will try to work around it. Test bars. Fix any bugs.
1428871632

Edited 1428875661
Kryx
Pro
Sheet Author
API Scripter
1.45: Fix bars to take the correct values for converting Fix convert to work with creatures whose name is different from their journal names (gets the journal via "represents") @RMcD/Greg can you guys copy+paste some NPCactions from the old importer here so I can test them? I need some with description+effect and some with just description. Also one with multiattack please. Thanks!
1428943790
Kryx
Pro
Sheet Author
API Scripter
13th April 2015 (1.6) Added the option to default bars to the attribute set in the settings. (Works on Importing and Converting) Added the option to show the token's name by default. Can be turned off. Fixed bars more after some additional testing Converting of Actions is now done. The text is processed back into the expected format from the book and then processed. Any item set as "Action", "Bonus Action", or "Special Action" is set to a normal action. Reactions will go to the reaction box. Lair and Legendary actions are converted appropriately. Speeds were converted properly now Visions (Darkvision, Blindsight, etc) were converted properly now Saves and Skills now use Proficiency or Expertise if applicable. They will calculate the offset and set it to a bonus if needed. NPC Actions now set the multiattack checkbox if the attack is part of the multiattack. Saves with "Within # feet" now add that # to range. Recharge is now processed from actions Line attacks are processed better now. Save attacks with damage are processed correctly now.
Do you still need the actions, and do you want the stuff that's in the GM Notes before conversion with the old importer because the actual rollable actions just refer to the character sheet such as from the Bugbear morning star on the token is just "%{selected|NPCAction1}"
1428952480
Kryx
Pro
Sheet Author
API Scripter
I don't need the actions anymore, thanks. If you have the GM notes from before the conversion I'd suggest you use "!shaped-import" (same as "!shaped-parse" or "!build-monster"). You can convert and everything will work, but importing is more reliable in case anything was changed. The rollable actions should be replaced with the NPC Actions as soon as you convert or import.
1428967603

Edited 1428967980
Huh, I'm pretty sure all my tokens still have the GM notes on them that makes it easier.. When I tried it on my Giant Spider it kept Web (Recharge 5-6), added Web, and overwrote Bite. It failed to parse the poison of bite into dice (it says (2d8) in the bite and this shows up as (2d8) in the action). For the HP got this error: "Exception: Character doesn't have valid HP Hit Dice format". For reference here is the GM-Notes that I originally parsed with jf-parse (can't remember what edition of his it was). Edit: damn that's ugly what's the formatting on this forum. Here's pastebin instead; <a href="http://pastebin.com/9UCnJdS6" rel="nofollow">http://pastebin.com/9UCnJdS6</a> Edit 2: My suggestion would be to delete the character sheet then replace it so you don't have any left over attributes and stuff taking up space. Edit 3: Also the Web recharge is it meant to not roll a d6 to check? It's got recharge on 5-6 but it doesn't tell me if it's recharged so I'd have to manually roll each time. Also fails to parse the range
1428968536

Edited 1428968549
The Aaron
Forum Champion
API Scripter
RMcD said: Edit: damn that's ugly what's the formatting on this forum. Here's pastebin instead; <a href="http://pastebin.com/9UCnJdS6" rel="nofollow">http://pastebin.com/9UCnJdS6</a> It would probably look more to your liking if you formated it as code, available in the ¶ menu at the upper left.
1428996457

Edited 1428998595
Kryx
Pro
Sheet Author
API Scripter
When I tried it on my Giant Spider it kept Web (Recharge 5-6), added Web, and overwrote Bite. I don't understand. If this is the first time importing to the Shaped sheet then the actions area should be blank and there would be nothing to overwrite. I imported and see bite as the first action and Web as the section action. Do you see something else? Deleting: The script is meant to update in the cases where it already exists. If there is some issues with attacks I can try to remove unused ones, but I need to see it to understand. Your web's range format is "range 30ft./60 ft" but the book has it as "range 30/60 ft." Using the book format works. With the way I do regex the format has to match the book. My parser indeed missed the poison secondary damage. I will fix that. It also missed the retrained stuff for web. I will fix that as well. Recharge is rolled at the beginning of subsequent turns. It seems best to let the DM do that on the following turn unless you have a suggestion for how to do it better.
The Aaron said: RMcD said: Edit: damn that's ugly what's the formatting on this forum. Here's pastebin instead; <a href="http://pastebin.com/9UCnJdS6" rel="nofollow">http://pastebin.com/9UCnJdS6</a> It would probably look more to your liking if you formated it as code, available in the ¶ menu at the upper left. I tried using [code][/code], silly me. Re: Mark, as I said since these tokens with all the GM-Notes are the same as the ones I previously parsed they have all the old information on the character sheet. Even though I switch the character sheets to Shaped instead of normal it doesn't delete any of the data including the token rolls, so because your parse doesn't attempt to delete the already existing character sheet you have both data, some overwritten, some not. Giant Spider is copied out of the book, Lost Mine of Phandelver to be precise which is "Web (Recharge 5-6). Ranged Weapon Attack: +5 to hit, range 30 ft./60 ft., one creature", all of my stuff is from that. If I wanted to do it your way I'd have to go and delete all the character sheets (or copy the map and not copy them over but copy all the tokens over) or remake the tokens with the GM-Notes too.
1429005597

Edited 1429006567
Kryx
Pro
Sheet Author
API Scripter
RMcD said: Re: Mark, as I said since these tokens with all the GM-Notes are the same as the ones I previously parsed they have all the old information on the character sheet. Even though I switch the character sheets to Shaped instead of normal it doesn't delete any of the data including the token rolls, so because your parse doesn't attempt to delete the already existing character sheet you have both data, some overwritten, some not. Giant Spider is copied out of the book, Lost Mine of Phandelver to be precise which is "Web (Recharge 5-6). Ranged Weapon Attack: +5 to hit, range 30 ft./60 ft., one creature", all of my stuff is from that. If I wanted to do it your way I'd have to go and delete all the character sheets (or copy the map and not copy them over but copy all the tokens over) or remake the tokens with the GM-Notes too. Woah woah woah, no need to get agitated - I'm here to work through the issues and I very much appreciate you bringing them up. I did not mean to be dismissive. Sorry if it came off that way. On replacing: Are you saying there are left over abilities? If so those should be replaced with the new actions (as long as the name matches up). I assume in this case the old name has Recharge (5-6) in it? That would throw it off. The importer was written by JF to only update some parts. I think that's a good design. In this case I think the only problem is the abilities if they are named differently. Are there any other issues you're experiencing? I could delete all the old abilities, but that may have unintended consequences for other DMs who added their own abilities... hmmm On LMoP: The starter set came out before the monster manual and therefore has different syntax in some areas. Primarily my goal is to support the MM syntax as most versions of LMoP around the net are not OCR'd so therefore text can't be copied so LMoP is of limited concern. However I will also support LMoP Syntax as long as it's possible and it seems to be in this case. I will add support to parse the range from this syntax as well. As a GM I would recommend taking the updated monsters from MM as some were adjusted, but that's entirely up to you. I now properly parse bite and web. I will fix the range sytax to work with LMoP as well. EDIT: Parsed the "## ft/## ft" syntax to the MM syntax in my sanitize text function. I'll commit all the code later today.
Mark said: RMcD said: snip Woah woah woah, no need to get agitated - I'm here to work through the issues and I very much appreciate you bringing them up. I did not mean to be dismissive. Sorry if it came off that way. On replacing: Are you saying there are left over abilities? If so those should be replaced with the new actions (as long as the name matches up). I assume in this case the old name has Recharge (5-6) in it? That would throw it off. The importer was written by JF to only update some parts. I think that's a good design. In this case I think the only problem is the abilities if they are named differently. Are there any other issues you're experiencing? I could delete all the old abilities, but that may have unintended consequences for other DMs who added their own abilities... hmmm On LMoP: The starter set came out before the monster manual and therefore has different syntax in some areas. Primarily my goal is to support the MM syntax as most versions of LMoP around the net are not OCR'd so therefore text can't be copied so LMoP is of limited concern. However I will also support LMoP Syntax as long as it's possible and it seems to be in this case. I will add support to parse the range from this syntax as well. As a GM I would recommend taking the updated monsters from MM as some were adjusted, but that's entirely up to you. I now properly parse bite and web. I will fix the range sytax to work with LMoP as well. EDIT: Parsed the "## ft/## ft" syntax to the MM syntax in my sanitize text function. I'll commit all the code later today. Ha ha dude I wasn't agitated. The triple woah makes me very confused when I read back over my comment, all I am is super appreciative of the time you invest in this. Replacing: Yeah, the old action was "Web Recharge (5-6)" or something, I didn't notice any other issues, but if they do arrive it will be because both conversions are mashed together, that's why I was using the conversion before because I figured it deleted the character sheet and then remade it. The only time it would have unintended consequences would be if the DM made a character sheet and added abilities and the such before importing then that character sheet's data would be deleted then recreated a fresh when you type parse the GM-Notes. My simple solution would be that you can choose whether or not it deletes the character sheet before making it (if a character sheet even exists of course). This is pretty much only an issue in this specific scenario where you've already parsed with other code and so have vestigial stuff that might mess things up. LMoP: If you know the differences in format I could just change my dropbox of all the LMoP monsters so that they fit, obviously I don't know if it's worth the effort to code since it's literally only going to apply to LMoP and if we keep the copy updated it should be fine. The reason I used my OCR copy of it was because I could just select the entire document and go through it all at once. The MM would require going through and finding each monster though I suppose at one point I'd want all the MM anyway. Has anyone done the entire MM? I'll also have to look up what changes there were to monsters as I hadn't heard of that. On recharges I still think rolling the recharge with the use is worth it, there's very few situations where there is a difference between waiting to roll the recharge until the start of the next round versus rolling it right after its used. The only difference I can think of would be legendary actions, and even if you just remember that weapons with recharge can only be used once a round it's probably easier than remembering to go back and roll, though of course since you have to roll anyway if it doesn't recharge you're not saving much and having the roll done automatically might make you more likely to forget as opposed to if you were used to doing it every start of round. I think I just argued myself out of the position I just made. Maybe an option?
1429018592
Kryx
Pro
Sheet Author
API Scripter
You just sounded annoyed and I assumed it was because I was a bit dismissive. Ignore it. :) Replacing: I can put an optional configuration to remove the old sheet/abilities. Maybe as part of the command. I'll look into that. Supporting LMoP isn't a problem. It's super easy to sanitize it back to the MM format (at least for range). I think it's good as others may do exactly what you did. Please let me know if LMoP's syntax differs from the MM in any other way - I didn't notice any at a glance. I ran it before and the rest of the syntax is the same I believe, but I may have overlooked something. Recharges: I'm not sure what is best here. I think we both fully understand how it works, but just in case here is the text: Recharge X-Y. The notation "Recharge X - Y" means a monster can use a special ability once and that the ability then has a random chance of recharging during each subsequent round of combat. At the start of each of the monster's turns, roll a d6. If the roll is one of the numbers in the recharge notation, the monster regains the use of the special ability. The ability also recharges when the monster finishes a short or long rest. Every round after the ability is used the monster can reroll to try to recharge it. It's not just the first round. As a DM I tried rolling it right away, but then at the beginning of the next turn I forgot if I had rolled it before. For sake of consistency I think it's best to always roll it at the beginning. However that's not a great solution either... I can make Recharge roll right away on the settings tab if nothing else.. I wish there was a better way..
1429027669

Edited 1429031959
Kryx
Pro
Sheet Author
API Scripter
14th April 2015 (1.63) LMoP's range format of ## ft/## ft will now be sanitized to match the MM format of ##/## ft Sanitized Traits to get rid of any incorrect words. Combined the Damage Regex into one regex. Extensively tested Ancient Black Dragon and Giant Spider. It should work for most things. Still need to test more creatures Cleaned up the Save Regex Legendary Actions parsed to notes properly if they do not have any action.
1429032842

Edited 1429034490
LMoP: I'll keep an eye out when converting to see if any other issues arise regarding differences in format, haven't really used the MM much (my actual time playing 5e is currently dwarfed by the amount of time I spend talking about 5e or preparing). Recharge: Yeah there doesn't seem to be a simple way to do so, making some sort of round counter that automatically detects if recharge abilities were used then rolls an appropriate number of d6s is the only overly complicated way I can of doing it. Something like this 17:20 ish , rolls initiative for everything on screen, keeps track of each round, and keeps track of recharge (and any other things that are on round). That's like a super complicated solution but just the way recharge works means you have to remember something, either to roll it again the next round when it can't be used, or to roll it at the start of every round. Really starts getting into out of character sheet and into general improvement stuff. Edit: Man I am just the herald of problems, had an issue parsing Nezznar: "---- Parsing statblock ----" "statblock: NEZZNAR THE BLACK SPIDER#Medium humanoid (elf), neutral evil#Armor Class 11 (14 with mage armor)#Hit Points 27 (6d8)#Speed 30 ft.#STR#9 (-1)#CON#10 (+0)#CHA#13 (+1)#INT#16 (+3)#WIS#14 (+2)#DEX#13 (+1)#Saving Throws int +5, Wis +4#Skills Arcana +5, Perception +4, Stealth +3#Senses darkvision 120 ft., passive Perception 14#Languages Elvish, Undercommon#Challenge 2 (450 XP)#Special Equipment. Nezznar has a spider staff.#Fey Ancestry. Nezznar has advantage on saving throws against being charmed, and magic can't put him to sleep.#Sunlight Sensitivity. Nezznar has disadvantage on attack rolls when he or his target is in sunlight.#Innate Spellcasting. Nezznar can innately cast the following spells, requiring no material components:#• At will: dancing lights#• 1/day each: darkness,faeriefire (save DC 12)#Spellcasting. Nezznar is a 4th-level spellcaster that uses intelligence as his spellcasting ability (spell save DC 13; +5 to hit with spell attacks). Nezznar has the following spells prepared from the wizard's spell list:#• Cantrips (at will): mage hand, ray offrost, shocking grasp#• 1st Level (4 slots): mage armor, magic missile, shield#• 2nd Level (3 slots): invisihility, suggestion#ACTIONS#Spider Staff. Melee Weapon Attack: +1 to hit, reach 5 ft., one target. Hit: 2 (1d6 -1) bludgeoning damage plus 3 (1d6) poison damage.#" "Creating attribute strength" "Creating attribute dexterity" "Creating attribute constitution" "Creating attribute intelligence" "Creating attribute wisdom" "Creating attribute charisma" "Creating attribute size" "Updating attribute npc_type" "Creating attribute alignment" "Updating attribute npc_AC_note" {} "Parsing was incomplete due to error(s)" "TypeError: Cannot read property '1' of null" Both Young Green Dragon and Mormesk the Wraith seems to parse without issue.
1429048896

Edited 1429049207
Kryx
Pro
Sheet Author
API Scripter
Sorry for the delay, I was running my session tonight. 1.64: I've fixed HP and HD parsing if there is no bonus to hd. Rudimentary mistake really.. It was one of the first regexs I wrote for this project and I was a bit rusty. All good now. I'm sure we'll run into many of these and fix them 1 by 1. I actually see that it does not parse negatives to damage. Seems to be the case on JF's importer as well.. I will fix the regex for that tomorrow. EDIT: 1.65: Fixed damage parsing to allow for negative numbers
No worries like I said you put way more effort into this for a free hobby. How was your session? I am amused by the simplicity of that error. Sometimes I get this requiring a restart of the script: "undefined:1 $[[1]] ^ SyntaxError: Unexpected token $ at Object.parse (native) at evalmachine.&lt;anonymous&gt;:167:26 at checkFinishedOps (" Most commonly after I've just dragged a token onto the map. I type shaped-convert on this token and it does that. Attempting to shaped-convert Orche Jelly and got this: "Exception: Name required to set attribute" "msg.content: !shaped-convert" "---- Parsing old attributes to new ----" "Name required to set attribute" "Exception: Name required to set attribute" When I shaped-convert Spectator it all goes well, however the actions that are rays apart from Wounding Ray all have a number after them in the description. 1-4. I assume it's because of the list and the numbers got cut off as part of the previous action. So that Eye Rays action ends in "1" with no . Multiattack on doppleganger just posts a blank Multiattack. And for reference again regarding what I'm using for these so I don't have to spam this thread with the stuff (where's the spoiler tag buttons grr): <a href="https://www.dropbox.com/s/dxdqt7u2xpoy9z1/LMoPMonstersForImporting.txt?dl=0" rel="nofollow">https://www.dropbox.com/s/dxdqt7u2xpoy9z1/LMoPMonstersForImporting.txt?dl=0</a>
1429051791
Kryx
Pro
Sheet Author
API Scripter
I've never seen the convert error. It may be a typo on my part. I'll check tomorrow. Same with the other items - I'll check tomorrow. That txt file of all the imports will really help. I'll test them all.
1429084271
Kryx
Pro
Sheet Author
API Scripter
I still haven't run across your error. I don't see any case in the code where I've used "$[[1]]". Let me know if there is a specific way to reproduce it. Ochre Jelly broke because it had "blind sight" and not "blindsight". I've added this to the sanitization function. It converts for me fine now (though I haven't compared, will do that later tonight) Sepctator : Sweeet the rays parse fairly well when using !shaped-import. They don't have the range from "Eye rays", but I haven't even tried to import any creature like this. Should require just a bit of cleanup. Confusion ray didn't parse the save properly, but the rest did!! And ya I see the numbers at the end - I'll have to clean that part up as well. Also reactions didn't parse as I haven't done them yet. Will do soon. Doppelganger : It seems to parse correctly for me. Both with shaped-import and with jf-parse and then shaped-convert. In both cases multiattack reads "The doppelganger makes two melee attacks." Not sure what I've done differently from you.
1429108799
Kryx
Pro
Sheet Author
API Scripter
Spectator: This creature is a good example of a creature that has been updated from LMoP in the MM. For instance it now has hover, has telepathy, and his eye ray action is worded differently.
Also a lot of time when loading the campaign for the first time that day and I try shaped-convert I get "Unexpected token s" and have to restart the API. I changed blind sight to blindsight (without updating the API as I wasn't sure if you changed it) and got the same error for the Ochre. Spectator was the most complicated creature in LMoP which is why I saved it for last, doesn't surprise me that it's been updated. I tried finding some sort of list of mobs with changes but no one else on the internet seems to have done it. I'll have to have a look. Regarding Doppelganger, it correctly says "The doppelganger makes two melee attacks." in the multiattack heading under actions however Slam is not ticked as being multiattack and so the multiattack ability says this: "%{selected|npc_action_3}" which refers to nothing there is only two actions that have filled in. This is with shaped-convert uh, I think they all might have been, woops, haha, I think I got confused between import and convert, can't remember if I did that last night too. You can see I said convert in the last post but I was meant to be trying to import it. Trying with import: Ochre parses fine with the change to blindsight, the doppleganger multiattack simplys says "makes with two melee attacks", is that intended I thought it was meant to roll both of them, it does for the other stuff. And the Spectator is fine with the two issues you noted. I am now very confused about when I tried using import and when I tried using convert, very sorry about that.
1429119326
Kryx
Pro
Sheet Author
API Scripter
RMcD said: Also a lot of time when loading the campaign for the first time that day and I try shaped-convert I get "Unexpected token s" and have to restart the API. This is roll20, not me. See <a href="https://app.roll20.net/forum/post/1647248/unexpect" rel="nofollow">https://app.roll20.net/forum/post/1647248/unexpect</a>... I changed blind sight to blindsight (without updating the API as I wasn't sure if you changed it) and got the same error for the Ochre. LMoP (at least Ochre Jelly) had a different syntax for spacing around blindsight. Make sure you take my code from about an hour ago and it'll work. (EDIT: With import, convert I need to sanitize more as discussed below) Spectator was the most complicated creature in LMoP Ya, it's the hardest to process, though I almost got there. My regex was getting crazy complicated so I'm going to rip it apart and put it back together in a more sustainable way. Regarding Doppelganger, it correctly says "The doppelganger makes two melee attacks." in the multiattack heading under actions however Slam is not ticked as being multiattack and so the multiattack ability says this: "%{selected|npc_action_3}" which refers to nothing there is only two actions that have filled in. Multiattack only checks the box if the attack is specifically called out by name in the multiattack text. It was the same on the old importer. I'm not sure that it should be different.. Then I'd have to parse "Is it a melee attack" or whatever other criteria is specified and then check those. Too much I think. Trying with import: Ochre parses fine with the change to blindsight, the doppleganger multiattack simplys says "makes with two melee attacks", is that intended I thought it was meant to roll both of them, it does for the other stuff. And the Spectator is fine with the two issues you noted. Hmmm I'll have to sanitize more for converting.. My doppelganger says "The doppelganger makes two melee attacks.". I used the exact syntax you put on dropbox. No idea what is wrong there. I am now very confused about when I tried using import and when I tried using convert, very sorry about that. I would recommend always using import. It's what my primary focus is. I'll support convert hopefully 100%, but it can be messier. Going to go have a dinner date with Regex... yaaaaay...... :(
1429134343
Kryx
Pro
Sheet Author
API Scripter
Ok so I've revamped my Regex with a new strategy: I combine regex scripts to get what I need. This helps prevent mass duplication. My new strategy is to go through each common syntax and parse it. Normal Damage (with effects) Normal Damage plus Secondary Damage (with effects) Normal Damage with Alternate Damage (with Effects) etc I've finished all normal Secondary damage items. I found 1 item: Azir's warhammer that has both Alternate and Secondary. I'll search for more tomorrow and parse those. Basically my play is to go one by 1 though the list above. It makes it much easier to target syntax that way. For secondary saves (as part of damage) I'm going to leave them in the effects area as that makes more sense than putting them up in the save area and having to logically wrap back.
1429166293

Edited 1429166623
Edit --- I'm an idiot. Ignore me. Nice work. This is awesome!
1429166450

Edited 1429166478
Kryx
Pro
Sheet Author
API Scripter
Si, it sounds like you're using the other 5e sheet. This script only works with the shaped sheet. I will look at the elite drown warrior though to ensure it works.
1429166672
Heh I should have refreshed before I edited. Sorry :)
1429168286
I played around with the other script but didn't get great results. Your script seems to work pretty amazingly! I imported Wights and Wraiths from the online monster supplement for Rise of Tiamat with no issues at all. It even unlinks the health bar! Two things I have noticed. 1.) It doesn't grant the tokens sight based around dark vision automagically. Not a big deal but it would be nice. 2.) The script also doesn't create a default token for the journal entry. Again not world ending but it could be annoying if I forgot. If I want to drag an NPC out in a hurry only to find out I forgot to save the token it might be annoying. Apart from that this is very strong work. I'm really impressed. Now I need to decide if I want to remake all my macro's and transfer my players over to the shaped sheet..... decisons decisons
1429171043
Kryx
Pro
Sheet Author
API Scripter
Si said: I played around with the other script but didn't get great results. Your script seems to work pretty amazingly! I imported Wights and Wraiths from the online monster supplement for Rise of Tiamat with no issues at all. It even unlinks the health bar! Two things I have noticed. 1.) It doesn't grant the tokens sight based around dark vision automagically. Not a big deal but it would be nice. 2.) The script also doesn't create a default token for the journal entry. Again not world ending but it could be annoying if I forgot. If I want to drag an NPC out in a hurry only to find out I forgot to save the token it might be annoying. Apart from that this is very strong work. I'm really impressed. Now I need to decide if I want to remake all my macro's and transfer my players over to the shaped sheet..... decisons decisons Thanks for the feedback! I currently expect all monster stats to import properly and about 40-60% of monsters actions to import properly. I'm currently working on the actions part to hopefully increase that number to 95% over the next few days. It can link/unlink the bars if you use the settings at the top of the page, ya. Vision setting automatically would be really nice! There are several issues here though now that I think about it: Overlapping of visions - how should I handle blindsight 30 and darkvision 60. A bit annoying. Darkvision is meant to be dim light in 5e. Roll20 doesn't allow for a consistent layer of dim, it dims out over time. For Darkvision 60 I use 70/-5 to estimate to the player being able to see about 60ft. Unfortunately roll20 doesn't let me make the vision not progressively get dimmer. I'll first put in an estimate and then try to make it a setting Beyond those I see the parameters in the API edit it so I'll do that. I remember reading that I cannot change the default token of a journal. I will ask if anyone knows if its possible and the command if so. I agree that it would be very nice. For converting from the default sheet: PCs remain the same except Armor and Vision. Everything else should work. For NPCs you can convert them and the sheet should process them correctly, or you can reimport. It's annoying, but it's not too bad. I'm glad you like it! :)
1429175157
Kryx
Pro
Sheet Author
API Scripter
Vision is done. I take the highest vision range and set that. If that is Darkvision I multiply darkvision by 1.6666 (60-&gt;70, 120-&gt;140, etc). I then search for the second highest vision range. If that exists I set that to the start of dim. Otherwise I set it to -5. For example the Ancient Black Dragon has: Senses blindsight 60ft., darkvision 120ft., passive Perception 21 His vision is set to 140/60. Works pretty well! :)
1429194662
The Aaron
Forum Champion
API Scripter
I think you mean 1.16666. Why do you do that, btw? Account for the penumbra at the edge of dim?
1429197122

Edited 1429197226
Kryx
Pro
Sheet Author
API Scripter
I do indeed mean 1.1666666. When I first started DMing I noticed that 60 in the vision area does not equate to 60 vision due to the penumbra at the edge. It cuts off about 10-20 feet. So for 60 vision I put 70 and for 120 vision I put 140. I used an aura and ctrl+L to see if the creature could actually see as far as it should. 1.166666 was just the result of those numbers. For blindsight, tremorsense, and truesight I simply set the start of dim to be equal to the vision and it stops the penumbra. 16th April 2015 (1.7) Vision is now set on the token. Completely revamped the damage Regex Parsed the other format of a line (see Ankheg) As mentioned above I've completely revamped the regex for damage. I've tested EVERY case of secondary damage ("X damage plus X damage") and alternate damage ("X damage or X damage if used with two hands") in the MM. The majority of normal damage cases should work as well, but I have not done extensive testing. I tested Ancient Black Dragon and Ankheg and both are working perfectly. I'll do some more testing tonight.
@Mark very cool, I look forward to this weekend when I'll have time to convert some more monsters and play around with this. keep the great work coming.
Okay I worked out how I'm getting unexpected. 1. Goblin from LMoP into a goblin token. 2. Shaped-parse said goblin token, also I set the second bar to passive perception linked if that matters and changed initiative tie break to false. 3. Set default token to the goblin. 4. Drag character sheet in, get error. Spinning up new sandbox... "Shaped Scripts ready" undefined:1 $[[1]] ^ SyntaxError: Unexpected token $ at Object.parse (native) at evalmachine.&lt;anonymous&gt;:169:26 at checkFinishedOps (
1429395032

Edited 1429395105
Kryx
Pro
Sheet Author
API Scripter
I found it tonight too. It's from dragging a creature on the map and rolling hp. I opened a thread about it: <a href="https://app.roll20.net/forum/post/1849327/rolling-" rel="nofollow">https://app.roll20.net/forum/post/1849327/rolling-</a>... You can comment out that command. Search for graphic
1429395880
Kryx
Pro
Sheet Author
API Scripter
Fixed it. Update the script and it'll work. Still some weird behavior around rolling hp.. I need to test it tomorrow.
1429435445
Kryx
Pro
Sheet Author
API Scripter
hp rolling works correctly. :)
Awesome, thanks for your fast work man
1429544180

Edited 1429544227
Kryx
Pro
Sheet Author
API Scripter
20th April 2015 (1.75) More Sanitize Completely revamped the save regexes. All versions of the save syntax that I know of should be working Processed the description of monsters that comes after actions. It's been added to "traits" 17-19th April 2015 Fixed rolling HP Fixed level calc to remove abs (so it can be combined with other inline rolls again) Fixed speed and senses parsing I expect nearly all monsters to parse nearly correctly at this point. I noticed that I do not process some of the smaller conditions "if the target is not undead", etc. I may include a raw output somewhere in the NPC actions as well, but I'd like to parse those special cases as well, just no idea where to put them. Banshee's Wail is a good example. I'm going to focus a bit more on the sheet for the next few days and come back to the parser when people come across any issues. For now I expect almost every monster to parse properly. Still TODO: Lair Actions Regional Effects Allow effects to be whispered to the GM via a select toggle.
@Mark tested out some more converts and man its coming a long way, if I had the time i'd start doing the conversions now. So thought i'd throw out a few of my hangups, see if there is anything that can be done to help the transition easier and/or ideas others might have on incorporating them. So after doing the converts, I don't always get the right "token" actions at the end of it, I seem to keep the ones that JF's importer started with "Bite" or whatever, and some effects will copy a breath weapon over like the winter wolf or the ankheg, but unique things like a bugbear's surprise attack dice 2d6 its tricky to make sure those aren't forgotten vs they being their all the time. The only solution I got is creating it as a Secondary Damage source named "Surprised" that i'll only apply if the conditions match, but obviously I need to set that up manually. The multiattack that gets converted from JF's import, seems to give me one attack using the NPC Sheet and one from the Shaped NPC sheet.. its a little strange and could require some manually tweaking to adjust. The HP roll on drop is handy, but I've got it setup for Aaron's RandomHP / Name on drop, so all my characters are named Creature %%NUMBERED%% so my players have an easy time naming them off when targeting which can also be problematic when you have a "Polar Bear 12" & a "Polar Bear 15" standing next to each other which then the names overlap and defeat the purpose. I think i'll post the next piece as a script request, but thought i'd throw it in here first as I know a lot of people are using the numbering script. I think using the Color icons would be way better as it wouldn't impact the amount of space needed, not sure how hard it would be to script but if a token is dropped with the same name as another token on the board assign it a unique color, repeat. Obviously only so many colors so you'd have to figure out how to adapt to having more creatures than colors by maybe appending a 1 to the end and then go back to the color wheel again, repeat. Again great work! Greg
1429605523

Edited 1429643116
Kryx
Pro
Sheet Author
API Scripter
@Greg thanks for the testing and feedback! So after doing the converts, I don't always get the right "token" actions at the end of it, I seem to keep the ones that JF's importer started with "Bite" or whatever, and some effects will copy a breath weapon over like the winter wolf or the ankheg, but unique things like a bugbear's surprise attack dice 2d6 its tricky to make sure those aren't forgotten vs they being their all the time. The only solution I got is creating it as a Secondary Damage source named "Surprised" that i'll only apply if the conditions match, but obviously I need to set that up manually. I just tested Bugbear and it does not create a token action for "Surprise". Did you create it? The converter doesn't convert any token actions, just creates ones from the character sheet. Though many of these trait items fit a similar pattern as actions and I should create a section to handle them. Shoving them into traits isn't a good option. I'll create a new section above actions to handle them. The multiattack that gets converted from JF's import, seems to give me one attack using the NPC Sheet and one from the Shaped NPC sheet.. its a little strange and could require some manually tweaking to adjust. That's... strange.. I will be sure to wipe the "multiattack" token action when converting to ensure that nothing from before remains.. It should work already though... hmm EDIT: I tested this and it does replace any old multiattack. You'll have to be more specific. The HP roll on drop is handy, but I've got it setup for Aaron's RandomHP / Name on drop, so all my characters are named Creature %%NUMBERED%% so my players have an easy time naming them off when targeting which can also be problematic when you have a "Polar Bear 12" & a "Polar Bear 15" standing next to each other which then the names overlap and defeat the purpose. I do like Aaron's numbered script and even tried to incorporate it in, but it was a bit too long. I did make a change a week or so ago to grab tokens by something other than name. Is it not working? Is there a problem here? I don't understand. I think using the Color icons would be way better as it wouldn't impact the amount of space needed, not sure how hard it would be to script but if a token is dropped with the same name as another token on the board assign it a unique color, repeat. Obviously only so many colors so you'd have to figure out how to adapt to having more creatures than colors by maybe appending a 1 to the end and then go back to the color wheel again, repeat. Aaron has given you your wish: <a href="https://app.roll20.net/forum/post/1273423/script-tokennamenumber-automatic-numbering-of-qualifying-tokens#post-1859038" rel="nofollow">https://app.roll20.net/forum/post/1273423/script-tokennamenumber-automatic-numbering-of-qualifying-tokens#post-1859038</a>
Mark said: @Greg thanks for the testing and feedback! I just tested Bugbear and it does not create a token action for "Surprise". Did you create it? The converter doesn't convert any token actions, just creates ones from the character sheet. Though many of these trait items fit a similar pattern as actions and I should create a section to handle them. Shoving them into traits isn't a good option. I'll create a new section above actions to handle them. Actually no, I just created it as a secondary damage type, I was thinking a "conditional" damage type might be relevant though, maybe that would be useful in creating its own section above the actions. Etc. The multiattack that gets converted from JF's import, seems to give me one attack using the NPC Sheet and one from the Shaped NPC sheet.. its a little strange and could require some manually tweaking to adjust. That's... strange.. I will be sure to wipe the "multiattack" token action when converting to ensure that nothing from before remains.. It should work already though... hmm EDIT: I tested this and it does replace any old multiattack. You'll have to be more specific. Hmm, I'll test a few more, might just have been one having the issue. Just could have been the only one. I shall test some more. I do like Aaron's numbered script and even tried to incorporate it in, but it was a bit too long. I did make a change a week or so ago to grab tokens by something other than name. Is it not working? Is there a problem here? I don't understand. Sorry no issue, I was just demonstrating an issue, Aaron's Dot thingie took care of my issue though.. Amazingly. :) Aaron has given you your wish: <a href="https://app.roll20.net/forum/post/1273423/script-tokennamenumber-automatic-numbering-of-qualifying-tokens#post-1859038" rel="nofollow">https://app.roll20.net/forum/post/1273423/script-tokennamenumber-automatic-numbering-of-qualifying-tokens#post-1859038</a> Yes while he was sleeping no less. :) Either way just wanted to let you know i'm a fan and continue to follow your work.