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

Changing 4 or more Current Attribute Numbers

I was told to repost this here. I know, I posted similar questions before, but I need a little more detailed answer than "use API". I been unable to figure API at this time. How can a player apply damage to a specific Current Attribute with 4 or more choices, without having to manually doing it every time in the character sheet? For example, a vehicle take 10 points of damage to the right side. Vehicles have six sides that can be damaged, but in Roll20 their are only 3 bars to track this.
1410322236
The Aaron
Roll20 Production Team
API Scripter
Can you boil this down to a question? I'm not sure what you're asking but I'd like to try and help!
I was hoping to track 4+ attributes, like the 3 bars do, on a token instead of having to open a character sheet every time, since it takes up so much of space.
1410325716
The Aaron
Roll20 Production Team
API Scripter
By track, do you mean display? You can certainly update as many attributes as you want. Yo can print them in the chat too. You can't add another bar to a token though. There are some hacks I can imagine to get the data displayed (change the text of token actions, overlay other tokens, etc.).
No. Like the example above, how would one reduce 10 damage points without having to open in the character sheet? Maybe a chat command or an API, I do not aware of?
1410327281
Lithl
Pro
Sheet Author
API Scripter
Aaron said: You can't add another bar to a token though. However, you could potentially use the statusmarkers to take the place of a bar. I believe there was a nWoD Vampire script that did something similar. The author bemoaned the limitations of using statusmarkers, but it's an option.
1410404731
The Aaron
Roll20 Production Team
API Scripter
Ed F. said: No. Like the example above, how would one reduce 10 damage points without having to open in the character sheet? Maybe a chat command or an API, I do not aware of? Ah! That much lower level than I thought you were asking. To do that, you have to get the Attribute object. How you do that depends on what you have. Assuming you have a token ID, and it represents a character, you can use it to find a particular attribute. Let's assume you have a command named !decrement-delta' which finds the delta attribute on a character based on a given token ID, which my might call like: !decrement-delta @{target|token_id} Here's how the code might work: on('ready',function() { 'use strict'; on('chat:message', function(msg) { var args,token,attr; if (msg.type !== "api" ) { return; } args = msg.content.split(/\s+/); switch(args[0]) { case '!decrement-delta': token=getObj('graphic',args[1]); if(token) { attr=findObjs({ type: 'attribute', characterid: token.get('represents'), name: 'delta' })[0]; if(attr) { attr.set('current', attr.get('current') - 1); } } break; } }); });
Thanks, I will give it a try.