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

D&D 3.5 - Issues with Spell List Macro

1594447690

Edited 1594455596
So I am attempting to make a universal stacked spells macro. Spells Button > Spell Levels > Spells of that level > Cast spell I got the Level 0, and Level 1 working. Now I am trying to work on Level 2, and it is giving me grief. I included a screenshot to help show the issue. This is the base macro I am using, it is broken up for ease of reading. /w @{selected|character_name} &{template:DnD35StdRoll} {{name=Level 2 Spells}} {{subtags= Save DC is [[@{selected|spelldc2}]]}} {{[@{selected|repeating_spells_$0_spellname11}](~selected|repeating_spells_$0_spellcast11)=[@{selected|repeating_spells_$1_spellname11}](~selected|repeating_spells_$1_spellcast11)}}    this continues until a toal of 20 potential spells will be displayed. EDIT: I saw in another post that the |repeating_spells portions should actually be |repeating_spells11 , unfortunately that did not fix the issue either. :/  So, the formatting seems to be working, but when I test the macro it is showing all the spell names as "Doom" even though the selected character has 5 level 2 spells that have names entered. Any help would be appreciated. Thanks :)
1594467712

Edited 1594468280
Oosh
Sheet Author
API Scripter
Okay so it looks like the way the fields go is this: Level 0 Divine: @{repeating_spells01_$0_spellname01}, @{repeating_spells01_$1_spellname01}, @{repeating_spells01_$2_spellname01}..... Level 0 Arcane: @{repeating_spells02_$0_spellname02}, @{repeating_spells02_$1_spellname02}, @{repeating_spells02_$2_spellname02}...... Level 1 Divine: @{repeating_spells11_$0_spellname11}, @{repeating_spells11_$1_spellname11}, @{repeating_spells11_$2_spellname11}..... Level 1 Arcane: @{repeating_spells12_$0_spellname12}, @{repeating_spells12_$1_spellname12}, @{repeating_spells12_$2_spellname12}...... Level 2 Divine:@{repeating_spells21_$0_spellname21}, @{repeating_spells21_$1_spellname21}, @{repeating_spells21_$2_spellname21}..... Level 2 Arcane: @{repeating_spells22_$0_spellname22}, @{repeating_spells22_$1_spellname22}, @{repeating_spells22_$2_spellname22}..... and so on. So repeating_spells<spell level><divine:1/arcane:2> all the way down. Don't forget the numbers after the field you're calling also need to be the same, @{repeating_spells 21 _$0_spellname 21 }. Unless you're putting a query in you probably don't need the HTML entities either: |. So this should work, hopefully: /w @{selected|character_name} &{template:DnD35StdRoll} {{name=Level 2 Spells}} {{subtags= Save DC is [[@{selected|spelldc2}]]}} {{[@{selected|repeating_spells21_$0_spellname21}](~selected|repeating_spells21_$0_spellcast21)=[@{selected|repeating_spells21_$1_spellname21}](~selected|repeating_spells21_$1_spellcast21)}}
1594498007

