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 (or another script) to update Gumshoe Character Sheet

Hey folks, After watching Nick Olivio's video on ChatSetAttr I got wondering if I could use that or another script to do something specific. I'm running a Gumshoe game and want to use the API to deduct points spent from values in the GUMSHOE character sheet -&nbsp; <a href="https://wiki.roll20.net/GUMSHOE_Official_Sheet" rel="nofollow">https://wiki.roll20.net/GUMSHOE_Official_Sheet</a> I have a macro for each General Ability which prompts the player for the number of points they want to spend, that number is then added to their dice rolls. What I'd like is to have the API (or a macro if that's an option) to deduct the number of points chosen from that ability automatically. e.g.&nbsp; the character has a Stability test and rolls 1d6, they opt to spend 2 Stability points to increase their chances. Macro outputs the roll and then the API / macro deducts the 2 Stability from that attribute. I initially thought that ChatSetAttr would do this for me but it either doesn't or I'm using it wrong... Macro -&nbsp; &amp;{template:@{selected|sheetswitch}} @{selected|stability_dice} {{rname=^{stability-a}}} Any help appreciated, even if it's to say it can't be done! Cheers, Dave
ChatSetAttr should be able to change/update any attribute on the character sheet. You haven’t written a Mod script command though - it would need to start with an ! (or in the case of ChatSetAttr it can be done inline, but it still needs an !.) I’m not sure what the attributes you are referencing are used for, but you definitely can’t use the ^ reference, as that is only available to the sheetworkers (JavaScript code built into the character sheet itself).&nbsp;
Thanks @Jarren The " &amp;{template:@{selected|sheetswitch}} @{selected|stability_dice} {{rname=^{stability-a}}} " is what the sheet generates when you click on the ability. So I likely can't change that easily, if at all.
1672459080
timmaugh
Forum Champion
API Scripter
Where is the prompt to the players asking for points? (I'd expect to see a roll query...) If we get that we might be able to get you sorted.
1672491143
GiGs
Pro
Sheet Author
API Scripter
Changing attributes is exactly what chatSetAttrs was designed to do, and i use it every campaign. You could prompt for the stat points used, and it would add that to the roll properly and deduct from the attribute in the same macro. the ^stats is used by the sheet to translate names to your local language. If you find what the attributes are called on your sheet, you can use chatSetAttrs. Pick one of the attributes you want to change, click F12 (or right click and Inspect Element), and your browser should take you straight to the attribute. (The code might be a bewildering mass, so you might need to share a screenshot.) Some sheets show you the attribute name when you hover over the, which makes things simpler - I don't know if the gumshoe sheet does.