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

Setting max attributes with ChatSetAttr?

I'm trying to make a query that sets max hp for the selected character. I think the following should work: !setattr --silent --sel --hp_max|?{Max HP?} But it doesnt seem to recognize hp_max for some reason. Setting hp works fine with the same command. Am I missing something or does setattr not work with _max attributes? Anybody knows a workaround?
What character sheet are you using?  The D&D 5E sheet doesn’t have a separate attribute for max hit points for example. The reference for the max value of an attribute is another vertical pipe, such as @{selected|hp|max}.  Y ou’d need to use --hp||?{Max HP?} if my memory serves me correctly on the syntax. 
ChatSetAttr  sets the max value for an attribute with another pipe character and the following value. Assuming you were using the D&D 5e sheet with the hp attribute !setattr --sel --hp||?{Max HP?} That should set the max value for the hp attribute
Thank you both so much, that did the trick! And yes, I am using D&D 5e. Sorry, should have probably mentioned that :) For context, this is part of a macro I'm using to quickly generate player tokens for improvised sessions. The macro asks for character Name, Race (affects token appearance), HP, AC, and Initiative bonus. My players use D&DBeyond for their sheets, so I only need to set these attributes to run the game in Roll20. !token-mod --on showname --set controlledby|all has_bright_light_vision emits_bright bright_distance|0 bar1_link|hp bar2_link|ac --set name|?{Name} --set currentside|?{Race/Gender|Human (male),1|Human (female),2|Elf (male),3|Elf (female),4|Dwarf (male),5|Dwarf (female),6|Halfling (male),7|Halfling (female),8|Gnome (male),9|Gnome (female),10|Half-Orc (male),11|Half-Orc (female),12|Tiefling (male),13|Tiefling (female),14|Dragonborn (male),15|Dragonborn (female),16|Aarakocra (male),17|Aarakocra (female),18|Tabaxi (male),19|Tabaxi (female),20} --on has_night_vision --set night_vision_distance|?{Has night vision?|Yes,60|No,0} !setattr --silent --sel --hp||?{Max HP?} --hp|?{Max HP?} --ac|?{AC?} --initiative_bonus|?{Initiative?} Thanks again guys, this really made the whole thing complete.
1701991060
Gauss
Forum Champion
Hi Axiomsyndrom,  Just to clarify, there are multiple D&D 5e character sheets in Roll20. Whenever you reference Character Sheets in Roll20 it is a good practice to state the name of the character sheet you are using, or provide a screenshot so that it can be identified.