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

AP System Needs Macro

Hello all, I'm thinking of how to develop a macro based on the following rules. 1. Initiative is rolled as normal. It keeps track of ties in the AP system and initial moves. 2. There is no concept of rounds, characters spend AP which continues to advance. Lowest AP count acts first. So what I'm trying to do is take the AP field from the character sheets, put them into a macro along with who they belong to, and sort them. The two things I'm wondering if they can be done are: Add specific characters involved in the combat to the macro (AP attribute and name attribute) and sort that information based on the number in the AP field. Any help would be appreciated. Thanks, Tet
1574442266
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
By AP I assume you mean "Action Points"? Are they the same number as Initiative, or are they two different numbers?
1574443283

Edited 1574443450
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Assuming they are two different numbers, how about this? Enter all initiative as a number with 1 decimal place. Instead of initiative 12, enter 12.5. This would represent a character with 5 action points. They are still sorted by initiative, but the APs are included as well. Assuming each character has an AP attribute called "AP", initiative could be rolled with the following macro: [[1d20+@{selected|dexterity_bonus} + (@{selected|AP}/10) &{tracker}]] Adjust the first half to match the needs of your game's formula. You should end up with something like this. To spend AP use the following macro: [[ceil(?{Action points to spend})/10 &{tracker:-}]] to add them, use: [[ceil(?{Action points to restore})/10 &{tracker:+}]] I've made some assumptions here, but with more info, it can be tweaked.
1574443431

Edited 1574443478
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah, I didn't quite understand point 2. This is even easier. Use this macro for initiative: [[0d0+@{selected|AP} &{tracker}]] And this macro to spend: [[?{Action points to spend} &{tracker:-}]] And this macro to restore: [[?{Action points to restore} &{tracker:+}]]
Although that does help you look at everything together, it really isn't what I'm looking for. /Basically/ there are 2 initiatives. Initiative as normal, which works fine as is.   Then AP (Yes, Action Points). Action Points build, higher and higher, as people do things. The person with the lowest AP spent acts next. So, I need something to sort on AP itself, not Init+AP. 
1574445119
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Two parallel initiative orders then? One for Init and one for AP? And each one sorts independently? There's no way I can think of to do it cleanly, but there is a clumsy workaround and it relies on the fact that initiative is tracked by token, not character. Every player/character has two tokens, one for initiative purposes, and a second one (which can be kept in a spearate area of the map, perhaps in a neat little line for organization.  Roll initiative normally for the normal tokens. Use the "divide by 10" adjustment option I outlined above when putting the AP tokens on the tracker. Sort the tracker. You'll wind up with something like this, with a top list for initiative, and a bottom list for AP: When adding or subtracting AP, use the macros above, but use them on the AP tokens. Since AP is determined in opposite order, you'll have to get used to reading the bottom of the chart from bottom to top. Clunky, yes, but doesn't require any API.
1574445182
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hmm. Alternately, you could do all of the APs as negative numbers and read it normally. Just ignore the "-" sign.
That's a cool idea.  Is there no way to sort in an independent macro chatbox output? could have real Initiative in the tracker, then something else to view AP. It does require a lot of setup beforehand with the AP tokens. The GM would have to duplicate everything and set it up at the time of combat. Or I guess they create generic tokens and somehow assign them to a character, which might actually work best, but I'm sure there's a methodology that would work.
1574447634
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I think it would require an API script to have a separate system like you are describing. Probably not terribly complicated. Since you are a Pro member, you could use Token-mod to do a lot of the heavy lifting of token setup.
Gotcha. Thanks for your help Keith. I think using negative numbers, an item label to separate, and simply duplicating tokens should work in the tracker.
1574449723
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Duplication would probably be fastest.
Yeah. Duplication w/ the Group Initiative. I just tested it, and works fine.