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

variables, flags, or anything else to make macros flexible?

1583033453

Edited 1583034337
So nested macros don't actually work because special characters break everything and HTML replacements break every time I update anything. So I can't use a roll query to call different macros for different attack modes or anything like that. And it also breaks when they are nested within the same macro. So is there any way to set information with a roll query that is transmitted somewhere else? There's not much point in using a macro if every possible variable has to be manually adjusted with roll queries anyway. Or am I screwed because the GM won't use a sheet? edit: as a side problem, is there any way to append to an existing roll template to keep things clean?
1583035540

Edited 1583036136
vÍnce
Pro
Sheet Author
Macros cannot write attribute data. ;-( You can use macros to read attribute data, perform mathematical calculations, roll dice, post text, and handle some miscellaneous functions like adding a token to the turn tracker.  Character sheets primarily are there to facilitate the manipulation of attributes easier.  You can still handle most of a given game system's mechanics without a sheet by manually editing attributes combined with custom macros.  Queries have some serious limitations as you have mentioned.  Chat menus are probably a better option for most users, but you will still need to create a finite number of options. If your GM is Pro, you can use an API script like ChatSetAttr to read/write attribute data. Everyone has access to the default template, but it is very basic and non-rpg/system specific.  Another option is to choose a sheet for the game just to have access to it's roll template.  You don't have to actually use the sheet, but your macros can.
1583036730
GiGs
Pro
Sheet Author
API Scripter
exelsisxax said: So nested macros don't actually work because special characters break everything and HTML replacements break every time I update anything. So I can't use a roll query to call different macros for different attack modes or anything like that. And it also breaks when they are nested within the same macro. I'm sensing some very understandable frustration with the macro system! I'd follow Vinc4e's suggestion and look into Chat Menus. they are a great way to get the benefit of nested macros (access to multiple related macros) without actually having to write nested macros.  That said, nested macros can work. If you post some of the macros you've tried to work we (or more likely Ziechael, lol) may be able to get them working for you.
1583054268
Dumbhuman
Pro
Marketplace Creator
What I've done for games where the GM doesn't have character sheets is to more or less construct my own version of a sheet by using macros to store values for ability modifiers and then referencing those in other macros.  To get around the problem of updating the macros, I have a text file saved with all the relevant macros which I edit using Notepad++ when changes are needed so that I can always quickly search/replace and copy/paste to not worry about my HTML replacements being lost forever.  You can even use the macro functionality of Notepad++ to set it up to do the HTML character replacement for you automatically on a selection with just a keystroke command.  Here's an example of a file I have to store/edit Roll20 macros for a character named Tad: #TADPROFmod 6 #TADSTRmod 2 #TADDEXmod 2 #TADCONmod 2 #TADINTmod 0 #TADWISmod 5 #TADCHAmod 2 #TADSpellDC [[#TADWISmod + #TADPROFmod + 8]] #TADSave /em ?{Save| Dexterity, gets [[1d20 + #TADDEXmod + ?{Modifier|0}]] (or [[1d20 + #TADDEXmod + ?{Modifier|0}]]) on a Dexterity save! | Constitution, gets [[1d20 + #TADCONmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCONmod + #TADPROFmod + ?{Modifier|0}]]) on a Constitution save! | Wisdom, gets [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]]) on a Wisdom save! | Strength, gets [[1d20 + #TADSTRmod + ?{Modifier|0}]] (or [[1d20 + #TADSTRmod + ?{Modifier|0}]]) on a Strength save! | Charisma, gets [[1d20 + #TADCHAmod + #TADPROFmod ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) on a Charisma save! | Intelligence, gets [[1d20 + #INTmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + ?{Modifier|0}]]) on an Intelligence save!} #TADSkill /em ?{Skill| Perception, gets [[1d20 + #TADWISmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]]) on a Perception check! | Investigation, gets [[1d20 + #INTmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + ?{Modifier|0}]]) on a Investigation check! | Acrobatics, gets [[1d20 + #TADDEXmod + ?{Modifier|0}]] (or [[1d20 + #TADDEXmod + ?{Modifier|0}]]) on an Acrobatics check! | Athletics, gets [[1d20 + #TADSTRmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADSTRmod + #TADPROFmod + ?{Modifier|0}]]) on an Athletics check! | Stealth, gets [[1d20 + #TADDEXmod + ?{Modifier|0}]] (or [[1d20 + #TADDEXmod + ?{Modifier|0}]]) on a Stealth check! | Arcana, gets [[1d20 + #INTmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + #TADPROFmod + ?{Modifier|0}]]) on an Arcana check! | Animal Handling, gets [[1d20 + #TADWISmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + ?{Modifier|0}]]) on an Animal Handling check! | Deception, gets [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) on a Deception check! | History, gets [[1d20 + #INTmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + ?{Modifier|0}]]) on a History check! | Insight, gets [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]]) on an Insight check! | Intimidation, gets [[1d20 + #TADCHAmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + ?{Modifier|0}]]) on an Intimidation check! | Medicine, gets [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]]) on a Medicine check! | Nature, gets [[1d20 + #INTmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + ?{Modifier|0}]]) on a Nature check! | Performance, gets [[1d20 + #TADCHAmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + ?{Modifier|0}]]) on a Performance check! | Persuasion, gets [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) on a Persuasion check! | Religion, gets [[1d20 + #INTmod + ?{Modifier|0}]] (or [[1d20 + #INTmod + ?{Modifier|0}]]) on a Religion check! | Sleight of Hand, gets [[1d20 + #TADDEXmod + ?{Modifier|0}]] (or [[1d20 + #TADDEXmod + ?{Modifier|0}]]) on a Sleight of Hand check! | Survival, gets [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + ?{Modifier|0}]]) on a Survival check!} #TADAttack*** /em ?{Attack| Shillelagh, gets [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]]) on a Shillelagh attack! | Ray of Frost, gets [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]]) on a Ray of Frost attack! | Thorn Whip, gets [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]] (or [[1d20 + #TADWISmod + #TADPROFmod + 2 + ?{Modifier|0}]]) on a Thorn Whip attack! | Staff, gets [[1d20 + #TADSTRmod + #TADPROFmod + 2 + ?{Modifier|0}]] (or [[1d20 + #TADSTRmod + #TADPROFmod + 2 + ?{Modifier|0}]]) on a Staff attack! } #TADDamage*** /em ?{Attack| Shillelagh, does [[?{Damage Type|Standard, 1d8|Critical, 2d8} + #TADWISmod + ?{Modifier|0}]] bludgeoning damage from the Shillelagh attack! | ShillelaghBoom, does [[?{Damage Type|Standard, 1d8|Critical, 2d8} + #TADWISmod + ?{Modifier|0}]] bludgeoning damage from the Shillelagh attack and [[?{Damage Type|Standard, 3d8|Critical, 6d8} + #TADWISmod + ?{Modifier|0}]] thunder damage from Booming Blade! The target is sheathed in booming energy and will take more damage if using movement before the end of the next turn! | Ray of Frost, does [[?{Damage Type|Standard, 4d8|Critical, 8d8} + #TADWISmod + ?{Modifier|0}]] cold damage from the Ray of Frost attack and the target's speed is reduced by 10 until the next turn! | Thorn Whip, does [[?{Damage Type|Standard, 4d6|Critical, 8d6} + ?{Modifier|0}]] piercing damage from the Thorn Whip attack and pulls the target up to 10 feet closer! } #TADSaveCantrips /em ?{Cantrip| Sacred Flame, casts Sacred Flame. Target must make a DC #TADSpellDC Dexterity save or take [[4d8 + #TADWISmod + ?{Modifier|0}]] radiant damage! | Toll the Dead, casts Toll the Dead. Target must make a DC #TADSpellDC Wisdom save or take [[?Wounded|Yes, 4d8|No, 2d8}4d12 + #TADWISmod + ?{Modifier|0}]] necrotic damage! } #Boom /em does [[4d8 + ?{Modifier|0}]] thunder damage when Booming Blade triggers! | #MagicMissile /em ?{Spell Slot| 1st, shoots forth 3 Magic Missiles! (1st level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 2nd, shoots forth 4 Magic Missiles! (2nd level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 3rd, shoots forth 5 Magic Missiles! (3rd level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 4th, shoots forth 6 Magic Missiles! (4th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 5th, shoots forth 7 Magic Missiles! (5th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 6th, shoots forth 8 Magic Missiles! (6th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 7th, shoots forth 9 Magic Missiles! (7th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 8th, shoots forth 10 Magic Missiles! (8th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! | 9th, shoots forth 11 Magic Missiles! (9th level spell slot) [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] [[1d4+1]] force damage! } #SteelWindStrike /em unleashes a Steel Wind Strike, attacking up to 5 targets in the blink of an eye! First target: [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) dealing [[6d10]] (crit: [[12d10]]) force damage! Second target: [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) dealing [[6d10]] (crit: [[12d10]]) force damage! Third target: [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) dealing [[6d10]] (crit: [[12d10]]) force damage! Fourth target: [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) dealing [[6d10]] (crit: [[12d10]]) force damage! Fifth target: [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCHAmod + #TADPROFmod + ?{Modifier|0}]]) dealing [[6d10]] (crit: [[12d10]]) force damage! #TADHealingWord /em ?{Spell Slot| 1st, speaks arcane words to heal [[1d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (1st level spell slot) | 2nd, speaks arcane words to heal [[2d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (2nd level spell slot) | 3rd, speaks arcane words to heal [[3d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (3rd level spell slot) | 4th, speaks arcane words to heal [[4d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (4th level spell slot) | 5th, speaks arcane words to heal [[5d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (5th level spell slot) | 6th, speaks arcane words to heal [[6d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (6th level spell slot) | 7th, speaks arcane words to heal [[7d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (7th level spell slot) | 8th, speaks arcane words to heal [[8d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (8th level spell slot) | 9th, speaks arcane words to heal [[9d4 + #TADWISmod + ?{Modifier|0}]] hit points and end one spell affecting the target. (9th level spell slot) } #TADSpiritGuardians /em ?{Spell Slot| 3rd, is surrounded by Spirit Guardians slowing enemy movement and dealing [[3d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (3rd level spell slot) | 4th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[4d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (4th level spell slot) | 5th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[5d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (5th level spell slot) | 6th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[6d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (6th level spell slot) | 7th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[7d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (7th level spell slot) | 8th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[8d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (8th level spell slot) | 9th, is surrounded by Spirit Guardians slowing enemy movement and dealing [[9d8]] radiant damage. DC #TADSpellDC Wisdom save for half damage. (9th level spell slot) } #TADConcentrationCheck /em gets [[1d20 + #TADCONmod + #TADPROFmod + ?{Modifier|0}]] (or [[1d20 + #TADCONmod + #TADPROFmod + ?{Modifier|0}]]) on a Constitution save to maintain concentration! #TADInitiative /em gets [[?{Roll Type|Standard, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1}+ #TADDEXmod + ?{Modifier|0}| &{tracker} ]] for initiative! Hopefully those help spark some ideas for you.  When leveling up, I'd have to update the proficiency and ability macros, but I certainly wouldn't have to rewrite everything.  I typically included a query asking for a modifier just in case I wanted to manually account for some bonus or penalty on the fly and I used to query about advantage/disadvantage as well before realizing it was much quicker to simply put both rolls up and use the one on the left if it was a straight roll. 
GiGs said: exelsisxax said: So nested macros don't actually work because special characters break everything and HTML replacements break every time I update anything. So I can't use a roll query to call different macros for different attack modes or anything like that. And it also breaks when they are nested within the same macro. I'm sensing some very understandable frustration with the macro system! I'd follow Vinc4e's suggestion and look into Chat Menus. they are a great way to get the benefit of nested macros (access to multiple related macros) without actually having to write nested macros.  That said, nested macros can work. If you post some of the macros you've tried to work we (or more likely Ziechael, lol) may be able to get them working for you. I CAN get nested roll queries to work, but they break every time I re-open them and it's not worth going through all the time. Chat menus don't seem to be a viable solution for me, I need to be able to use roll queries too often. The problem isn't having 20 options to choose from, it is that the rolls themselves need to be flexible.
1583086664

