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

Cannot get Max attributes with @{target }

@{target|bar1}/@{target|bar1|max} HP It seems when I put this in a macro to get the current/total hp of a token it asks for target: target and then target:bar1. Is this working as intended?
OK Just writing this out made me think about it, and I solved my own problem. @{target|1|bar1}/@{target|1|bar1|max} HP works. Apparently there is another argument in @{target}. Cool.
1387606428

Edited 1387606535
Gauss
Forum Champion
I have confirmed this. I will ask the Devs about it. As a workaround you can get to the max by doing this: @{target|target|bar1|max} Edit: Our workarounds appear to be similar. :)
Now when I save them it removes the target|1 and adds an extra } at the end @{target|target|bar1}/@{target|targetbar1|max} turns into @{target|target|bar1}/@{bar1|max}}
1387609394
Gauss
Forum Champion
Yup, thats odd. In testing the following appeared to work fine: /w GM @{target|bar1}/@{target|maximum|bar1|max} which turns into (and works): /w GM @{target|bar1}/@{bar1|max}
I put in yours @{target|bar1}/@{target|maximum|bar1|max} And I get @{target|bar1}/@{bar1|max}} (which works as long as your don't resave it with this syntax) But this way asks for Target:Target and Target:Maximum. So I tried this again @{target|target|bar1}/@{target|target|bar1|max} and I get this @{target|target|bar1}/@{bar1|max}} (which again works as long as you don't save this syntax) so it works but ... its weird and I can't resave it.
Sorry if I save them and use them it sends to chat: 40/bar|max} (40 is the bar1 value)
1387622137

Edited 1387622658
you should be able to use @{target|HP|bar1} / @{target|HP|bar1|max}. but at the moment it is bugged, and removes the second target|HP|, leaving the @{bar1|max} and adding another } to the end. the bug here is that it reformats itself incorrectly upon saving. this is easily repeatable, by making a macro that targets max value of any attribute or bar and saving it. this is how I believe it should work: basically, it means you have to name your target to pull a max value (this is true of any max value, whether a bar or an attribute). its not clearly stated in the wiki (at last check) but the format for pulling a target value is {target|value} for a simple check on current value of a single target, and to allow for multiple targets in a single macro there is a naming convention. By adding a name to a target you end up with this: {target|name|value} so, by putting in {target|value|max} you are actually naming the target value and searching for the value of max, which is incorrect. I have found that it is a good habit to name ALL your target checks as you make macros, as this get you in the habit of doing it correctly for more complex checks. as a side-note, using multiple targets in not documented, but entirely possible. you can use target to pull in opposed skill checks as needed, by using target rather than selected to allow for very quick and easy management of things like bluff vs sense motive, sleight of hand vs spot, intimidate vs level check, and so on. by having it use two targets (skillName and target or vs are my preferences for opposed checks such as these) you simply click the macro and then select your first target, then the target rolling the opposed check. very nice and tidy, especially in a gm whisper that puts it into one easy to read line. an example(in use in my current d20 game): /w DM @{target|sleight of hand|token_name}'s sleight of hand [[1d20+@{target|sleight of hand|sleight-of-hand}+@{target|sleight of hand|dex}]] vs @{target|vs|token_name}'s spot [[1d20+@{target|vs|spot}+@{target|vs|wis}]] as you can see, you can use spacing in your target names, and it is simple enough to make them descriptive, as it will print the target name when asking you for that target, making it easy to know which target you are currently picking. of course, that example requires the targets to have the relevant stats on their journal sheets, but I find that if you work with a template it is easy enough to make sure that each character has every skill even if at skill level 0 on their sheets.
Thanks michael. But really all you did with @{target|HP|bar1} / @{target|HP|bar1|max} was change Target:target to Target:HP what I was pointing out was after the program converts the macro to the second format @{target|HP|bar1} / @{bar1|max}} you cannot edit the macro unless you re-enter the original @{target|HP|bar1|max} or it results in showing the bar1 valur/bar1|max You're entire entry is kinda summing up what gauss and I already wrote.
1387653761

Edited 1387653978
Riley D.
Roll20 Team
The full syntax for @target is: @{target|&lt;target_name&gt;|&lt;attribute_name&gt;|&lt;optional_flags&gt;} For convenience, you can do a two-argument version of it like so: @{target|&lt;attribute_name&gt;} When you do that, it assumes that the "target_name" is just "target". However, if you want to use the optional flags (like "max"), you must use the 4-argument version because with 3 arguments it will assume the second argument is the target name and the 3rd is the attribute name. So the simplest way to use "max" would be: @{target|target|&lt;attribute_name&gt;|max} I added an "Advanced Usage" section to the wiki the explains this with examples: <a href="https://wiki.roll20.net/Macros#Using_a_Targeted_To" rel="nofollow">https://wiki.roll20.net/Macros#Using_a_Targeted_To</a>...
Is it possible without API do have a variable on the amount of targets, like they do 3x3 square that has either 2-3-4 different guys in there but if there is only 2 they need a way to targeting after that and not do the 3rd and 4th
1387763759
Gauss
Forum Champion
Stephen , Im not sure what you are asking.