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

ChatSetAttr add atributes

Guys, I'm DMing D & D5e and use the 5th Edition OGL for long rest and counting ammunition and spell slots. I was looking for Scripts to automate a few things in the adventure and saw the Script ChatSetAttr and I was interested. Can it add attributes? For example, can I add healing potion to the current HP? Can I have the loads rolled with the long rest? If yes, how?
1556461240
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
1 yes, it can even add entries to repeating attributes 2. Yes, although this is one of the things you can also do with token-mod, if the attribute is linked. 3. Loads of what? Not sure I understand this one. Loads of healing potion? Loading of the character? ChatSetAttr can basically write to any attribute on the character sheet, although some attributes can be difficult to find. You can toggle a checkbox, for instance, but the name of the checkbox attribute may require detective work with the web inspector of your browser.
keithcurtis said: 1 yes, it can even add entries to repeating attributes 2. Yes, although this is one of the things you can also do with token-mod, if the attribute is linked. 3. Loads of what? Not sure I understand this one. Loads of healing potion? Loading of the character? ChatSetAttr can basically write to any attribute on the character sheet, although some attributes can be difficult to find. You can toggle a checkbox, for instance, but the name of the checkbox attribute may require detective work with the web inspector of your browser. The charges would be for magic items. Now that I saw that I did not explain it right. For example: Wand of Fireballs has a recharge of 1d6 + 1. Can I put this scroll in the long rest? Could you help me mount these macros? I'm really trying here, but I have no idea how to do it. I'm not finding any tutorial on the internet how to use this API, so I'm pretty lost.
1556488345
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The documentation for the syntax of ChatSetAttr is on the API page when you click on the script name. The actual macro code would depend on the character sheet you were using and where the wand of fireballs is entered. Are you using the Shaped Sheet or the Roll20 Official 5e sheet? The former does what you are wanting automatically, so long as the Shaped script is installed. I don't think the Roll20 sheet recovers resources automatically with the sheet, but the field is certainly modifiable. Let's say you had the Wand set up as the first trackable resource on the Roll20 sheet. Looking on the sheet documentation, we find that the number value for that field is @{other_resource}. The Chatsetattr command to increase it by 1d6+1 would be: !setattr --sel --modb --other_resource|[[1d6+1]] !setattr invokes the suite of Chat setattr commands --sel use only on a sel ected character; you can also use a name --modb tells it to mod ify the value by the amount, up to its maximum --other_resource is the attribute to modify [[1d6+1]] is the amount to modify by.
1556488457

Edited 1556488805
Go into the Community search function, enter "ChatSetAttr" and you will find a treasure trove of instructions that people (including myself when I was first introduced) applied. Keep in mind that both ChatSetAttr (thank Jakob) and TokenMod (thank TheAaron) are both power scripts.  They encompass a tremendous amount of functionality for the Character Sheet and Character Token, respectively.  Many people, including myself, find new and interesting ways to expand these scripts' functionality beyond what the authors originally designed, and they have become quite extensive.  Once you get the lingo, you will find that they are very versatile in doing a countless many things.  For my campaigns on Roll20, they are an absolute must have. That being said - being power scripts - they require a bit of learning.  You should get very familiar with the basics of deciphering much needed references first and foremost.  For that, I recommend this very simple code snippet: /w gm &{template:default}{{name=Identifiers for @{selected|token_name}}}{{Token Identifier (token id for tokenmod)=@{selected|token_id}}}{{Character Identifier (character id for CSA)=@{selected|character_id}}} After running that, you will see both a token's id and relative character sheet id.  VERY IMPORTANT when running any macros, not just tokenmod and CSA! Next thing is finding references to most things you want.  Now, there are methods that involve lifting many things from browser developer tools and the like, but - as you will - I like to get things simple and fast (I blame microwaves and cell-phone technology for this habit, but I digress).  Easiest method, if you have some understanding of it, is to go to the Attributes and Abilities tab of any character sheet. WARNING:   Oversight by Roll20 - they did not prevent you from deleting one of these Attributes by accident hovering over and clicking the X that appears.  BE very mindful of where your pointer rests on this page, there will be no "Are you sure?" prompt if you accidentally click that X.  You have been warned, and this can mess up your sheet fairly badly! Anyway ... For both CSA and Tokenmod, a fair amount of documentation is right on your API Settings page when you click the relative API as long as you selected it from the One-Click drop down menu.  The only APIs you shouldn't load from the One-Click are your character sheet APIs and one's that haven't been uploaded to the One-Click that you can find elsewhere such as an author's github.  Character sheets should be updated from the ground up - not just their API, in case dependencies where new features were added to the character sheet that the API needs to find or it fails, which can be a real fail for your campaign if character information goes missing.  But otherwise, loading from One-Click means that new updates will always happen on Tuesdays to the one's loaded on your game.  New Updates = New Features! As far as finding specific uses, I highly recommend the forum searches - I have never seen a community that is as helpful and interactive as the Roll20 community.  If you can't search something here, ask, it will get answered.  Just follow the community guidelines.
Keith wrote his while I was writing mine.  His is more about CSA, while mine should help you with the broad range of API's since you're new and said you couldn't find what you were looking for. keithcurtis said: The documentation for the syntax of ChatSetAttr is on the API page when you click on the script name. The actual macro code would depend on the character sheet you were using and where the wand of fireballs is entered. Are you using the Shaped Sheet or the Roll20 Official 5e sheet? The former does what you are wanting automatically, so long as the Shaped script is installed. I don't think the Roll20 sheet recovers resources automatically with the sheet, but the field is certainly modifiable. Let's say you had the Wand set up as the first trackable resource on the Roll20 sheet. Looking on the sheet documentation, we find that the number value for that field is @{other_resource}. The Chatsetattr command to increase it by 1d6+1 would be: !setattr --sel --modb --other_resource|[[1d6+1]] !setattr invokes the suite of Chat setattr commands --sel use only on a sel ected character; you can also use a name --modb tells it to mod ify the value by the amount, up to its maximum --other_resource is the attribute to modify [[1d6+1]] is the amount to modify by.
1556498774
The Aaron
Roll20 Production Team
API Scripter
(BTW, did you know you can use a Character ID with TokenMod anywhere you use a Token ID?  It finds all the tokens representing that character and modifies them. =D)
1556499718
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The more you know!
1556564483

Edited 1556565524
My fear of putting other APIs is to generate conflict. ChatSetAttr already shows me the message that it can generate conflict and I'll have to test manual to see which macro I'm going to have to exclude. So I did not want to use TokenMod for example. It displays the same message because of the HTML Builder generated by one of the APIs. What I currently use is: 5th Edition OGL by Roll20 Companion GMSheet Token Lock Carry Tokens
1556566351
Ziechael
Forum Champion
Sheet Author
API Scripter
You have no need to fear the use of multiple APIs, the warning is there to... well 'warn' you... but rarely is there any conflict, especially not with the more prolific script authors. They take every care to ensure that their scripts won't break anyone elses, or your game (if used properly lol).
1556568671
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yeah, I've never run into an issue with that warning. and I have a ton of scripts installed.
1556596289
The Aaron
Roll20 Production Team
API Scripter
That warning is actually worse than meaningless. It's based on self-reported lists of the parts of Roll20 that your script interacts with. If you see it, it just means you have more than one script where the script authors both believe they manipulate some broad class of object, like Attributes. It is not some indication that there are known bad interactions. To use an analogy, it's like saying "both these people use the same road on their daily commute."