Edited 1583086691
GiGs
Pro
Sheet Author
API Scripter
exelsisxax said: I CAN get nested roll queries to work, but they break every time I re-open them and it's not worth going through all the time. Chat menus don't seem to be a viable solution for me, I need to be able to use roll queries too often. The problem isn't having 20 options to choose from, it is that the rolls themselves need to be flexible. The simple solution there: don't reopen them! More seirously, Ik now the system sucks, but there are ways around it. The best way is to create a character purely to hold these macros (call it Macros), and save your macros as Abilities on the that character sheet. You can open Abilities without the html entities being erased. If you make this character Editable by players, but dont set it as Visible to players, you can give the pcs links to those Abilities so they can use them, but the character sheet doesnt appear in their journal so they cant actually edit it. If you set the character sheet up this way, you can also create standard macros to call them, and share those macros with the players for easier activation. 
1583088170
vÍnce
Pro
Sheet Author
As per GiGs suggestion, the gm can create a "macro mule" character(<a href="https://app.roll20.net/forum/permalink/5924364/" rel="nofollow">https://app.roll20.net/forum/permalink/5924364/</a>) to prevent the special characters from auto-converting when editing.&nbsp; I actually have a macro character for players and another for my gm macros.&nbsp; Makes it easier to transfer between games as well...