Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[3.5e] Generating Spell Roll Macros with PCGen

Hi everyone, I have started DMing on Roll20 very recently and it is great so far, but setting up D&D 3.5 spell macros for PC's and NPC's has been quite tedious (especially with cleric/druid spell lists). I am a big fan of PCGen for character sheet management and decided to create a custom outputsheet that creates roll20 macros for every spell on a characters spell list. I think the result is quite helpful, so i am posting it here: #Spell Outputsheet for Roll20 D&D 3.5 Spell Roll Templates #Save this file as "csheet_roll20_rollscripts.txt.ftl" #Copy file into outputsheets/d20/fantasy within your PCGen directory #Use Pcgen export (Ctrl + Shift + P) and select this outputsheet under "Export to: Text" #Feedback welcome under Roll20.net DMokun &lt;@loop from=0 to=pcvar('COUNT[SPELLBOOKS]-1') ; spellbook &gt; &lt;@loop from=pcvar('COUNT[SPELLRACE]') to=pcvar('COUNT[SPELLRACE]+COUNT[CLASSES]-1') ; class &gt; &lt;@loop from=0 to=9 ; level &gt; &lt;@loop from=0 to=pcvar('COUNT[SPELLSINBOOK.${class}.${spellbook}.${level}]')-1 ; spell &gt;&lt;#assign range = pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.RANGE') /&gt;&lt;#assign sr = pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.SR')/&gt;&{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name}}} {{subtags=casts &lt;#if (pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.SOURCELINK') != "")&gt;[&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.NAME"/&gt;](&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SOURCELINK"/&gt;)&lt;#else&gt;&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.NAME"/&gt;&lt;/#if&gt;}} {{School:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SCHOOL"/&gt;&lt;#if (pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.SUBSCHOOL') != "")&gt; [&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SUBSCHOOL"/&gt;]&lt;/#if&gt;}} {{Level:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.CLASS"/&gt; ${level}}} {{Comp'nts:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.COMPONENTS"/&gt;}} {{Casting Time:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.CASTINGTIME"/&gt;}} {{Range:=&lt;#if range?lower_case?starts_with("close")&gt; Close ([[25+5*floor(@{casterlevel}/2)]]ft.)&lt;#else&gt;&lt;#if range?lower_case?starts_with("medium")&gt; Medium ([[100+10*@{casterlevel}]]ft.)&lt;#else&gt;&lt;#if range?lower_case?starts_with("long")&gt; Long ([[400+40*@{casterlevel}]]ft.)&lt;#else&gt;${range}&lt;/#if&gt;&lt;/#if&gt;&lt;/#if&gt;}} {{Target:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.TARGET"/&gt;}} {{Duration:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.DURATION"/&gt;}} &lt;#if (pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.SAVEINFO') != "None")&gt;{{Saving Throw:=&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SAVEINFO"/&gt; (DC [[ @{spelldc${level}} ]])}} &lt;/#if&gt;&lt;#if sr?lower_case == "yes"&gt;{{Spell Resist.:=${sr} }} {{Caster level check: = [[ 1d20+@{casterlevel2}+@{spellpen} ]] vs spell resistance.}}&lt;/#if&gt;{{compcheck= Conc: [[ {1d20 + [[ @{concentration} ]] }&gt;?{Concentration DC=15+Spell Level or 10+Damage Received|16} ]] }} {{succeedcheck=The spell is cast successfully.}} {{failcheck=The spell fizzles without effect.}} {{notes=&lt;#if (pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.EFFECT') != "")&gt;&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.EFFECT"/&gt;&lt;#else&gt;&lt;#if (pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.DESC') != "")&gt;&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.DESC"/&gt;&lt;#else&gt;&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.DESC2"/&gt;&lt;/#if&gt;&lt;/#if&gt; (&lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SOURCESHORT"/&gt; &lt;@pcstring tag="SPELLMEM.${class}.${spellbook}.${level}.${spell}.SOURCEPAGE"/&gt;)}} &lt;/@loop&gt; &lt;/@loop&gt; &lt;/@loop&gt; &lt;/@loop&gt; Output for an example spell looks like this (Acid Splash, Wizard cantrip): &{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name}}} {{subtags=casts [Acid Splash](<a href="http://www.d20srd.org/srd/spells/acidSplash.htm" rel="nofollow">http://www.d20srd.org/srd/spells/acidSplash.htm</a>)}} {{School:=Conjuration [Creation]}} {{Level:=Wizard 0}} {{Comp'nts:=V, S}} {{Casting Time:=1 standard action}} {{Range:= Close ([[25+5*floor(@{casterlevel}/2)]]ft.)}} {{Target:=One missile of acid}} {{Duration:=Instantaneous}} {{compcheck= Conc: [[ {1d20 + [[ @{concentration} ]] }&gt;?{Concentration DC=15+Spell Level or 10+Damage Received|16} ]] }} {{succeedcheck=Spell cast successfully.}} {{failcheck=The spell fizzles.}} {{notes=Orb deals 1d3 acid damage. (PH p.196)}} The result is of course not perfect, but a majority of the spell descriptors (e.g. Range, Duration, Targets, etc.) are filled correctly. The effect description is the weakest part, since the short descriptions offered by PCGen are very coarse. However, I would argue that this is also the part that is usually adapted to fit individual needs. Give it a try for your own spell lists and if you have any suggestions or feedback, please let me know Cheers, DMokun
1468398003

Edited 1468398010
Ziechael
Forum Champion
Sheet Author
API Scripter
Niiiiice. I'm a big fan of innovative laziness, I myself having developed several google sheet formulas for quickly throwing together powercards to avoid the tedium of multiple spells for the divine classes. I love how simple yours is to implement and the output is great for any and all users as a base for their spells. Like you rightly point out the description is a bit weak... BUT... that is a good thing, it gives the mechanics which allows those who care chance to expand on that with some flavour while leaving it simple and useful for those who just want the effect without the flavour :) Great work!
1468436869
Diana P
Pro
Sheet Author
Thank you for this&nbsp; DMokun ! I am going to toss a link to this thread in my 3.5 spell collection document for easier finding! :) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1469167601
Andrew C
Marketplace Creator
This will save me a bunch of headaches for sure.
Can you do this for 5e
It depends... PCGen seems to have data for 5e spells and the field names (RANGE, DURATION, etc.) are the same. Do 5e character sheets use spellmacros like the 3.5 one? (Something like "&{template:DnD5StdRoll} {{spellflag=true}} {{name=@{character_name}}} {... " )
I've downloaded PCGen in order to use this but it didn't work. I've tried to do just as you said, to copy the script into a txt file, name it and place it in the appropriate directory, but when I try to open the&nbsp;txt&nbsp;output sheet, I only see your script. What am I missing here?&nbsp; Thanks!
What kind of Caster are you creating? For classes that do not have automatic access to their complete spell list (e.g. wizards, sorcerers, bards) you need to select the known spells in the Spells Tab first.
I've managed. Had some troubles with the ftl ending but I figured it out. Thanks a lot and great job!
Yeah, that is a bit weird about PCGen. The file ending sets the document generation engine (in this case .ftl for freemarker) and the second file ending (.txt) is the filetype used for the output file.