We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] CreatureGen, Pathfinder Monster Statblock -> Combat ready Token/Journal

1425345795

Edited 1484798748
EDIT By Riley D. (Admin): In case anyone comes across this, there is a new version of this that you need to use as of 1/17/2017:&nbsp; <a href="https://gist.github.com/rileydutton/f3d099af317734" rel="nofollow">https://gist.github.com/rileydutton/f3d099af317734</a>... update 1.32: Mass import for summons - Fixed: Mass import should now also work for player summons update 1.31: Fix for 'BUSY' after a single generation - Fixed: 'BUSY' state after a single generation, a silly mistake really. update v1.3: Feature add - Added: Auto-sizing. Now CGen will scan the size of the imported creature and store this in the 'Size' attribute, this will be used to automatically size the token during drag-drop auto-population. Note that if context such as 'Space 10ft.' exists, it'll use that size parameter as opposed to 'Medium','Small','Huge' etc.. Also note that sizes smaller than medium (which is considered 1 unit square) are not illustrated, but sizes larger than medium (2x2 Large,3x3 Huge,4x4 Gargantuan,6x6 Colossal) are illustrated. For tokens generated without the size attribute, or if it is invalid or missing, there is no auto-sizing. As an added bonus, it'll know the unit scale of the page on which the token resides and will size appropriately. - Added: Mass-Import. Now you can transmogrify pages with numerous tokens, select all tokens on a page, and mass-import them. This is ideal for moving around your monster databases. Note that this will NOT work for 'summons' for players . There is also a very rare race condition that will sometimes occur which I haven't pinned my thumb on where CGen will get stuck in the 'Busy' state (a lock to prevent multiple CGen operations during a mass import). To resolve this, simply re-save the script, if you could describe in detail what you did in a post that would help too. update v1.25: Minor updates - Fixed an issue with attacks with names like 'orc double axe' where it would attempt to parse 'or' in orc. where 'or' only looked for a word boundary on the right. It was to accommodate minor PRD errors where it wouldn't properly place 'or' as it's own word due to poor formatting. - Added Fast healing to defenses - Added Aura to defenses - Removed the name 'API' from sendChat in cgen_confirm.js as in the new update on dev server, it displays sender name for the /desc command for messages sent from the script. update v1.21: Urgent bug fix - Fixed an urgent bug for the added perception check that outright breaks 1.2 update v1.2 : Quality of life fixes: - Fixed bug were CGen could parse 'Sp' 'Ex' 'Su' rather than '(Sp)' '(Ex)' '(Su)' . - Fixed bug where it would not parse (EX) (SP) (SU) due to case sensitivity. - Fixed bug due to improper parsing of HTML entities %3Cbr -&gt; %3Cbr%3E so it properly parses &lt;br&gt; rather than just &lt;br which it should have always done... - Fixed bug where cgen_tmp and the default template within the script were out of sync where if you didn't choose an alternate template, the default would have an old align-right behavior for Attack: and Damage: - Added parsing of 'Perception' if Perception was not a listed skill (often context bonuses such as '+4 when in forests' are only in the skill section.) - Added formatting in the journal to make popping out the journal more viable to 'eagle view' on statblocks when needed. - Added a warning if the created journal entry was unable to accept the token's image source. update v1.01: - Added regeneration as a defensive ability to be shown in 'defenses' Running a game takes a lot of effort on the part of any GM. You prep the maps, the tokens, the story, the hand outs.. And finally you prep the baddies your players will fight. Now we usually look at stat-blocks and wing it from there with some forethought as to the tactics and abilities employed, but to automate the process, many of us create a number of macros to speed up the game process. This works wonders during the session, but consumes a good chunk of time that at least I, would rather spend world building and developing interesting scenarios. Peter W.'s script caught my eye in that it automatically imported many of the attacks that I commonly used, but it had some quirks with certain statblocks. In the end however, It saved a huge chunk of time as long as I could get the statblock to confirm with how the script expected it to be processed. I give him major props for the outline on how to parse the stat block. I ended up writing up a script to do just that, and bit by bit I handled many of the cases where Peter's script choked up on. Towards the end, I asked for for some artistic help from Russ H. , Rhyannon , Alan H. , and Gabriel P. for the templates this script uses. The script works in a menu like system where it simplifies the statblock from general creature abilities down to more specific abilities. This was done to quickly access abilities in the middle of combat as opposed to say navigating an entire character sheet. Attacking? Attacks -&gt; Melee -&gt; Bastard Sword Attacks are usually divided into 3 categories: Melee, Ranged, and Special. Attacks also come in what I call 'volleys' which for the monster statblocks as PF GMs know, are sets of full attacks. Usually volleys are separated by the keyword 'or' as it usually represents that the creature can either say take a full natural attack, or a full attack with a manufactured weapon. Take for instance the hound archon: Where the script processes the first volley (bite,slam) and the second volley (mwk great sword with 2 iterative, bite) all from the attack string: Melee bite +8 (1d8+3), slam +8 (1d4+1) or mwk greatsword +9/+4 (2d6+3), bite +3 (1d8+2) Attacks also often come with riders. CGen will automatically append any riders it finds such that you don't need to reference the effects. Private messaged to keep the effects secret! It handles multiple riders and will append with 'rider' text if the ability is listed in the special attacks or special abilities section. In addition, to help in the 'special' situations, it also gives contextual bonuses as tool-tips . It doesn't add these bonuses. In this instance, it'll inform that if grappling, it's actually a +11 as opposed to the creature's normal CMB. The CMB command itself will just roll it's normal CMB. It does this for skills, feats, and special abilities as well. Defenses DR/SR or creature speed ? Abilities -&gt; Defenses Each defensive trait and ability has a link to quickly search the term on d20pfsrd. Save time on your game look up. Also, if any ability has some special riders, it has a tool tip (CMD, speed, DR, DR will highlight white to indicate there's something more) Magic? Cleric -&gt; 3rd Sorcerer -&gt; 2nd(4/day) Bloodline-SLA -&gt; At Will Save time on spell casting baddies. Auto linking of spells with easily accessible caster level (CL) and concentration (CON) checks Even has little rider messages to help you in killing.. .er challenging your players. Each spell name themselves linking to the exact spell, it will handle lesser/greater/mass semantics and link to the correct base spell (greater dispel -&gt; dispel's spell page) Feats, Skills, Gear, SQ, Tactics? In short yes. Easier to see than to explain. Overall, it will compress complex stat blocks, into easily digestible token actions. Go from this: To this: With little more than a copy, paste, and a click of a button. It also pulls statistics and other things stored in the attributes section of the journal entry. How does it work? It's simply a parser that relies heavily on the formatting of the PRD stat block. It also requires that the stat block be well aligned. This means each ability is on one line as it does not tolerate wrapped text well at all. Things to look out for before you copy and paste are that spells lists and attacks are aligned (all 2nd level or 3rd level spells for example are on one line, not word wrapped on the next line). Using a text editor with line numbers displayed will work on this. I run linux so the basic text editors have this. For windows I'd recommend notepad++. I'm sure there's some MAC equivalent out there. For PRD stat-blocks: For d20PFSRD stat-blocks: For d20PFSRD stat-blocks, be sure to align! For Paizo PDF stat-blocks: (Please buy legit paizo PDFs at paizo.com, they made a wonderful game for us, and put much of the reference material online for everyone) Once you have the token set up, you can simply execute !CreatureGen to be along your way; putting it in a macro makes this merely a click. CGen is verbose: It will tell you if something wrong has happened, without crashing the sandbox. The script is fault tolerant and will alert you if there is a problem with the stat-block, or if there's missing stat-block information (the most common is a missing concentration bonus for demons/devils; they're CHA based btw). Auto-populate In addition, The script will auto-populate tokens if you drag drop them from the journal bar. Easily allowing you to use a monster you generated to make quick encounters. Even better, you can drag a generated journal to the tabletop, and after it populates the copied stat block. Edit the stat-block, place various templates, change the name and then re-generate it! Profit! Easily add the advanced template or other bits to add additional variants without altering the original. It essentially re-generates off that newly created token's notes since the auto-populated data is a legal copy of the stat-block. Be sure to change the name though, so if you edited this copy's statblock to have the advanced template, change the name to 'advanced wolf' or something on the lines else you'll have duplicate journal entries, which will confuse the script. If there are two journals named 'john' and the marco invokes %{john|attacks} .. it would do odd things clearly. Summons It can do summons by whispering directly to the player the various menus. Easily manage summons once you tell your players how it works. Be aware that this is tied to Display Name not player name, so if their Display Name changes, you'll need to regenerate. Once you work this out with your players, you can settle on a single chosen name for all their summons. Summoned creature's attack riders as well as special attacks will be displayed as public as opposed to a whisper which is normally done for normal CGen creatures. Auto-Confirm Crits It also adds auto crit confirms if you choose to add the companion script cgen_confirm.js Super cool templates to theme your game just the way you want it. You can easily add your own! (include cgen_tmp.js) There are also several wonderfully crafted design templates made by fellow Roll20 artists! Complete your dungeon buddy theme... I'm serious. Alan's template and various attack templates have you covered! Alan's Marketplace Check out Russ' templates for an authentic old world feel to match his map packs! Russ' Marketplace Rhyannon's template is very slick, and perfectly match her dungeon tile-sets! Rhyannon's Marketplace A very special thanks to the artists who helped make this possible! If you want to express thanks for this script, please buy their tiles and map sets! Here are some macros that you may want to add to your hot bar to easily use this script: CGen !CreatureGen CGen-Name !CreatureGen -name ?{name} CGen-Summon !CreatureGen -player ?{display-name} CGen-menu !CreatureGen -help Special Notes: By default, all creatures generated have the default name of 'creature' which is used for attacks unless the (!CreatureGen -name) option is used. This is on purpose as my players haven't identified the creature they're fighting. Once they get a knowledge check down, you can easily change the name attribute in the attributes section to describe what they identified.. or misidentified! The script in addition, is hardened against API failure as all the menus and abilities are stored within ability macros on the character sheet itself! If the API ever goes down, you're good to keep going as long as you don't need to generate a new creature. Your generated creatures will still behave the same irregardless if the API server has crashed or stopped ensuring a smooth experience. This also brings up the issue of editing the macros; since these macros store HTML information, if you try to edit them, you'll sanitize the contents, breaking that ability. I'd recommend to never edit the abilities on the journals generated by this script. SCRIPTS cgen.js <a href="https://github.com/Roll20KenL/Roll20_API_Scripts/b" rel="nofollow">https://github.com/Roll20KenL/Roll20_API_Scripts/b</a>... cgen_tmp.js <a href="https://github.com/Roll20KenL/Roll20_API_Scripts/b" rel="nofollow">https://github.com/Roll20KenL/Roll20_API_Scripts/b</a>... cgen_confirm.js <a href="https://github.com/Roll20KenL/Roll20_API_Scripts/b" rel="nofollow">https://github.com/Roll20KenL/Roll20_API_Scripts/b</a>... Good hunting game master...
1425347240
Vince
Pro
Sheet Author
Wow Ken. This looks like some script!
1425351812
This kind of things makes me want to put a PF game on my schedule. My 5e and Eclipse Phase players are gonna hate you.
1425361597
It's been a while since I played PF on roll20. Is this sheet suppose to link up with any of the attributes of any of the current PF character sheets? Or is this stand alone?
1425364657

