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

Another Nested Macro issue....

Hello All, 2 questions : 1-Can someone tell me why this ?{Quelle action ?|Défense Patiente,#Def-Patiente |Déplacement Aérien,#Depl-Aérien |Déluge de Coups,#Déluge-coups } doesn't work (only shows Défense patiente in the prompt box), while this ?{Which macro?|Attack,#use-sword |Defend,#use-shield } Works.... I don't get it....   2-And if the macros call are something like this : @{Scarabée|wtype}&{template:traits} @{Scarabée|charname_output} {{name=Déplacement aérien}} {{source=Race: Monk}} {{description=Vous pouvez dépenser [1 Point de Ki](! #Decrementation-Ki) pour utiliser l'action Se Désengager ou l'action Foncer via une action bonus au cours de votre tour, de plus votre distance de saut est doublée pour le tour.}} Can it be nested directly in replacement of the #Depl-Aérien call in the query ? If so what would be the correct syntax ? Thx for your help...
1662586414
timmaugh
Pro
API Scripter
Anything in the embedded macro that can be interpreted as part of the control characters for a query are going to be interpreted as if they are control characters for the query... In other words, all right brackets, pipes, and commas are going to move the query parsing into the next state... a right bracket will close the query prematurely, a comma will move you from key to value, and a pipe will move you to defining the next option. If you're going to embed, you'll have to replace those characters in the embedded macro with their HTML counterparts (|, ], ,) ...OR... Use Fetch and retrieve the macros *after* the query has resolved. Metascripts (all scripts, really) don't get involved until all of Roll20 parsing has finished... including getting a result from the query. So if you use a Fetch construction to retrieve the macro verbiage, you're basically hiding it while it is a part of the query (so that the characters don't break the query syntax), then retrieving it after. The net effect is you can use the macro as a stand-alone call (clicking on it directly), AND in your query. (If you tried to click on a macro with replaced HTML characters, it won't work as a straight call -- it would *have* to be passed through a query to give the HTML encoding time to unwrap.) In your case, your query would look like this if you used Fetch constructions: ?{Quelle action ?|Défense Patiente,#(Def-Patiente) |Déplacement Aérien,#(Depl-Aérien) |Déluge de Coups,#(Déluge-coups) }
Perfect ! those metascripts seem so complicated at the beginning, but finally they're such powerful tools to simplify all the logics that sometimes are not that logic at all lol. >Thanks again for your everytime's help.