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

Nesting Macro For Npc List

Hi, I'm trying different solutions to organize the stuff of my campaign. Watching a video on youtube I found a tutorial about nesting macros. I want to underline that I'm not yet expert in macros and templates and I'm learning how they work. To start and test the macro I have in mind I've done this: Using the default template I've created a list of NPC aspects: race, name, alignment, look, background etc Then I've made two separate macros for two NPC: Duaugur and Sivar (that are the names of the characters and even of the macros) I've made a third macro that I've called NPC-List. That macro is intendend to be present in the macro bar to access, by clicking on it, the list of NPC when I need to describe one of them to my players. So, the single macros Duaugur and Sivar work pretty good, but the list macro doesn't work. I think I've missed something from the tutorial, because I'm in the phase "copy macro text and do experiments". I've written the NPC-List macro in this form:  &{template:default} {{name=NPC-List}}{{Name=[Duaugur](! #Duaugur)[Sivar](!#Sivar)}} This is the result:  This is what I want, but there's one issue. The first name on the list, Duaugur is clickable and when I click on it the macro runs listing all the info about my NPC. But Sivar doesn't seems to work. When I hoover the cursor it takes the shape of a little hand, but when I click on it nothing happens. Any suggestion? Thanks.
1491701190

Edited 1491701280
When using macro inside of command buttons like this, you need to make sure that you have a put 
   between the ! and the #macro name. Your macro has one within the first command button, that is why it is displayed on two separate lines above. Try this macro &{template:default} {{name=NPC-List}}{{Name=[Duaugur](! 
 #Duaugur)[Sivar](! 
 #Sivar)}}
I was pretty sure that I've missed something. That works, thanks! Even if I haven't understood yet what's that mmmm "code" :D. I think it's something related to a prog language.  
1491705411
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
you need to put the html code for a line break after the "!" so that the macro doesn't just get eaten by the api command.
Kyle G. said: When using macro inside of command buttons like this, you need to make sure that you have a put 
   between the ! and the #macro name. Your macro has one within the first command button, that is why it is displayed on two separate lines above. Try this macro &{template:default} {{name=NPC-List}}{{Name=[Duaugur](! 
 #Duaugur)[Sivar](! 
 #Sivar)}} How where you able to post the ! & # 13 ; without the chat changing it to !#
1491934857
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
you simply double encode it (usually by encoding the &): } is encoded by }, so I'd write } (and wrote } to show the double escaped, and so on for each level of escaping).
Craven . said: Kyle G. said: When using macro inside of command buttons like this, you need to make sure that you have a put   between the ! and the #macro name. Your macro has one within the first command button, that is why it is displayed on two separate lines above. Try this macro &{template:default} {{name=NPC-List}}{{Name=[Duaugur](! #Duaugur)[Sivar](! #Sivar)}} How where you able to post the ! & # 13 ; without the chat changing it to !# By putting &#13 instead.