Edited 1425364747
Ari K. said: It's been a while since I played PF on roll20. Is this sheet suppose to link up with any of the attributes of any of the current PF character sheets? Or is this stand alone? It's standalone, it's meant to be character sheet agnostic and can be used with either the legacy or normal PF character sheets. If you start to fill in ability fields on the character sheet however, there will be overlapping attribute names. But this is primarily a monster/summon importer as opposed to a character sheet importer. Jason's Script (also based off Peter W.'s) does that. Character sheets are clunky when used for monsters, if a more detailed view of the stat block is needed for monsters generated by this script, a quick shift+double click on the token to access its journal displays the complete stat block.
1425366183
Ken L. said: Ari K. said: It's been a while since I played PF on roll20. Is this sheet suppose to link up with any of the attributes of any of the current PF character sheets? Or is this stand alone? It's standalone, it's meant to be character sheet agnostic and can be used with either the legacy or normal PF character sheets. If you start to fill in ability fields on the character sheet however, there will be overlapping attribute names. But this is primarily a monster/summon importer as opposed to a character sheet importer. Jason's Script (also based off Peter W.'s) does that. Character sheets are clunky when used for monsters, if a more detailed view of the stat block is needed for monsters generated by this script, a quick shift+double click on the token to access its journal displays the complete stat block. Yeah, that makes total sense. I don't really need sheets for monsters, if all the abilities are in the token bar. Nice work man. So far so good on testing it.
update v1.01: added an update to defensive abilities to show regeneration as well. Also added some animated GIFs to show how the auto populate and summon feature work
1425411351
Vince
Pro
Sheet Author
Damn you Ken. Now I need to make time to implement another script. :-) Thanks for the the time and effort on this and for sharing.
1425420431

Edited 1425420583
The script certainly seems to generate less finicky macros than the CreateMob script I've been using, however I really, really don't enjoy the chat template things. They take up far too much room, and I don't like having the chat screen swallowed by a bunch of useless art (no offense to those who made it or use it). Is there a way to remove the chat templates and just get everything in the normal inline-roll format? Also, unless I missed something, the script doesn't seem to have a way of recognizing name changes, so if you import a character from the PFSRD who's "name" is like Rogue 1/Bard 5/Fighter 2, that's the name that's going to be applied to all macros, regardless of whether you change the sheet.
Askren said: Is there a way to remove the chat templates and just get everything in the normal inline-roll format? Yes, you can create a blank design template... The attack template is completely mutable so you can strip it essentially down to an inline roll. You can take a look at cgen_tmp.js and add a template with everything blank. When the script encounters a blank or undefined image link, it uses none. The attack template however will at least need a line of text with &lt;&lt;ATTACK&gt;&gt; &lt;&lt;DAMAGE&gt;&gt; and &lt;&lt;TITLE&gt;&gt; Also: CGen-Name !CreatureGen -name ?{name} Will insert a name in the name attribute which is used in building the &lt;&lt;TITLE&gt;&gt; field for the attack text. on d20pfsrd, the name is usually on the top banner, usually they have some obscure name like cursed fighter. What you just said is the class combination, that's not where the name field is pulled from. The name field is any text before the Challenge Rating number.
I went ahead and added a minimal template to cgen_tmp.js, see the new version on github.
This should answer your name question. As far as all the other abilities, they're tied to the 'true' creature name. The name field is primarily used for attacks so you could say 'gaunt pale man' attacks before your players id it as devourer. The name field will ID all tokens tied to that journal.
1425432179
I guess it may just be my Javascript illiteracy, but I'm not actually sure what a blank template should look like. Like, will the script work if I just cut out the entire "design {" section? Like, I tried making the Default empty of links and stuff, but that just breaks the script.
You can just blank out the links skillTitleFmt: 'style="color: #000000; font-weight: bold; font-size: 125%;"', skillLabelFmt: 'style="color: #44824C; font-weight: bold; font-size: 110%;"', skillTopImg: '<a href="https://s3.amazonaws.com/files.d20.io/images/7816000/-QKJOJF6UFmDAEypDGeXcw/thumb.png?1424460624" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/7816000/-QKJOJF6UFmDAEypDGeXcw/thumb.png?1424460624</a>', skillMidImg: '<a href="https://s3.amazonaws.com/files.d20.io/images/7816002/nKEWcTQ2VjcRJqrfiMHg_w/thumb.png?1424460630" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/7816002/nKEWcTQ2VjcRJqrfiMHg_w/thumb.png?1424460630</a>', skillBotImg: '<a href="https://s3.amazonaws.com/files.d20.io/images/7816003/lcNufMB1JeLmdDVPJ0KFdQ/thumb.png?1424460634" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/7816003/lcNufMB1JeLmdDVPJ0KFdQ/thumb.png?1424460634</a>', skillTitleFmt: 'style="color: #000000; font-weight: bold; font-size: 125%;"', skillLabelFmt: 'style="color: #44824C; font-weight: bold; font-size: 110%;"', skillTopImg: '', skillMidImg: '', skillBotImg: '', The minimal script however should be enough as it's the smallest it can get at that point. For the attack template, you should just use the inline rather than blanking it out.
1425435640
Fair enough, I understand now. I guess my last question is, would I just outright delete all image link references in the Cgen.js script to remove things like the scroll images behind critical confirmations?
You'd need to do so for the cgen_confirm script. The crit-confirm script is an add-on, and is separate. Replace: critTemplates: { tmpNorm: '&lt;&lt;TEXT&gt;&gt;' },
Fantastic work, Ken. Nice to see a spiritual successor to CreateMob. Really appreciate the minimal/inline templates as well. Looks like I'll have to grab a subscription for sure. Any timeline for Main Server integration? I'm hesitant to create and run full campaigns off Dev Server...
1425443837
The Aaron
Forum Champion
API Scripter
When the Update of Holding is Live, which the Devs have said will be in Q1, so likely sometime this month.
One additional thing you can do Askren since you're all for the single-button push approach as opposed to the menu approach. Is that after creature generation, you can go to the journal and uncheck 'display token action' for attacks, ATK, RNG, and just check the 'display token action' for the individual token actions ATK-mwk battleaxe, RNG-longbow.... etc. It will clutter the token actions mind you, and when token actions exceed a count higher than 10, it becomes mis-ordered due to roll20 not guaranteeing order. It's for that reason I made the design decision to not have an option to simply put everything on the token action, nor will I do so as it gets pretty cluttered. But it makes sense for often used things, and you have that ability to easily check/uncheck what should be displayed on the token action bar.
1425627009

Edited 1425627350
I'd like to note that d20pfsrd's 'summoned' statblock is not currently supported since it's non-standard: <a href="http://www.d20pfsrd.com/bestiary/monster-listings/" rel="nofollow">http://www.d20pfsrd.com/bestiary/monster-listings/</a>... Compared to the normal PRD legal statblock: <a href="http://www.d20pfsrd.com/bestiary/monster-listings/" rel="nofollow">http://www.d20pfsrd.com/bestiary/monster-listings/</a>... You can still manually modify the statblock to acquire the augmented summoning attributes during the alignment process. If someone wants to make a commit to the git hub to handle these basket conditions please do. It will take me time before I can get to it.
1425654138
I did encounter an error I'm not sure about. I brought a player onto the Dev, I imported his character (one from HeroLab, one just from the SRD), and in both cases when the token is under his control, he is unable to use the buttons for Attack rolls. This was one of the results:
Cool, nice work. If it's ok, I'll make a RuneQuest 6 version of your script with statblocks from <a href="http://ouropa.planeetta.com/rq_tools/enemygen/" rel="nofollow">http://ouropa.planeetta.com/rq_tools/enemygen/</a> ? Unfortunately the statblock is not as well-formed as one could hope, but with minor changes it'll work. Planning to use it to import PCs, NPCs and Monsters. You may wonder why PCs and NPCs? I'm also considering making an iPad App for generating RuneQuest 6 characters and exporting the statblock to DropBox. And of course importing them back into to the app again. I've already experimented a bit with the script and this is what I made so far: RuneQuest 6 Charactersheet: Filling in Characteristics, Hit locations, AP, HP, Move Rate and Special abilities. Working on skills. Macros: Abilities, Skills and Special abilities. I'm not quite sure how to add Combat Styles yet? In the charactersheet it's added in a repeater. Maybe I have to make a new charactersheet to???
1425655648

Edited 1425657692
Askren said: I did encounter an error I'm not sure about. I brought a player onto the Dev, I imported his character (one from HeroLab, one just from the SRD), and in both cases when the token is under his control, he is unable to use the buttons for Attack rolls. This was one of the results: If you want to grant control of the token to a player you need to use the summons feature, not the normal generation command. It's failing because under normal operation it uses /desc which is a GM only command. The summons feature specifically whispers to players the menu options, and publicly rolls attacks skills etc out in the open. Read above about the command !CreatureGen -player [name] Also if you read above, this was never intended to parse Hero lab stat blocks. It will only parse stat blocks that fit PRD specifications. If Hero lab just happens to do so, then it's fine. But it I never covered for hero lab stat blocks so you're on your own unless you can commit changes to handle those cases. Bo KH said: Cool, nice work. If it's ok, I'll make a RuneQuest 6 version of your script with statblocks from <a href="http://ouropa.planeetta.com/rq_tools/enemygen/" rel="nofollow">http://ouropa.planeetta.com/rq_tools/enemygen/</a> ? Unfortunately the statblock is not as well-formed as one could hope, but with minor changes it'll work. Planning to use it to import PCs, NPCs and Monsters. You may wonder why PCs and NPCs? I'm also considering making an iPad App for generating RuneQuest 6 characters and exporting the statblock to DropBox. And of course importing them back into to the app again. I've already experimented a bit with the script and this is what I made so far: RuneQuest 6 Charactersheet: Filling in Characteristics, Hit locations, AP, HP, Move Rate and Special abilities. Working on skills. Macros: Abilities, Skills and Special abilities. I'm not quite sure how to add Combat Styles yet? In the charactersheet it's added in a repeater. Maybe I have to make a new charactersheet to??? Sure, just make sure to release it under GPL v3 as well, the more open source, the better. Go crazy. The utilities I wrote for this script can be applicable for most things. Also cgen_tmp.js is not under GPL, the copyright belongs to each artist. If you want to use their art and sell it as say part of your app, you will need to ask their permission first; If you're making another open source script within Roll20, I'm sure they'll be fine with it as long as you credit them. Beyond that, say the app store, you'll want to send them a PM or two about it.
1425673221
thanks for pointing out the summons feature
Ken L. said: Askren said: I did encounter an error I'm not sure about. I brought a player onto the Dev, I imported his character (one from HeroLab, one just from the SRD), and in both cases when the token is under his control, he is unable to use the buttons for Attack rolls. This was one of the results: If you want to grant control of the token to a player you need to use the summons feature, not the normal generation command. It's failing because under normal operation it uses /desc which is a GM only command. The summons feature specifically whispers to players the menu options, and publicly rolls attacks skills etc out in the open. Read above about the command !CreatureGen -player [name] Also if you read above, this was never intended to parse Hero lab stat blocks. It will only parse stat blocks that fit PRD specifications. If Hero lab just happens to do so, then it's fine. But it I never covered for hero lab stat blocks so you're on your own unless you can commit changes to handle those cases. Bo KH said: Cool, nice work. If it's ok, I'll make a RuneQuest 6 version of your script with statblocks from <a href="http://ouropa.planeetta.com/rq_tools/enemygen/" rel="nofollow">http://ouropa.planeetta.com/rq_tools/enemygen/</a> ? Unfortunately the statblock is not as well-formed as one could hope, but with minor changes it'll work. Planning to use it to import PCs, NPCs and Monsters. You may wonder why PCs and NPCs? I'm also considering making an iPad App for generating RuneQuest 6 characters and exporting the statblock to DropBox. And of course importing them back into to the app again. I've already experimented a bit with the script and this is what I made so far: RuneQuest 6 Charactersheet: Filling in Characteristics, Hit locations, AP, HP, Move Rate and Special abilities. Working on skills. Macros: Abilities, Skills and Special abilities. I'm not quite sure how to add Combat Styles yet? In the charactersheet it's added in a repeater. Maybe I have to make a new charactersheet to??? Sure, just make sure to release it under GPL v3 as well, the more open source, the better. Go crazy. The utilities I wrote for this script can be applicable for most things. Also cgen_tmp.js is not under GPL, the copyright belongs to each artist. If you want to use their art and sell it as say part of your app, you will need to ask their permission first; If you're making another open source script within Roll20, I'm sure they'll be fine with it as long as you credit them. Beyond that, say the app store, you'll want to send them a PM or two about it. All Roll20 stuff will of course be open source. :)
1425880623

Edited 1425889055
This is friggin awesome! Super simple configuration and set up! I have been using the older Mob importer script for the longest and just changing what i needed to change once the creature was generated, but SO FAR it seems like this script is ready to go right out of the box (at least for my needs). Thanks contributing code monkeys and artists! Your hard work will add at least a +2 to my Bluff Check to seem like a hard working GM. ;) You guys are awesome! EDIT: As per usual with new Roll20 tricks, I try to break it early so I can see what kind of potential problems to expect during a session. I tried importing from Hero Lab (like Askren stated above) and importing the plain text stat blocks seems to work just fine (so far). I tried the "Summon" function to give control to a player and that also worked... at least until I changed the Name field on the character sheet... then it partially stopped functioning. That's ok though. For GM purposes, this script is the bee's knees... I don't personally recommend it for player character use. EDIT 2: For anyone who is wanting to try this script, HEED Ken L.'s warning about not editing the Abilities generated by this script on the character sheet... don't even click to open the edit box because it turns the output from this: To this: I didn't change anything in those boxes. I merely opened them out of curiosity to look at the syntax that was generated. And again, don't change the CHARACTER name . You can change the Display Name of the token, and you can change the "name" ATTRIBUTE (where it says "creature" by default), but once the creature has been generated don't change the Name field on the character journal.
Wade said: This is friggin awesome! Super simple configuration and set up! I have been using the older Mob importer script for the longest and just changing what i needed to change once the creature was generated, but SO FAR it seems like this script is ready to go right out of the box (at least for my needs). Thanks contributing code monkeys and artists! Your hard work will add at least a +2 to my Bluff Check to seem like a hard working GM. ;) You guys are awesome! EDIT: As per usual with new Roll20 tricks, I try to break it early so I can see what kind of potential problems to expect during a session. I tried importing from Hero Lab (like Askren stated above) and importing the plain text stat blocks seems to work just fine (so far). I tried the "Summon" function to give control to a player and that also worked... at least until I changed the Name field on the character sheet... then it partially stopped functioning. That's ok though. For GM purposes, this script is the bee's knees... I don't personally recommend it for player character use. EDIT 2: For anyone who is wanting to try this script, HEED Ken L.'s warning about not editing the Abilities generated by this script on the character sheet... don't even click to open the edit box because it turns the output from this: To this: I didn't change anything in those boxes. I merely opened them out of curiosity to look at the syntax that was generated. And again, don't change the CHARACTER name . You can change the Display Name of the token, and you can change the "name" ATTRIBUTE (where it says "creature" by default), but once the creature has been generated don't change the Name field on the character journal. It's posting html into the textbox and when viewing it I guess it's validating the content and removing html tags.
It's indeed awesome!!! You could modify the script to convert monsters between systems. From Pathfinder to something else.
1425932053