Edited 1594504555
Divine Spells 1 is the area that is acting up, the rest of them are working as they should. I have tried : {{[@{selected|repeating_spells11_$0_spellname11}](~selected|repeating_spells_$0_spellcast11)}} this is as the numbering system would suggest, but it just displays the text, and says there is no attribute for it and {{[@{selected|repeating_spells_$0_spellname11}](~selected|repeating_spells_$0_spellcast11)}} this one is how it is displayed when I hover over the input box, but it won't display the information that is entered in those slots, only the default spell info
1594500297
Ziechael
Forum Champion
Sheet Author
API Scripter
Ahh, I remember this, level 1 divine spells has a slightly different naming convention: Level 0: repeating_spells01_#_spellname01 Level 1: repeating_spells_#_spellname11 Do you have any divine spells? If not, then the default value will be the Doom entry. From your screen shot it looks like you are using the Arcane section so for level 2 you'd use: repeating_spells22_#_spellname22 As Oosh mentioned above.
I have players that cast arcane and others that cast divine, but they laid out their spells in a way that uses both areas level 0 divine area has their level 0 spells, level 0 arcane area has their level 1 spells level 1 divine area has their level 2 spells, level 1 arcane area has their level 3 spells level 2 divine area has their level 4 spells, level 2 arcane area has their level 5 spells level 3 divine area has their level 6 spells, level 3 arcane area has their level 7 spells level 4 divine area  has their level 8 spells, level 4 arcane area has their level 9 spells There are spells currently in the level 1 divine area, with their corresponding macros in as well, that one section is just ignoring the data that has been put in those fields and is using the default spell instead. So if I had a divine caster that had laid out all the spells in the divine column, it still would be pulling the default data for them. I can cast the spell from their sheet and it does what it should.
1594514264
Oosh
Sheet Author
API Scripter
There's something screwy going on with that section: The Value field is not updating, it's still Doom. Exporting the sheet as a JSON, the Spellname is correctly stored under the row id: So, I can correctly call the two Spellnames with this: @{selected|repeating_spells_-MC-N5ScC381OXdq2-ki_spellname11} @{selected|repeating_spells_-MC-N3CnH5JyQcHljTU1_spellname11} But the $0 and $1 ids do not work for the Divine 1 section. Someone with more sheet knowledge might be able to figure out why.
1594517703

