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.5 spells in character sheet. want to call them as a Macro for a button on the map screen

Usually i use the dice button name ex @{selected|weapon1attackmacro} for an attack button shown as select token button.  so the question is on the spells the dice button for all the spell has the same name  "repeating_spell01_#_spellcast01".  so how to i do this??
1529915933

Edited 1529915962
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi Joel, check out this  wiki entry for the full details. Effectively you need to know the row id of a repeating field, either by its unique reference or using the $0, $1, $2 etc index locator :)
&lt;div data-reprowid=" -LFIXv9GUt2-mghtBq6t "&gt;&lt;div&gt;&lt;button&gt;#&lt;/button&gt;&lt;a&gt;≡&lt;/a&gt;&lt;/div&gt;&nbsp; &nbsp; This is my identifier????? so how to write the macro &lt;table style="width: 350px"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;input type="text" style="width: 25px" name="attr_spellused01" title="repeating_spells01_#_spellused01"&gt;/&lt;input type="text" style="width: 25px" name="attr_spellprep01" title="repeating_spells01_#_spellprep01"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" style="width: 120px" name="attr_spellname01" title="repeating_spells01_#_spellname01" value="Cure Minor Wounds"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" style="width: 20px" name="attr_spelllevel01" title="repeating_spells01_#_spelllevel01" value="0"&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea rows="1" cols="55" style="height: 20px ; width: 150px" name="attr_spellmacro01" title="repeating_spells01_#_spellmacro01 : Edit this field to create the macro run by the roll button"&gt;&amp;{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{subtags=casts [Cure Minor Wounds](<a href="http://www.dandwiki.com/wiki/Cure_minor_wounds" rel="nofollow">http://www.dandwiki.com/wiki/Cure_minor_wounds</a> ).}} {{School:= Conj(Healing)}} {{Level:= Cleric 0}} {{Cmpnts:=V,S}} {{Casting Time:=1 std action}} {{Range:= Touch}} {{Target:= Creature touched}} {{Duration:= Instantaneous}} {{Saving Throw:= Will Save(half) when used vs Undead}} {{Spell Resist.:= Undead can use spell resistance}} {{ Caster level check: = [[ 1d20+@{casterlevel}+@{spellpen} ]] vs spell resistance.}} {{compcheck= Conc: [[ {1d20 + [[ @{concentration} ]] }&gt;?{Concentration DC=15+Spell Level or 10+Damage Received|16} ]] }} {{succeedcheck=Success! She casts her spell!}} {{failcheck=She fails :( }} {{notes= ?{Recipient's name|@{character_name}} receives 1 heath (or 1 point of damage if an undead creature) }} &lt;/textarea&gt; &lt;/td&gt; &lt;td&gt;&lt;button type="roll" name="attr_spellcast01" title=" repeating_spells01_#_spellcast01" value="@{spellmacro01}" style="height: 24px ; width: 20px"&gt;&lt;/button&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@{selected|repeating_spells01_-LFIXv9GUt2-mghtBq6t_spellcast01}???????is this right&nbsp; &nbsp; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;
ok this is now working&nbsp; @{selected|repeating_spells01_-LFIXv9GUt2-mghtBq6t_spellcast01} Ok now how do i put a string of theese together using a drop down menu or netting macro button??????????
1529953601

Edited 1529954157
Ziechael
Forum Champion
Sheet Author
API Scripter
You'd be best off using the index: @{selected|repeating_spells01_$0_spellcast01} &nbsp;is row 1 of that section @{selected|repeating_spells01_$1_spellcast01} is row 2 of that section @{selected|repeating_spells01_$2_spellcast01} is row 3 of that section @{selected|repeating_spells01_$3_spellcast01} is row 4 of that section etc etc Putting them into a query can be problematic since the default templates contain a lot of characters that require html replacements. Doing it with buttons in chat as you allude to is definitely the best way and you'd have something like (untested due to putting the kids to bed, will take a better luck later): ?{Spell|@{selected|repeating_spells01_$0_spellname01},[Cast](~selected&amp;#124;repeating_spells01_$0_spellcast01)|@{selected|repeating_spells01_$1_spellname01},[Cast](~selected&amp;#124;repeating_spells01_$1_spellcast01)}
1529954292

Edited 1529954438
Ziechael
Forum Champion
Sheet Author
API Scripter
If you want to avoid the html entities (in the example above it is replacing the pipe '|' in the ~selected|repeating...) from disappearing should you choose to edit the macro again in the future I would recommend saving it as a character ability rather than a global macro.
1529977015

Edited 1529980826
&nbsp;funny i copy your code it runs once then stops...&nbsp; &nbsp; should i replace all pipes with &#1 2 4;&nbsp; &nbsp; ?? im under char ability but drop down menu is getting all garbled (code in menu) ?{Spell |@{selected|repeating_spells01_$0_spellname01},[Cast](~selected|repeating_spells01_$0_spellcast01)|@{selected|repeating_spells01_$1_spellname01},[Cast](~selected|repeating_spells01_$1_spellcast01)|@{selected|repeating_spells01_$2_spellname01},[Cast](~selected|repeating_spells01_$2_spellcast01)|@{selected|repeating_spells01_$3_spellname01},[Cast](~selected|repeating_spells01_$3_spellcast01)|@{selected|repeating_spells01_$4_spellname01},[Cast](~selected|repeating_spells01_$4_spellcast01)|@{selected|repeating_spells01_$5_spellname01},[Cast](~selected|repeating_spells01_$5_spellcast01)|@{selected|repeating_spells01_$6_spellname01},[Cast](~selected|repeating_spells01_$6_spellcast01)|@{selected|repeating_spells01_$7_spellname01},[Cast](~selected|repeating_spells01_$7_spellcast01)|@{selected|repeating_spells01_$8_spellname01},[Cast](~selected|repeating_spells01_$8_spellcast01)|@{selected|repeating_spells01_$9_spellname01},[Cast](~selected|repeating_spells01_$9_spellcast01) }
1530007020
Ziechael
Forum Champion
Sheet Author
API Scripter
Hmm, yes, I ran into the same problem and couldn't find a way around it lol... I don't use the in sheet elements for my casters personally in my 3.5e game so hopefully someone more experienced at this way of doing it will stop by... sorry.
1530007291
Ziechael
Forum Champion
Sheet Author
API Scripter
Here is&nbsp; a thread where this is discussed at length , | also list my method there although if I could do it all over again I'd do it slightly &nbsp;differently but thats neither here nor there lol.