Edited 1425933198
First, thanks! This was something I tinkered with for a long while where I had some spare time. If you look at the script, you can see some comments that don't correlate, and TODOs that are done, or don't make sense with the written script below it. I'll get around to cleaning those up. There are however some TODOs that if anyone wants to send a pull request, I'd be happy to incorporate. Wade said: I tried importing from Hero Lab (like Askren stated above) and importing the plain text stat blocks seems to work just fine (so far). I tried the "Summon" function to give control to a player and that also worked... at least until I changed the Name field on the character sheet... then it partially stopped functioning. That's ok though. For GM purposes, this script is the bee's knees... I don't personally recommend it for player character use. CreatureGen does not support HeroLab output since I never accounted for it. Hero lab didn't consider Linux worth their time so I didn't consider them to be worth mine. But if someone wants to analyze it and send a pull request, I'd happily incorporate it, but I think it would do better as a fork since I wouldn't be able to test it. Regarding the use for players; it was never intended for use for player stat-blocks since players are very dynamic. Even here, it doesn't account for feats like 'power attack' or 'vital strike'. It merely says 'hey by the way, this creature has these feats..' It's more a reminder aid for abilities a creatures has. The attack macros simply duplicate whatever's in the attack sections, so some stat-blocks assume a barbarian in always raging, or assume power attack is taken every time; but this is outside the scope of CreatureGen since it merely transforms that block of information, into a digestible output. Specific things like that involve context which it can't possibly know about and can't do. It's not doing the work of GM for you, it makes it easier :) Likewise, the stats such as STR DEX etc... are not tied to say damage or Fort saves since the stat-blocks don't provide context for how those scores or ability rolls correlate. I'm sure you could say 'why no ranged touch button?, it's DEX + BAB by RAW' or 'Why not tie DEX to skills and those related to the ability so I can simply edit it and let it auto-calc..' ....but then again, there are exceptions, so I don't perform any auto-calculations that don't exist in the stat-block because I make the assumption that it'll always be wrong despite the high likelihood. Things like vermin without INT that can cast SLAs, or constructs without CON. Again, you could enumerate all these special classes but that would require an attachment to a library, and pulling from external sources which is an awful lot of work which constantly changes with new books, rules FAQs.... and there's the simple fact that Roll20 API can't pull datum from external sources like databases. Wade said: To this: I didn't change anything in those boxes. I merely opened them out of curiosity to look at the syntax that was generated. Roll20's fields do heavy HTML sanitation. Merely viewing it will strip all the HTML goodies I stuffed inside. The only way to put HTML in those fields is programmically and even then, there's filtering to prevent non-kosher behavior. It's best to leave those things under the hood, if you're really curious, you can view the script itself. Wade said: And again, don't change the CHARACTER name . You can change the Display Name of the token, and you can change the "name" ATTRIBUTE (where it says "creature" by default), but once the creature has been generated don't change the Name field on the character journal. That's intentional. All the macros that end up calling other macros (ie: attacks -&gt; melee attack menu which is another macro); they rely on the character name field for say %{ bobcat |ATK_3 claws} , and these are set statically once during genesis. I'm sure I could tie it to an attribute value, but then you'd have to remember to change that field whenever you change the character name. For the sake of simplicity, it's tied once during creation to the name of the creature. The whole macro chaining idea was intended to further customize the use. Some GMs might want to have Tactics, or the Tactics-during section up in the bar to quickly figure out how a creature/big-baddie should do in combat. I knew that the tree-menu would limit some, but I also know the information overload would just make it confusing; so adding that ability to display what you want was an advanced feature. I'm sure everyone want's some kind of preset during generation, but that was tedious so I glossed over it. That's another TODO if someone wants to help and contribute to the script. Thanks for the feedback!
Ken L. said: CreatureGen does not support HeroLab output since I never accounted for it. Hero lab didn't consider Linux worth their time so I didn't consider them to be worth mine. But if someone wants to analyze it and send a pull request, I'd happily incorporate it, but I think it would do better as a fork since I wouldn't be able to test it. Thanks for the feedback! You're welcome Ken! I apparently misunderstood some of the instructions until I started playing around with the script, so I thought I would chime in on those couple of items for the sake of others who might use this script. If it weren't for this helpful community and feedback I don't think Roll20 would be as awesome as it is. As for Hero Lab, I understand this script doesn't "officially" support HL stat blocks, but HL has an option to output a plain text stat block to the clip board and that stat block (for the most part) is formatted like the typical PRD/d20pfsrd stat blocks, and (so far) works just fine with this script. At the very least someone may want to do something similar to the "alignment" process you mention for stat blocks from d20pfsrd, but I didn't do that even. I simply copied, pasted, and boom! No problems... until I started messing with things I'm not supposed to that is ;) Thanks again!
1425947845
HeroLab's text output for statblocks works perfectly, with one minor exception: An enemy with multiple weapons/attacks will have each output to a separate line, and thus only the first will be parsed. So this: Offense -------------------- Speed 30 ft. Melee +1 shortsword +8 (1d6+9/19-20) or armor spikes +9 (1d6+8) or dagger +7 (1d4+8/19-20) or gladius +7 (1d6+8/19-20) or greataxe +7 (1d12+12/×3) or mwk ranseur +8 (2d4+12/×3) Becomes this: Offense -------------------- Speed 30 ft. Melee +1 shortsword +8 (1d6+9/19-20) or armor spikes +9 (1d6+8) or dagger +7 (1d4+8/19-20) or gladius +7 (1d6+8/19-20) or greataxe +7 (1d12+12/×3) or mwk ranseur +8 (2d4+12/×3) Putting everything on one line so it can be parsed properly.
CreatureGen relies on anchor points to approximately zone in on the correct attributes. They aid especially where there might be a sub-statblock involved. If it does not find an anchor point it wants, it'll search the complete statblock as opposed to a specific sub-section. If it's working out currently without the following anchor points, it's merely because there's one ' AC' value, or the first one it found was good, or something similar. This is more apparent with barbarian statblocks which have ranging statistics before the STATISTICS section. There it might take rage STR and if there's other strange things in that sub-statblock, it goes wild as it tries to make sense of it. it needs to see the following (case sensitive): DEFENSE OFFENSE STATISTICS (optional) SPECIAL ABILITIES TACTICS In an offhand sense, knowing this helps reconstruct disjointed stat-blocks on the PRD such as dragons for instance which seperate the special abilities from the different age categories since they all have the same abilities and they don't wish to repeat them. <a href="http://paizo.com/pathfinderRPG/prd/monsters/dragon" rel="nofollow">http://paizo.com/pathfinderRPG/prd/monsters/dragon</a>... In this unique case, after you copy say Adult Black Dragon, you can insert SPECIAL ABILITIES on it's own line, and then paste the various special abilities aligned after it.
1425960628
I'm just saying. Here is the statblock output from HeroLab for a basic level 1 Fighter: Valeros Male human fighter 1 NG Medium humanoid (human) Init +6; Senses Perception -1 -------------------- Defense -------------------- AC 18, touch 12, flat-footed 16 (+6 armor, +2 Dex) hp 12 (1d10+2) Fort +3, Ref +2, Will -1 -------------------- Offense -------------------- Speed 30 ft. (20 ft. in armor) Melee longsword +3 (1d8+3/19-20) or shortsword +2 (1d6+1/19-20) Ranged shortbow +3 (1d6/×3) -------------------- Statistics -------------------- Str 16, Dex 15, Con 12, Int 13, Wis 8, Cha 10 Base Atk +1; CMB +4; CMD 16 Feats Improved Initiative, Two-weapon Fighting, Weapon Focus (longsword) Skills Acrobatics -3 (-7 to jump), Climb +2, Intimidate +4, Survival +3, Swim +2 Languages Common Combat Gear alchemist's fire; Other Gear chainmail, arrows (20), longsword, shortbow, shortsword, backpack, silk rope (50 ft.), trail rations (2), 1 gp -------------------- Special Abilities -------------------- -------------------- Born a farmer’s son in the quiet Andoren countryside, Valeros spent his youth dreaming of adventure and exploring the world. For the past several years, he’s been a mercenary with the Band of the Mauler, a guard for the Aspis Consortium, a freelance bounty hunter, and hired muscle for a dozen different employers. Gone is his youthful naivete, replaced by scars and the resolve of a veteran warrior. While noble at heart, Valeros hides this beneath a jaded, sometimes crass demeanor, often claiming that there’s no better way to end a day’s adventuring than with “an evening of hard drinking and a night of soft company.” Aside from the Melee weapons line, everything else should parse just fine.
It's just the way the stat block is arranged that it worked out. If you want to be more sure it's zoning in the right areas, I'd capitalize those anchor points. Other than that, the script does have some fault tolerance by expanding the search zone to the entire statblock. But by expanding the search zone it can pick up more bad data and becomes more error prone. The main thing with capitalization is that it's all that seperates it from "statistics while raging" or other sub-statblock semantics that could direct CGen to parse the wrong stuff. That's the annoying thing about parsing and in general the more advanced natural language (which doesn't even compare) logic. Either way, I'm just noting that it 'happens' to work out in this case, but It's not guaranteed nor should be some expectation that it should if others start thinking that it comes with Hero Lab support, which it doesn't.
Just checked; now works in production server after the update of holding roll-out.
Ken L. said: Just checked; now works in production server after the update of holding roll-out. Hey Ken, I'm just now trying the script on the Production server and my first attempt generated a "double". I know there are network issues going on today or whatever with Roll20 in general, but I thought I should report either way. I made a second attempt just now and still got a double out put. Thoughts?
Part of the roll20 double execution error, it's scripts in general not just isolated to Cgen. Re-saving usually clears this up.
1427150482

