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 .
×
🍵 What is a cleric’s favorite hot drink? Divini-tea. 🍵
Create a free account

[AD&D 2e Simple Sheet] Using macros from sheet in other macros

Hello. I'm using the AD&D 2e simple character sheet and I've been having a problem incorporating the saving throw macros from the sheet itself into another macro. I was trying to build a simple macro where a player selects their token, and then clicks a button, which opens a dropdown menu, from which they can select which saving throw they want to roll. I thought that rather than doing it from scratch, I could use the macros that are already embedded into the sheet. I got the name of the buttons (roll_petsave and such) by inspecting the code, but they aren't recognized by Roll20 as it states they are not an ability (And true enough, when you open the 2e Simple Sheet on the Attributes & Abilities page, the Attributes side is full and Ability page is empty) - is there a way to use those macros, or should I just type up my own versions?
1581167577
Gold
Forum Champion
I use that AD&D 2E Simple Sheet too. I want to make a custom version that's more simpler. Have not tried to do what you're asking so I don't know exactly. I just remember there is a different way to %call-for-sheet-rolls as opposed to how you can #Call-A-Regular-Macro So yes i think there is a coding answer for what you are asking. And it is probably in the Roll20 wiki if someone else hasn't answered it yet.
That's what I meant by "Abilities" - the % call is supposed to grab the "Ability" from the sheet - however, for some reason, despite all those working buttons being in the sheet, the "Abilities" are empty, which causes my issue.
1581177030

Edited 1581177048
Not sure if this will help with your specific goal, but assuming a character sheet macro is named "hit1", to call that macro in a separate Ability you can create the new Ability under the Ability tab and type this in: %{selected|hit1} Or if the Ability was going to be for a specific character named Bob you could also do: %{Bob|hit1}
1581181573
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There is a difference between sheet abilities and custom abilities. The ones you got from the code are there, they just don't display on the attributes and abilities tab. That tab is meant for custom user abilities. The ones from the sheet code are, well, hard-coded into the sheet. My guess the reason they are not working is that you need to ignore the "roll_" part of the ability name. That's the case with attribute calls pulled from the code, at least. For your example, try: %{petsave} or %{charactername|petsave} depending on where you are calling them from. If you give us the code you are using, and tell us where that code is stored, we can give you more guidance. There are too many ways to write it otherwise. This post contains some more examples of putting the commands into buttons.
1581205983
GiGs
Pro
Sheet Author
API Scripter
Krisnan said: I got the name of the buttons ( roll_petsave and such) by inspecting the code, but they aren't recognized by Roll20 as it states they are not an ability  Others have answered well. I just wanted explain this part a bit more. The  roll_  part is not actually part of the name, it is in indicator that the name following is a roll button. So the ability above is actually called petsave.   When you create a roll on a character sheet, you start the name with roll_ to tell the system that this is a button, and then the roll20 backend knows how to treat it - letting you drag it as a button to your macro bar, or use certain macros to access it. If you look at the code you can see a similar thing with attributes. They are all named like name="attr_Strength"  : the attr_ part is to tell the system that this is an attribute, but once in game, you dont use the attr_ part, you access it with just @{Strength}. Hope that helps!
Thank you for explaining the difference between custom and sheet abilities! It does seem to be a good step forwards - although my code seems to be wrong still. Rather than showing all 5 saving throws in the dropdown, it shows the first one and then "+0" - and when I select the first one, the saving throw macro is firing, asking for the misc bonus - but then it breaks This is what I wrote: ?{Which type of Saving Throw? | Poison Paralyzation or Death Magic, %{selected|parsave} | Rod or Staff, %{selected|rodsave} | Petrification or Polymorphy, %{selected|petsave} | Breath Weapon, %{selected|breathsave} | Spell, %{selected|spsave} } And this is the output: /gmroll {1d20+[[>13 [Save vs. Paralyzation, Poison, or Death Magic]| Rod or Staff, /gmroll {1d20+0}>11 [Save vs. Rod, Staff, or Wand] | Petrification or Polymorphy, /gmroll {1d20+0}>12 [Save vs. Petrification or Polymorph] | Breath Weapon, /gmroll {1d20+0}>15 [Save vs. Breath Weapon] | Spell, /gmroll {1d20+0}>12 [Save vs. Spell]}
1581225272

Edited 1581237360
GiGs
Pro
Sheet Author
API Scripter
This is a classic roll20 macro problem. When you have a macro that calls all other macros, you likely imagine the order going something like: macro 1 runs, presents a menu listing several macros You pick an option, and then that macro runs In roll20 thats not how it works. What actually happens is You launch a macro roll20 scans the macro for all other macros, and loads them as text within the main macro you now have a bunch of commas, } and | symbols, and the roll20 doesnt know there are multiple macros here, and tries to interpret it as one macro See Advanced Usage For Roll Queries in the wiki for more details. You have to be really careful with commas and other characters in queries. You have two options to solve this problem, one really hard (the one described in the wiki, using html entities to replace problem characters) and one really easy method. The easy method is Chat Menus : you leave the submacros alone, and change your initial dropdown to a chatmenu, like so &amp;{template:default} {{name=Saving Throws}} {{[Poison Paralyzation or Death Magic](~selected|parsave) [Rod or Staff]( ~ selected|rodsave) [Petrification or Polymorphy]( ~ selected|petsave) [Breath Weapon]( ~ selected|breathsave) [Spell](~selected|spsave) }} This should all be one line - i put a linebreak at the end of the first line for clarity. The syntax can be more complicated depending on where the macro you are calling is. the simplest is as above: [Spell](~selected|spsave) But if that doesnt work, try (though I dont think this shuld be needed): [Spell](!&amp;#13;&amp;#37;{selected|spsave}) And for universal macros, not abilities, use [Spell]( !&amp;#13;# spsave) This is covered on the wiki here:&nbsp; <a href="https://wiki.roll20.net/API:Chat#Entering_API_Buttons_In_Chat" rel="nofollow">https://wiki.roll20.net/API:Chat#Entering_API_Buttons_In_Chat</a>
That Chat menu thing is not something I've seen before, but it works PERFECTLY! (Although I'll have to tell my players not to all click on the macro button and just use the chat menu, but I can deal with that). Thank you very much! And sorry for asking what must have been asnwered dozens of times before. You were also correct about how I imagined the macros working - like calling a function in a program - this is much more messier than I thought. Well, thank you once again!
1581237494
GiGs
Pro
Sheet Author
API Scripter
You're welcome, and yes, this question comes up a LOT, hehe. It's probably the number one issue that pops up when people start getting ambitious with macros.&nbsp;
1581269038
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That was a really clear explanation of the html substitution issue, GiGs.
1581291685
GiGs
Pro
Sheet Author
API Scripter
Thanks, I've had a lot of practice explaining it :)