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 resource values to max during a short rest

August 16 (4 years ago)

Sorry for the newbie question, but I'm bumping into some issues setting up specific resource values to return to their max during short rests.  I'm running a 5e campaign in which each player has an magical item that provide specific abilities that recharge when they take a short rest.  I have been using the ChatSetAttr and ShortRest script with my macro with the following commands:        


!shortrest-nohd
!setattr --silent --sel --repeating_resource_$0_left_name|1
/w @{selected|character_name} You have taken a short rest and recovered Attributes and Abilities that you can with a short rest.


The first portion for the short rest works fine, but the resource I point the second line to does reset to 1.  Any suggestions or ideas would be very much appreciated!



August 16 (4 years ago)
Oosh
Sheet Author
API Scripter

I think the Attribute you want is:

@{repeating_resource_$0_resource_left}

It repeats the word resource, which is a bit unintuitive, and you want to set the value (not _name). If you wanted to make it adaptable, you could set the value to @{repeating_resource_$0_resource_left|max} instead of a static number, then you wouldn't have to update it if the charges increase (may not be an issue for this purpose).

August 17 (4 years ago)

That worked like a charm.

Much appreciated!