Edited 1427152085
update v1.2 : Quality of life fixes: - Fixed bug were CGen could parse 'Sp' 'Ex' 'Su' rather than '(Sp)' '(Ex)' '(Su)' . - Fixed bug where it would not parse (EX) (SP) (SU) due to case sensitivity. - Fixed bug due to improper parsing of HTML entities %3Cbr -&gt; %3Cbr%3E so it properly parses &lt;br&gt; rather than just &lt;br which it should have always done... - Fixed bug where cgen_tmp and the default template within the script were out of sync where if you didn't choose an alternate template, the default would have an old align-right behavior for Attack: and Damage: - Added parsing of 'Perception' if Perception was not listed in the skill section (often context bonuses such as '+4 when in forests' are only in the skill section.) - Added formatting in the journal to make popping out the journal more viable to 'eagle view' on statblocks when needed. (PS: for those unfamiliar, you can shift+double click a token to quickly access the journal attached to it, no need to go to the journal tab) - Added a warning if the created journal entry was unable to accept the token's image source. Only cgen.js needs to be updated, nothing has changed with the companion scripts (they're add-ons anyway) See the Git hub for the freshest updates.
1427231905

Edited 1427232762
update v1.21: Urgent bug fix - Fixed an urgent bug for the added perception check that outright breaks 1.2 Only cgen.js needs to be updated, nothing has changed with the companion scripts (they're add-ons anyway) See the Git hub for the freshest updates.
Hello Ken, im really eager to use your script but when i upload the script it returns the error Unexpected token * And then stops all my scripts from working :/ unfortunately i know nothing about scripts to fix what im sure is a very tiny error
1427714935

Edited 1427718323
Sounds like it may be related to this issue. <a href="https://app.roll20.net/forum/post/1647248/unexpected-token#post-1749480" rel="nofollow">https://app.roll20.net/forum/post/1647248/unexpected-token#post-1749480</a> Disable all scripts but CGen to make sure. CGen should be relatively bug free as far as hard crashes are concerned.
Due to an update to the development server, CGen will not work on it (most if not all marcos that have roll values stored in them). I'm looking into it, the production server should be unaffected.
1428748415

Edited 1428749252
Hey Ken. Thank you so much for making this script! It's brilliant and is saving me so much time and makes combat flow a lot smoother.
Np! If you'd like to support this script you can buy some of the map packs form the contributing artists :)
CGen should once again work on the dev server as-is. Dev server is bleeding edge, so it's normal to expect hiccups like this. Living on the edge!
1431343351
Ken, these scripts are fantastic, and thank you. I do have a bit of a problem. I got them all working as intended in a test campaign, then transferred them to a working campaign. Everything was golden. The next day (yesterday) I logged into both campaigns and the CGen scripts weren't working in either. I paste the paizo info into the token, and then hit the macro and nada. Any ideas what might be happening, or if I did something wrong? I know it's a pretty open question, I just thought perhaps I am not the first. Thank you in advance. Don
1431346166
Gen Kitty
Forum Champion
When something like this happens, your first step should be to check your API Scripts page and see if there's errors. If no errors, hit 'Save Script' and try again. Scripts just sometimes have to be restarted, no real way around it.
Don H. said: The next day (yesterday) I logged into both campaigns and the CGen scripts weren't working in either. I paste the paizo info into the token, and then hit the macro and nada. Any ideas what might be happening, or if I did something wrong? I know it's a pretty open question, I just thought perhaps I am not the first. Thank you in advance. What kind of error are you getting? From what you described, it sounds like you're getting the unexpected token error which is detailed here: <a href="https://app.roll20.net/forum/post/1647248/unexpect" rel="nofollow">https://app.roll20.net/forum/post/1647248/unexpect</a>... I'm assuming creatures you've already generated work just fine, but that it's future generations that are failing (since the API engine is essentially down). Genkitty has the right idea, this is more of a roll20 API sandbox problem as opposed to the script itself. Re-saving the scripts and restarting the sandbox usually resolves this.
1431394552
I had a feeling that might be the issue. I push the CGen button and nothing happens...so what you said makes sense. Thanks!
1431394577
You too GenKitty!
1431471436
Hello again Ken. I deleted all of my scripts and macros and then replaced cgen.js and the macro posted to run it. I ran it and nothing happened. I am no programmer, so when I looked into the api scripts section, I saw this message and wondered if maybe I had gotten it before: Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info... For reference, the error message generated was: Unexpected token s