Edited 1594517940
GiGs
Pro
Sheet Author
API Scripter
Oosh, it showing Doom there doesnt mean anything. It's just showing the default value. If you change the name of any other spell and check in the html for it, it'll show the default not the updated name. I tried this and its working properly for me. I just tried it by pasting this directly into chat [@{selected|repeating_spells_$1_spellname11}](~selected|repeating_spells_$1_spellcast11) and it correctly showed the imaginary spell "Blasting Fist" I'd put in the $1 slot, and launched the correct button. I quickly mocked up a menu of buttons and tried again: The above is the test output I put in the blasting fist spell button. Nick, can you post the exact text of your spells menu button macro, so I can try to figure out why its not working for you but is for me. Here's the chat macro I used to get the buttons: &{template:default} {{name=@{selected|character_name}'s Chat Menu}} {{spells = [@{selected|repeating_spells_$0_spellname11}](~selected|repeating_spells_$0_spellcast11) [@{selected|repeating_spells_$1_spellname11}](~selected|repeating_spells_$1_spellcast11)}}
1594526284

Edited 1594527004
Oosh
Sheet Author
API Scripter
Well I found the problem with the sheet on mine. It started counting at $5 instead of $0. This was a new game, blank character sheet, no spells previously created or removed. I've now made another one and it started at $0. No idea why. So Nick, maybe try something as simple as: @{selected|repeating_spells_$0_spellname11} @{selected|repeating_spells_$1_spellname11} @{selected|repeating_spells_$2_spellname11} @{selected|repeating_spells_$3_spellname11} @{selected|repeating_spells_$4_spellname11} @{selected|repeating_spells_$5_spellname11} @{selected|repeating_spells_$6_spellname11} @{selected|repeating_spells_$7_spellname11} @{selected|repeating_spells_$8_spellname11} and keep counting up until you find the first spell. Interestingly, I've just added some more spells to other spell levels on the new character sheet I made. I now have this: It seems a blank/default repeating entry is being added to Divine 1 every time a spell is added to another level? An absent field should be outputting the string, like $3, $4 and $5. EDIT - Yes indeedy - I've only added two Divine 1 spells, never deleted any, but added some level 0, 2 and 3 spells in between (chronologically that is) and got this: 4 Dooms added in between. Is this a bug, or an "impending doom" gag? Pretty funny if it's the latter! As for a universal macro - that's gonna be difficult, Nick. If you're willing to use Stylus (or your players all are, more to the point) it'd be reasonably easy to hide all the Doom entries (though if you have the actual Doom spell you'd need to modify the code or it'll also be hidden). If you have a character with loads of spells added to other levels in between changing out Divine 1 spells, there could be a considerable number of Dooms!
1594534191
GiGs
Pro
Sheet Author
API Scripter
That's good detective work, Oosh. I checked mine, and I have an extra 3rd and 4th row too ($2 and $3). I check via script, there are no attributes assigned to these rows. Then I created some new rows and didnt get any more mysterious rows, so it's not happening whenever you create a new row. I then deleted all rows, and now had the mysterious shadow rows at $0 and $1. I then created a single spell, and in the print out it occupied position $2. I then created a new character from scratch, and added one spell to the Divine Level 1 section, and ran Oosh's macro that checks up to row $8, and had 2 spells, at rows $5 and $6. None at position $0. I created a third character and didnt get any mysterious extra rows. Buttons worked normally. So something weird is going on with the repeating_spells section, and I don't know why. 
1594534333
GiGs
Pro
Sheet Author
API Scripter
Oosh said: It seems a blank/default repeating entry is being added to Divine 1 every time a spell is added to another level? An absent field should be outputting the string, like $3, $4 and $5. That's an interesting theory. So it might have something to do with the fact that the section is called repeating_spells, when every other section has repeating_spells as part of its name. If so, the sheet would need that section renaming to fix it - and a sheet worker to migrate all existing attributes to the new section name.
1594536010
Oosh
Sheet Author
API Scripter
I dunno. I just click on random stuff and take screenshots like a well-trained monkey, you're the clever sheet architect :) One day I might go digging into the sheets properly, but (as you pointed out with my barking up the wrong HTML tree above) for now the innards of those repeating sections remain a mystery to me. Ziechael said: Ahh, I remember this, level 1 divine spells has a slightly different naming convention: How long ago is this memory from? Are we talking years? Is there some different functionality for Divine 1 spells?
1594538490
GiGs
Pro
Sheet Author
API Scripter
Oosh said: Ziechael said: Ahh, I remember this, level 1 divine spells has a slightly different naming convention: How long ago is this memory from? Are we talking years? Is there some different functionality for Divine 1 spells? I believe this sheet was one of the first sheets made, so it's been around a while. The divine 1 spell name suggests to me that there was one repeating_spells section for all levels, and at some point a section was added for every level, but the divine 1 spell name wasnt changed. It was just the one chosen to take the original repeating section name.
1594542759
GiGs
Pro
Sheet Author
API Scripter
I've just submitted a sheet update, to change the repeating section name of divine level spells from repeating_spells to repeating_spells11. The attributes in that section will be migrated to the new section. You'll have to change macros to point tp the new section name. Hopefully this fixes the issue. The sheet update wont go live till Tuesday or wednesday.
1594581905
Diana P
Pro
Sheet Author
Thanks GiGs, The reason that it had not been fixed earlier was because I hadn't wanted to break everyone's macros.
1594602825
GiGs
Pro
Sheet Author
API Scripter
That's a good reason. Honestly it should have been fine, I cant see why this glitch is happening. I think it is something to do with the underlying mechanics of roll20's repeating sections which we cant do anything about, and you couldnt have anticipated.
Been busy with house repairs, will read through and try the suggestions later tonight. Thanks everyone. :)
Okay, finally was able to read through everything and give it another run through.  /w @{selected|character_name} &{template:DnD35StdRoll} {{name=Level 2 Spells}} {{subtags= Save DC is [[@{selected|spelldc2}]]}} {{[@{selected|repeating_spells11_$0_spellname11}](~selected|repeating_spells11_$0_spellcast11)=[@{selected|repeating_spells11_$1_spellname11}](~selected|repeating_spells11_$1_spellcast11)}} ...... is what I have right now and it is working! No more errors or multi-dooms! Thanks everyone for figuring out was going on and taking steps to fix it. I appreciate it!
1595140470
Oosh
Sheet Author
API Scripter
Nice to know it's all fixed! Now to find something else to break...