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

Spell Selection Macro

Greetings friends of roll20. First of all, I apologize if this post was already open, I am relatively new to this page (a couple of years) and my level of English is questionable. I can't find a "simple" way to do what I want. I've spent hours with it and I can't get it. Since currently in Roll 20 you can't create a custom compendium, I've made a character sheet to store my homebrew spells. I'd like to create a macro so my players can access homebrew spells in a similar way to the healing potion macros out there. So that clicking on the macro allows them to choose which list of spells they want to access, according to the level, and then the macro rolls the spell from the character sheet where it are stored. I give you an example through a montage of images. The problem is that I can't get past here: I can't get the spell macro to appear when selecting Dragon Claws, or both appear at the same time or the last line written appears. Also, I get the name of the spell as if I had written it in the chat. I hope you can help me, thank you very much.
1674556455

Edited 1674556548
Gauss
Forum Champion
If I am understanding correctly, you are nesting a calling one macro via a query in another macro. That won't work well without HTML entities, and even then it is a royal pain. The reason is when you put macro2 inside macro1 then the contents of macro2 are unpacked into macro1 when macro1 is ran. As a result, it breaks it.  I suggest using chat menus instead.  Have the player call the chat menu, it whispers the list of Dragon Claws spells to the player, then the player pushes the spell button they want.  I use a similar one for regular use, but it could be easily adapted to your setup if you want it. 
1674573008

Edited 1674573027
Eido
Pro
So it is not possible to do it? It's a pity... I wish roll20 would add the customized compendium...
1674577656
Gauss
Forum Champion
It assumes I understood you correctly. You seem to be trying to nest macros into a query. That is possible, as I said it would require HTML entities , but the level of difficulty involved is significant.   Chat menus are simpler, cleaner, and very easy to implement. 
1674580905
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Eido! If all you need is for the ability to add custom spells to a character sheet, I would suggest looking at ChatSetAttr. It should allow you to add all of the attributes that make up a spell. If you use a spreadsheet to parse the command, you can somewhat automate the process. Then create a  Chat Menu  to displays those macros so that they can add spells to a specific sheet. There are some simpler examples of that for inventory items  here .
Thanks very much both for your help. In the end I have done what Gauss has suggested, since I did not understand the other solution well. The problem is that the macro bar is going to be very long now hahaha.
1674604026

Edited 1674605728
Gauss
Forum Champion
Eido, if you describe the problem with the macro bar being long we could offer suggestions. The way I have spells set up the macro bar only has a single button.  This is how I have them set up:  Macro button creates the first output, chat menu buttons to push to select which spells are displayed.  Note: this step is only for spellcasters who can have a lot of spells...for spellcasters such as Rangers and Paladins I skip that step.  Then it displays the desired spells, the second output. Click on the desired spell name and it casts that spell.  The macro I am using also ignores any spell line that does not have a red dot on it.  Note: the color and appearance is just how I have them set up, you can change the color and appearance in a variety of ways (and have to if using Dark mode as those colors don't show up well in Dark mode).
As you say it looks great!  Could you copy me the code that you use for that macro? I was referring to this list: In the chat with the command it looks like this:
1674607944

Edited 1674609502
Gauss
Forum Champion
The main macro takes 23 pages of a word document, I tried to post it here but the webpage fought back. I can invite you to grab my Macro Mule instead.  Regarding your macros...generally it is best not to put them in the Collection tab, use the Attributes and Abilities tab on a character sheet.   The reasons for that are numerous but here are some of them:  1) Character sheet macros are portable (can be moved from game to game with the character sheet), thus you can create Macro Mules which greatly simplifies macro creation. 2) HTML entities work in Abilities but not Collection tab macros.  3) Writing for Ability macros is a bit simpler than Collection tab macros.  4) less clutter on the Collection tab. The macros are where they belong, on the character using them or the macro mule. 
1674609531

