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

Macro to add a new resource to a character

March 27 (5 days ago)
FFR
Pro

Hi,

Using D&D 2014 character sheet in a jump gate game.

Can anyone provide a macro command to add a new resource to the character sheet of a selected token. Have tried a few things out but can't crack this one.

For example we always use repeating_resource_$0_left for spell points as well as quite a few others as standard when creating new characters so trying to do this with 1 click of a button rather than creating all of them for every new character. Just need the resource name created (no need for quantities)

Happy for scriptcards, CharSettAtt or any other proposed solution.

Many thanks in advance

March 28 (4 days ago)

Edited March 28 (4 days ago)
Gauss
Forum Champion

Hi FFR, 

To make sure I understand, you want to create a new resource entry on a character sheet? 

If so, using ChatSetAttr you can do the following (example): 

!setattr --name Krexefro --repeating_resource_-CREATE_resource_left|5 --repeating_resource_-CREATE_resource_left_max|5 --repeating_resource_-CREATE_resource_left_name|test --repeating_resource_-CREATE_resource_right|10 --repeating_resource_-CREATE_resource_right_max|10 --repeating_resource_-CREATE_resource_right_name|test2

This replaces $0 in the resource address. 

Example: 
"repeating_resource_$#_resource_left" becomes "repeating_resource_-CREATE_resource_left" (without quotes)

This adds a new line while simultaneously filling it with the appropriate content. Note, in my experiments you can only add one line at a time this way.

March 28 (4 days ago)
FFR
Pro

Gauss,

Thanks for sending over this works perfectly. I've changed --name Krexefro to --sel and repeated the command a 3 times in a macro. when I run the macro it creates 3 new sets of resources.

I can't tell you how much time this is going to save me