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

Embedded Macro Choices

Hi Macro guru's   I need help please (I don't have access to use API's) I want to use one macro inside another. Easy you say, that is what I thought till I tried this. Now this maybe an issue if your character sheets aren't set like mine, but hopefully you will understand. First I have created (copied) a macro using the weapon macro from when you add a weapon to your weapon list in the character sheet - Macro= HC [@{selected|wtype}&{template:atk} {{mod=+0}} {{rname=[Hand Crossbow](~-LA8AyInJ6fNsdC5_fgj|repeating_attack_-LA8DXLzilIewPdlZts5_attack_dmg)}} {{rnamec=[Hand Crossbow](~-LA8AyInJ6fNsdC5_fgj|repeating_attack_-LA8DXLzilIewPdlZts5_attack_crit)}} {{r1=[[@{Korth|d20}cs>20 + -2[DEX] + 2[PROF]]]}} @{Korth|rtype}cs>20 + -2[DEX] + 2[PROF]]]}} {{range=}} {{desc=}} {{spelllevel=}} {{innate=}} @{Korth|global_attack_mod} ammo= @{Korth|charname_output}] (This works perfectly when testing this on it's own) Then I want to embed that macro #HC into the next macro Macro= Attack-Options /me makes his at @{target|AC} AC using his ?{Weapon attack | Morning Star,#MS | Hand Crossbow,#HC} The results in this being displayed: "James makes his attack at Grakus - 27 AC using his #HC" Also, if I do this in the Attack-Options macro: /me makes his attack at @{target|token_name} - @{target|AC} AC using his #HC It works perfectly. It is only when I try to embed it in a choice. Any help would be appreciated. Thanks
Seems to be just the same thing like in my thread. Html entities..
1524267151

Edited 1524273752
I haven't used HTML entities....
1524278392

Edited 1524278515
Which is the problem.  When a macro is called from within a macro, that called macro gets 'interpreted' and certain entities get stripped out.  So you need to use HTML substitutions so that the interpreter puts those entities in.  There is information about it in the help wikia. What I do to simplify things, is instead of embedding macros into queries, I have a macro that spews some chat buttons that call the macros, this tends to sidestep the interpreter problem as you don't actually embed a macro, rather you call it.
1524282603
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Or write your macros as character abilities.
Aranador said: Which is the problem.  When a macro is called from within a macro, that called macro gets 'interpreted' and certain entities get stripped out.  So you need to use HTML substitutions so that the interpreter puts those entities in.  There is information about it in the help wikia. I tried understanding HTML, and I don't think I am advanced enough. What I do to simplify things, is instead of embedding macros into queries, I have a macro that spews some chat buttons that call the macros, this tends to sidestep the interpreter problem as you don't actually embed a macro, rather you call it. How do you set this up to spew button?  Do you have a link to an example? Thanks Aranador
keithcurtis said: Or write your macros as character abilities. My issue with this is..... I can't find the names of all the abilities that are required. Or how to setup up the boxes like how it looks when you do a weapon attack. I see what they use in the original calls on a weapon or attack template, but I don't know how to incorporate that into a macro. Thanks keithcurtis for your reply
Ah,, sorry James had not checked back on this thread - here is a very simple 'macro spew' from one of my characters. /w aranador-uthar &{template:default} {{name=At Will Powers}} {{MBA=[MBA](~Uthar Wulfson|Melee-Basic)}} {{RBA=[RBA](~Uthar Wulfson|Ranged-Basic)}} {{Ardent Strike=[Ardent](~Uthar Wulfson|Ardent-Strike)}} {{Holy Strike=[Holy](~Uthar Wulfson|Holy-Strike)}} Note that this whispers to me using my player name in that campaign, a series of buttons that call macros set in that character.  Hopefully the general idea is clear enough for you to adapt it to your purposes.
1524466275

Edited 1524466391
Aranador said: Ah,, sorry James had not checked back on this thread - here is a very simple 'macro spew' from one of my characters. /w aranador-uthar &{template:default} {{name=At Will Powers}} {{MBA=[MBA](~Uthar Wulfson|Melee-Basic)}} {{RBA=[RBA](~Uthar Wulfson|Ranged-Basic)}} {{Ardent Strike=[Ardent](~Uthar Wulfson|Ardent-Strike)}} {{Holy Strike=[Holy](~Uthar Wulfson|Holy-Strike)}} Note that this whispers to me using my player name in that campaign, a series of buttons that call macros set in that character.  Hopefully the general idea is clear enough for you to adapt it to your purposes. Hey Aranador Still learning Iis (~Uthar Wulfson|Ardent-Strike) another macro you have saved? If so do you have a copy of that macro, so I can learn and change. And do you need ' ~ ' in front of the name? and to purpose? Thanks again  :)
Yes, the (~Uthar Wulfson|Ardent-Strike) is a call to another macro within the character.  It can be any macro, what it is doesnt matter, just that it is there to be called, so you can make it anything you like.  The important thing is, that Uthar Wulfson is the character, Ardent-Strike is a macro in that character's ability page, and the tilda character tells the parser that you are about to call a character ability macro.  The initial macro I pasted, should actually work just fine if you just change the initial whisper to be yourself, although none of the buttons will successfully work, as they'll just produce an error message, until you change them to the right links, and have macros for them to call.  These buttons can even call menus of more buttons or anything you like.
Aranador said: Yes, the (~Uthar Wulfson|Ardent-Strike) is a call to another macro within the character.  It can be any macro, what it is doesnt matter, just that it is there to be called, so you can make it anything you like.  The important thing is, that Uthar Wulfson is the character, Ardent-Strike is a macro in that character's ability page, and the tilda character tells the parser that you are about to call a character ability macro.  The initial macro I pasted, should actually work just fine if you just change the initial whisper to be yourself, although none of the buttons will successfully work, as they'll just produce an error message, until you change them to the right links, and have macros for them to call.  These buttons can even call menus of more buttons or anything you like. Thanks  Aranador When you say within the character.... does that mean their character sheet? Yes I did the minor change of the whisper, but the tilda character abilities confused me. 
Yes, their character sheet - Even if you have not loaded a fancy character sheet, all characters will have a tab for abilities and attributes, and you can define macros there.  This particular button call macro I have given will work for any character sheet, or even none, as all it uses are the default template and basic macros - no APIs or anything. You could call macros from the global macro list too, although off the top of my head I cant remember if you prefix those with the AT symbol or the HASH symbol or who knows maybe something else.
1524545742
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
(~charactername|ability) calls an ability (macro) on a character sheet. The call can be made from within a character sheet, a macro on the collections tab, or even from an ability within another character sheet. The great advantages to building your campaign's macros as character abilities are that you can transmogrify the whole set from one campaign to another, and that they rarely have to deal with html entity replacements, which plague users trying to include macros within roll templates. "Ability" is essentially another name for a macro built into a character sheet.