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

Multiple level nesting attributes and trackers

Hi all, I want to select a token, which tracker numerical value is the name of an other entry in the turn order. For example, the token that is actually selected is called "guard". Its tracker value is 1. In the turn order, I also have an item called "1", that I want to execute the piece of code in. The idea is that I need to roll a rollable table to obtain a number from the selected token and store it in its tracker. This number is the key to identify which attribute to search for another target token. So, I select the "guard" token, roll my rollable table and obtain "1", that I place in guard's tracker. Then I want to use an ability on my macro mule ("M") called %{M|TEST}. This ability will ask to click on the target token (call it "dragon") and return the attribute of Dragon related to "1", which is Constitution (@{dragon|Constitution}). Here are my macro mule ability and myTurn Order : %{M|TEST} =@{M|pref_tracker}@{tracker|selected_token}}       (  where @{M|pref_tracker}=@{tracker|  ) Turn order guard 1 1 @{target|YOUR_TARGET|Constitution} 2 @{target|YOUR_TARGET|Dexterity} 3 @{target|YOUR_TARGET|Speed} selected_token @{M|pref_tracker}@{selected|token_name}} Here is my problem : Is there a way to nest multiple attributes in %{M|TEST} in order to make this code working ? @{M|pref_tracker}@{tracker|selected_token}} Hope I was clear enough, Many thanks
1617199253
timmaugh
Forum Champion
API Scripter
AFAIK, you can't do this short of using a script (and I see you're not a Pro subscriber). The order of operations would go look for the attribute calls at the same time. You could make it a multi step process if you had a table for each of your potential token mappings (all those like the dragon, where 1 = Constitution, etc.). (With a script, you could probably work a solution using ChatSetAttr and/or TokenMod, or with a meta script (Fetch) I'm about to release that extends the interface for retrieving things like this (including nesting them, as you want).)
Attribute calls are handled in multiple passes so your initial macro after the first pass becomes @{tracker|@{M|pref_tracker}@{selected|token_name}} which is breaking since it's looking for a tracker entry "@{M". To fix it you need the prefix to resolve later. Create   @{M|pref_m}   with a value of   @{M|  if you haven't already. Then %{M|TEST} can become @{M|pref_m}pref_m}pref_tracker}@{tracker|selected_token}} Which would resolve thusly @{M|pref_m}pref_m}pref_tracker}@{tracker|selected_token}} @{M|pref_m}pref_tracker}@{M|pref_tracker}@{selected|token_name}}} @{M|pref_tracker}@{tracker|guard}} @{tracker|1} @{target|YOUR_TARGET|Constitution}
1617235496
timmaugh
Forum Champion
API Scripter
A ha! I had not thought of the problem that way. Well done. Very clever.
Thank you both for your help. This is exactly what I needed! I had searched on the forum, but I had never succeeded in making multiple nestings. It will help me a lot thanks again!