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 .
×

Item Tracking

Is it possible to create a macro that will automatically adjust item numbers for weapons that use ammunition or spell components?
I think the more important thing is to figure out exactly what you want to do with the macro. If I understand you right, you want to 1) have a number in a character stored somewhere, 2) use a macro to reference that number in it's "equation", 3) have the macro "run the equation", and 4) put the result of that macro back into the same section of the where it was stored in the character to begin with. Is this about right? If so, I'm thinking you can pull off something like that with Attribute Macros... <a href="https://wiki.roll20.net/Macros#Attribute_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Attribute_Macros</a> Read through that and let me know if anything hits you. I'll play with it in a bit.
1589862271
GiGs
Pro
Sheet Author
API Scripter
Macros cant alter attribute values, they can only read them. So a macro cannot adjust ammunition or spell component counts. The only way to do this in roll20 is with the API, a Pro level perk.
1589882611

Edited 1589882631
I've heard that before, then with the help of those on the forums, I found work arounds that did the trick.
1589884028
GiGs
Pro
Sheet Author
API Scripter
What workarounds did you use?
You’re not far off.&nbsp; I’d like for the macro to: reference a stored number and complete a ‘subtract 1’ style equation. Ideally, I could use the macro to roll an attack with a bow, add the modifiers and subtract 1 arrow/bolt of ammunition from my inventory.&nbsp; So:&nbsp; - link to attack roll function - reference and alter an inventory item in the character sheet - run the required equation to subtract the ammunition Thanks for the help! PariahScion said: I think the more important thing is to figure out exactly what you want to do with the macro. If I understand you right, you want to 1) have a number in a character stored somewhere, 2) use a macro to reference that number in it's "equation", 3) have the macro "run the equation", and 4) put the result of that macro back into the same section of the where it was stored in the character to begin with. Is this about right? If so, I'm thinking you can pull off something like that with Attribute Macros... <a href="https://wiki.roll20.net/Macros#Attribute_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Attribute_Macros</a> Read through that and let me know if anything hits you. I'll play with it in a bit.
I really hope that isn’t the case with PariahScion’s work arounds but I do fear that it might be :(&nbsp; GiGs said: Macros cant alter attribute values, they can only read them. So a macro cannot adjust ammunition or spell component counts. The only way to do this in roll20 is with the API, a Pro level perk.
1589950418

Edited 1589950536
While I don't know what user or game to get into to do this, it is possible to do what you are requesting WITHOUT having a pro/plus subscription. You just have to be in a game where the owner has it as such AND have a script that can pull the value from an Attribute. (After that, it's a matter of making a macro that 1) uses one of the "Attributes" as ammo &nbsp;and also 2) references that script to pull/change the value of that "Attribute"). But to be clear, YES, it CAN be done if you DO NOT have a pro/plus subscription. You just must find a game that does. This is where I got the info: <a href="https://app.roll20.net/forum/post/6123243/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/6123243/slug%7D</a> And to be EVEN MORE CRYSTAL CLEAR: GiGs already knew this info, as the link shows (which baffles me as to why he would not mention it as a possible solution--I don't know what the motive was there). =D
In the meantime, I'll keep poking around with things. If I find something I can shoot it your way. Just send me a PM of this post, so that I have a way to find your post again (and message you if I do find it).
1589951993

Edited 1589990291
GiGs
Pro
Sheet Author
API Scripter
PariahScion said: While I don't know what user or game to get into to do this, it is possible to do what you are requesting WITHOUT having a pro/plus subscription. You just have to be in a game where the owner has it as such AND have a script that can pull the value from an Attribute. (After that, it's a matter of making a macro that 1) uses one of the "Attributes" as ammo &nbsp;and also 2) references that script to pull/change the value of that "Attribute"). But to be clear, YES, it CAN be done if you DO NOT have a pro/plus subscription. You just must find a game that does. This is where I got the info: <a href="https://app.roll20.net/forum/post/6123243/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/6123243/slug%7D</a> And to be EVEN MORE CRYSTAL CLEAR: GiGs already knew this info, as the link shows (which baffles me as to why he would not mention it as a possible solution--I don't know what the motive was there). =D What??? Nothing in that thread contradicts what I said. There are no workarounds to avoid this incontrovertible fact:&nbsp; Macros cant alter attribute values, they can only read them. So a macro cannot adjust ammunition or spell component counts. The only way to do this in roll20 is with the API, a Pro level perk. Yes, you can use a macro to launch API commands, but you still need the API for them to work . The "You" in this case does mean the creator of the campaign, that could have been clarified. So, let me clarify that: the creator of the game you are playing in needs to be a Pro subscriber, and must install API scripts for players to be able to use them. Telling someone that a 'workaround' to not having the API is to jump in a game that has the API is just bafflingly silly. People will want to use the script in the game they are actually playing in. I'm just... I honestly dont know how to respond to this... This is me: It's just not a workaround.&nbsp;
I believe for newer users there is a common (yet completely understandable) misconception about the Roll20 API: API access is open to your account all the time. If you pay for access to something on a site, you have it. Even here on Roll20, if you pay for a Compendium, you always have access to it. But the Roll20 API is different. If I have API access as a Pro subscriber, that does not mean I can run API scripts in any game where I am a player. It's a conceptual thing, and some of us long-time Roll20 users sometimes just shorthand this to "you need API access to do X" but what we really mean is "you need to be in a game where the game's creator has an active Pro subscription and has installed or written the proper API script in the game." I have been guilty of this myself.
Now, THAT was clear. Thanks Rabulias.
So. My understanding then is that this isn't a feasible thing for just any player to be able to do. That is really too bad, but I suppose they have to make money somehow. It just seems like ammo tracking is too integral a part of the game to be just left out of the 'for everyone' content. Cheers all!
1590450991
Oosh
Sheet Author
API Scripter
&nbsp;It just seems like ammo tracking is too integral a part of the game to be just left out of the 'for everyone' content. It's 100% "for everyone" content. You just have to do it manually, it's an accurate simulation of the physical tabletop upon which the VTT is based!
1590486212
Ziechael
Forum Champion
Sheet Author
API Scripter
Oosh said: It's 100% "for everyone" content. You just have to do it manually, it's an accurate simulation of the physical tabletop upon which the VTT is based! You do it manually at the tabletop? How quaint, I have a squire who modifies my character sheet for me... a bargain at 2 silver a day!
1590727171
Oosh
Sheet Author
API Scripter
I'd imagine the poor man even gets his instructions written in macro code.
He's illiterate. Thus, this "code" you speak of is aught of use to him without, sir!
Where's the big 'eye roll' emoji on here? lolz. Of course I can do it manually, but automation is so much easier! Oosh said: &nbsp;It just seems like ammo tracking is too integral a part of the game to be just left out of the 'for everyone' content. It's 100% "for everyone" content. You just have to do it manually, it's an accurate simulation of the physical tabletop upon which the VTT is based!