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

[Help] Storing/transferring variables to simplify the spell adding process in Dnd35StDRoll template

I am in a campaign where the DM has decided to use the Dnd35StDRoll template, we have to create a lvl 12 char, meaning that you have to add a lot of spells. I modified the given template:


&{template:DnD35StdRoll} {{spellflag=true}} {{name= @{character_name} casts SPELLNAME }} {{School:=SCHOOL}} {{Level: =LVL}} {{Comp'nts:=COMP}} {{Casting Time:= CT}} {{Range:= RANGE ft or RANGE_0,3048m)}} {{Target:= TARGET}} {{Duration:= DURATION min.}} {{Saving Throw:= SAVE_EFFECT (DC=SPELL_DC) }} {{Spell Resist.:= SR }} {{  Caster level check: = [[1d20+@{casterlevel2}+@{spellpen}]] vs spell resistance.}} {{compcheck= Conc:[[{1d20 +[[@{concentration}]] }>?{Concentration DC=15+Spell Level or 10+Damage Received|16}]] }} {{succeedcheck=Success! She casts her spell!}} {{failcheck=She fails :( }} {{notes=NOTES).}}

I changed all variables that are in the formula to capital letter values because I would like to make the macro more copy/paste friendly ideally it should be like:

SPELLNAME="test"
&{template:DnD35StdRoll} {{spellflag=true}} {{name= @{character_name} casts SPELLNAME }} {{School:=SCHOOL}} {{Level: =LVL}} {{Comp'nts:=COMP}} {{Casting Time:= CT}} {{Range:= RANGE ft or RANGE_0,3048m)}} {{Target:= TARGET}} {{Duration:= DURATION min.}} {{Attack Roll:=ATKRL}} {{Damage:=DMGROLL}} {{Saving Throw:= SAVE_EFFECT (DC=SPELL_DC) }} {{Spell Resist.:= SR }} {{ Caster level check: = [[1d20+@{casterlevel2}+@{spellpen}]] vs spell resistance.}} {{compcheck= Conc:[[{1d20 +[[@{concentration}]] }>?{Concentration DC=15+Spell Level or 10+Damage Received|16}]] }} {{succeedcheck=Success! She casts her spell!}} {{failcheck=She fails :( }} {{notes=NOTES).}}

So my question is: how do you store the value "test" into the variable SPELLNAME for the duration of the macro. Is this possible? 
February 05 (9 years ago)
Diana P
Pro
Sheet Author
I'm sorry, I'm not quite understanding what you are trying to do. 

You can set up Attributes on the Attributes and Abilities tab and refer to those with the syntax: @{attributename} (also @{selected|attributename} and @{target|target1|attributename} depending on how you are using it).   You can put in queries with the syntax ?{Query|default answer} and those can be reused later in the same macro (assuming you want the same answer).  But the macro system does not really have true variables. 

More on the the wiki about macros and dice.

The Roll Template is basically a fancy way of displaying the roll/macro information.  It has a little bit of logic to allow it to display certain elements (crit/fumble) when some condition is met and hide them otherwise, but that's basically it.
Ah thats too bad,

What I was trying to achieve was to make the rolls more clear (at least in my eyes). By using the generalized macro as shown above, so each spell would look like this example:

SPELLNAME=Dream
SCHOOL=Illusion
LVL=5
RANGE=unlimited
(etc.etc you get it)


&{template:DnD35StdRoll} {{spellflag=true}} {{name= @{character_name} casts SPELLNAME }} {{School:=SCHOOL}} {{Level: =LVL}} {{Comp'nts:=COMP}} {{Casting Time:= CT}} {{Range:= RANGE ft or RANGE_0,3048m)}} {{Target:= TARGET}} {{Duration:= DURATION min.}} {{Attack Roll:=ATKRL}} {{Damage:=DMGROLL}}  {{Saving Throw:= SAVE_EFFECT (DC=SPELL_DC) }} {{Spell Resist.:= SR }} {{  Caster level check: = [[1d20+@{casterlevel2}+@{spellpen}]] vs spell resistance.}} {{compcheck= Conc:[[{1d20 +[[@{concentration}]] }>?{Concentration DC=15+Spell Level or 10+Damage Received|16}]] }} {{succeedcheck=Success! She casts her spell!}} {{failcheck=She fails :( }} {{notes=NOTES).}}
instead of putting the values inside the whole macro lines I could easily add them at the top.
So in this case the spellname that has to be used in the macro is Dream. school illusion etc.

 This makes the macro more userfriendly. It does not add any functionality whatsoever.

Too bad this is not (yet) implemented in the macro system. 

Thanks for the quick response!

February 05 (9 years ago)
My recommendation:
&{template:DnD35StdRoll} {{spellflag=true}} {{name= @{character_name} casts SPELLNAME }} {{School:=SCHOOL}} {{Level: =LVL}} {{Comp'nts:=COMP}} {{Casting Time:= CT}} {{Range:= RANGE ft or RANGE_0,3048m)}} {{Target:= TARGET}} {{Duration:= DURATION min.}} {{Attack Roll:=ATKRL}} {{Damage:=DMGROLL}}  {{Saving Throw:= SAVE_EFFECT (DC=SPELL_DC) }} {{Spell Resist.:= SR }} {{  Caster level check: = [[1d20+@{casterlevel2}+@{spellpen}]] vs spell resistance.}} {{compcheck= Conc:[[{1d20 +[[@{concentration}]] }>?{Concentration DC=15+Spell Level or 10+Damage Received|16}]] }} {{succeedcheck=Success! She casts her spell!}} {{failcheck=She fails :( }} {{notes=NOTES).}}
  1. Paste the above into Notepad++
  2. Replace placeholder text (ignore "?#"): (?1SPELLNAME)(?2SCHOOL)(?3LVL)(?4COMP)(?5CT)(?6RANGE)(?7TARGET)(?8DURATION)(?9ATKRL)(?10DMGROLL)(?11SAVE_EFFECT)(?12SPELL_DC)(?13SR)(?14NOTES)
  3. Open the Replace menu (i.e. Ctrl-H)
  4. Tick Match case
  5. Tick Regular expression
  6. Find what : (SPELLNAME)|(SCHOOL)|(LVL)|(COMP)|(CT)|(RANGE)|(TARGET)|(DURATION)|(ATKRL)|(DMGROLL)|(SAVE_EFFECT)|(SPELL_DC)|(SR)|(NOTES)
  7. Replace with : [modified version (step #2) of] (?1SPELLNAME)(?2SCHOOL)(?3LVL)(?4COMP)(?5CT)(?6RANGE)(?7TARGET)(?8DURATION)(?9ATKRL)(?10DMGROLL)(?11SAVE_EFFECT)(?12SPELL_DC)(?13SR)(?14NOTES)
  8. Replace all