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 .
×

[3.5]Spell macro

Hello everyone! I'm curious. Is it possible to make a dropdown query to make list of all spells and execute them from spell tab in Character Sheet? repeating_spells_$0_spellname11 seems to work fine but repeating_spells_$1_spellmacro11 is't /w gm ?{choose a spell | @{repeating_spells_$0_spellname11}, @{repeating_spells_$0_spellmacro11} | @{repeating_spells_$1_spellname11}, @{repeating_spells_$1_spellmacro11} } Since I tried every way to get rid of errors, nothing is working. Every time I get different result. Even if I make a dropdown work, spell macros give me only name of called macros :(
So after some exploration, this is possible... But also not. The problem lies within how roll20 pulls up other macros. You see, the text within @{repeating_spells_$1_spellmacro11} contains special characters (like } ) which, when it parses, thinks that the query command is ending. You'd have to go into the original macro and replace any } symbols with  &#125  and any | symbols with  &#124 . I do believe, if you did that, it should work.
As i said before: Since I tried every way to get rid of errors, nothing is working Changing of brackets does't actually "run" macro but only display their names instead. As I know, you only change problematic characters within other one. Since I don't have any other roll query it is not necessary.
1510231493

Edited 1510232061
It doess't matter whitch syntax I choose,, it simply don't work. @&#12*3;repeating_spells_$0_spellmacro11&#12*5; @&#3*8;#12*3;repeating_spells_$0_spellmacro11&#3*8;#12*5; @&am*p;#12*3;repeating_spells_$0_spellmacro11&am*p;#12*5; &#6*4;&#12*3;repeating_spells_$0_spellmacro11&#12*5; Every time I get:  @{repeating_spells_$0_spellmacro11} as output. Without html entities it doesn't work at all. Macro stops with error:  No character was found for 'repeating_spells_$0_spellmacro11&#12*5; ' TypeError: Cannot read property 'substring' of undefined *I had to add star cuz server change it for @ & {  } ;)
1510236182

Edited 1511175297
Ziechael
Forum Champion
Sheet Author
API Scripter
What Keiss was saying is that you need to change the offending characters in the called macro. Your original query is fine: /w gm ?{choose a spell | @{repeating_spells_$0_spellname11}, @{repeating_spells_$0_spellmacro11} | @{repeating_spells_$1_spellname11}, @{repeating_spells_$1_spellmacro11} } But in the sheet, for the spell macro field, you'll need to change the , | and } there as required for nested queries. For example if you add the default level 0 divine spell of 'cure minor wounds' you get the following macro auto-populated: &{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) }} You'd need to change that &nbsp;macro to read: &{template:DnD35StdRoll&amp;#125; {{spellflag=true&amp;#125;&amp;#125; {{name=@{character_name} &amp;#125;&amp;#125; {{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> ).&amp;#125;&amp;#125; {{School:= Conj(Healing)&amp;#125;&amp;#125; {{Level:= Cleric 0&amp;#125;&amp;#125; {{Cmpnts:=V&amp;#44;S&amp;#125;&amp;#125; {{Casting Time:=1 std action&amp;#125;&amp;#125; {{Range:= Touch&amp;#125;&amp;#125; {{Target:= Creature touched&amp;#125;&amp;#125; {{Duration:= Instantaneous&amp;#125;&amp;#125; {{Saving Throw:= Will Save(half) when used vs Undead&amp;#125;&amp;#125; {{Spell Resist.:= Undead can use spell resistance&amp;#125;&amp;#125; {{ Caster level check: = [[1d20+@{casterlevel}+@{spellpen}]] vs spell resistance.&amp;#125;&amp;#125; {{compcheck= Conc:[[{1d20 +[[@{concentration}]] &amp;#125;&gt;?{Concentration DC=15+Spell Level or 10+Damage Received&amp;amp;#124;16&amp;amp;#125;]] &amp;#125;&amp;#125; {{succeedcheck=Success! She casts her spell!&amp;#125;&amp;#125; {{failcheck=She fails :( &amp;#125;&amp;#125; {{notes= ?{Recipient's name&amp;amp;#124;@{target|character_name}&amp;amp;#125; receives 1 heath (or 1 point of damage if an undead creature) &amp;#125;&amp;#125; Then the query used to call it won't break at the first , | or } it finds in the macro... hope that helps.
Hell YES! It works! It was so obvious... I can't believe I didn't think of that. Well thanks for help :) However with yours corrected spell i get only 4 rows of macro: test casts Cure Minor Wounds . School: Conj(Healing) Level: Cleric 0 I figure it out macro stops at "comma" &nbsp; as well, I've changed them to &#44 and it works fine :) Thanks once more :D
1510240443
Ziechael
Forum Champion
Sheet Author
API Scripter
You are most welcome, its a steep curve but worth the climb ;)
Sorry I wasn't super clear before! Glad you were able to get it sorted out, though :)
1510310281
Ziechael
Forum Champion
Sheet Author
API Scripter
werkaldegim said: I figure it out macro stops at "comma" &nbsp; as well, I've changed them to &#44 and it works fine :) Gah, I always forget to replace the comma in the components sections lol! Consider it a test that you passed ;)