Edited 1674609550
Eido
Pro
yes, please... I tried but it didn't work like that for some reason
1674609674
Gauss
Forum Champion
Eido D. said: yes, please... I tried but it didn't work like that for some reason Invite sent
I'm In! Which is the mule?
Gauss said: Eido, if you describe the problem with the macro bar being long we could offer suggestions. The way I have spells set up the macro bar only has a single button.  This is how I have them set up:  Macro button creates the first output, chat menu buttons to push to select which spells are displayed.  Note: this step is only for spellcasters who can have a lot of spells...for spellcasters such as Rangers and Paladins I skip that step.  Then it displays the desired spells, the second output. Click on the desired spell name and it casts that spell.  The macro I am using also ignores any spell line that does not have a red dot on it.  Note: the color and appearance is just how I have them set up, you can change the color and appearance in a variety of ways (and have to if using Dark mode as those colors don't show up well in Dark mode). Does this macro play nice with the spell tracker API? How does this work with upcast spells and cantrips above base values? I'm looking to reduce the lag generated by multiple characters with large spell lists by creating spell mules and having the players use macros to access the spells for themselves. 
1677410662

Edited 1677410744
Gauss
Forum Champion
Tony S. said: Does this macro play nice with the spell tracker API? How does this work with upcast spells and cantrips above base values? I'm looking to reduce the lag generated by multiple characters with large spell lists by creating spell mules and having the players use macros to access the spells for themselves.  Works just fine with Spell tracker APIs, it doesn't do anything to change how spells work, all it does is list them, then when you press the name of the spell it is the same as if you had clicked the spell name on the spell page.  Could you describe the situation where you are getting lag due to spells? Your spell mule idea seems it would cause more lag, not less. 
It's a well known issue that sheets with lots of spells cause lag within Roll20, and not just for the owner of that sheet. I have read that having a spell mule and loading all the spells to that sheet and then use macros that the players use to cast their spells helps to fix the issue. The problem is, I have not found how to make a macro that references information on one sheet (spell data) and then uses the players character for all variable info (cantrip damage, save DC, attack roll, etc.) I was hoping your macro could help resolve this. Gauss said: Tony S. said: Does this macro play nice with the spell tracker API? How does this work with upcast spells and cantrips above base values? I'm looking to reduce the lag generated by multiple characters with large spell lists by creating spell mules and having the players use macros to access the spells for themselves.  Works just fine with Spell tracker APIs, it doesn't do anything to change how spells work, all it does is list them, then when you press the name of the spell it is the same as if you had clicked the spell name on the spell page.  Could you describe the situation where you are getting lag due to spells? Your spell mule idea seems it would cause more lag, not less. 
1678584475

Edited 1678585476
Gauss
Forum Champion
Tony S. said: It's a well known issue that sheets with lots of spells cause lag within Roll20, and not just for the owner of that sheet. I have read that having a spell mule and loading all the spells to that sheet and then use macros that the players use to cast their spells helps to fix the issue. The problem is, I have not found how to make a macro that references information on one sheet (spell data) and then uses the players character for all variable info (cantrip damage, save DC, attack roll, etc.) I was hoping your macro could help resolve this. Gauss said: Tony S. said: Does this macro play nice with the spell tracker API? How does this work with upcast spells and cantrips above base values? I'm looking to reduce the lag generated by multiple characters with large spell lists by creating spell mules and having the players use macros to access the spells for themselves.&nbsp; Works just fine with Spell tracker APIs, it doesn't do anything to change how spells work, all it does is list them, then when you press the name of the spell it is the same as if you had clicked the spell name on the spell page.&nbsp; Could you describe the situation where you are getting lag due to spells? Your spell mule idea seems it would cause more lag, not less.&nbsp; That "well known issue" was before the Lazy Loading update. Since that update I haven't seen the lag from character sheets having lots of spells nor have I seen reports of it caused by character sheets with lots of spells. I run three groups and at least one character in each group has many spells (clerics, druids, etc). Lazy Loading also fixed it so that sheets did not get loaded until you loaded them. That also fixed the "not just for the owner of the sheet" issue since it no longer loads every sheet in the game for every player. My suggestion would be to do the spells the normal method, test that out. See if there is some level of slowdown.&nbsp; Edit: found the link to the Lazy Loading update:&nbsp;<a href="https://blog.roll20.net/posts/operation-fire-bolt-improved-load-times/" rel="nofollow">https://blog.roll20.net/posts/operation-fire-bolt-improved-load-times/</a>