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

Adding References Variables from Multiple Tokens in Handouts

For the purpose of a campaign, I am building a continental warmap. On this map, there are border signpost tokens and stronghold tokens. The stronghold tokens have all been assigned 5,000 men in Bar 3 (the red bar). There are two sides; Horde and Alliance. I want to reference and calculate with the numbers from all Alliance stronghold tokens and all Horde stronghold tokens into one handout or sheet.

Follow this link for a big picture to understand what I'm trying to do;

http://i.imgur.com/smDCDdK.png

So, I want to be able to say;

Horde Stronghold X
Horde Stronghold Y
Horde Stronghold Z
---------------------------- +
Horde manpower [X+Y+Z=???]

And for it to automatically calculate it. How do I do that in a way that is simple for me to explain to Co-GMs?
Is the number of tokens static, or do they change?

If they're static, you could create character journals for each and store their 'men' values in attributes. You could then link the token bars to those attributes. Depending on how many you have, this could get tedious to setup. However once done you could then write a single macro that would add up all those attributes by naming each sheet in turn. [[ @{stronghold_01|men} + @{stronghold_02|men} ]] ... This also has the side benefit of letting you track notes and other information about each stronghold in an associated sheet. With the recent organizational options for the journal tab, it wouldn't even add much clutter.

If you want to side-step the character journals, and don't mind clicking each token in turn, you could also use a series of @selected arguments. [[ @{selected|bar2} + @{selected|bar2} .... ]] (for however many tokens you have)

However, if the number of tokens will change, I don't see a way you could do this without the API.
The number of tokens is static, yes. Thank you so much, Mark! This helps me out bigtime!
I'm confused. I tried putting in those macros in the handouts, but it doesn't calculate anything. What do I do?
I also can't seem to find out how to select arguments. I'm very confused right now.
How do I even find out the names? Did I put in the names correctly? I tried using [[ @{Venomspite|bar3} + @{Kor'kron Vanguard|bar3]] and it gives me this error.

No character was found for 'Venomspite' SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "V" found.
Alright, I figured out that I have to make characters for each token in order to be able to count them up. But how do I put that information into a handout or character sheet?
Ok, that's a whole lot to go over :)

First, start with creating a character journal for each stronghold. Avoid using spaces or special characters in the names.
On each one of those journals, go to the Attributes tab , and ADD and ATTRIBUTE for "Men". Put in a number appropriate for the settlement.

Once you have a journal for every settlement and they all have values, put their tokens on the map.
For each Token, link it to the matching character journal as characters. (https://wiki.roll20.net/Linking_Tokens_to_Journals)
Give Phnord 5 cents...
Link each token's "Bar2" to the "MEN" attribute you set earlier (https://wiki.roll20.net/Token_Features)
Do that for each one.

This will give you a series of tokens that are linked to unique character journals that have the MEN attribute.

You can then create a MACRO that refers to every sheet and adds them up.
If the first keep's character journal is called "venomspite" and the next one is called "korkronvanguard" it would look like:
Total Men Across all Keeps: [[ @{venomspit|men} + @{korkronvanguard|men} ]]

April 03 (10 years ago)
You can't put an inline roll in a handout and have it calculate like that.
Correct.
I wasn't suggesting a macro in a handout, or any handouts. Use character journals to represent the keeps and a generic Macro to call their "men" attribute to add them up.
THing is, I don't want to have to be online for the players to be able to review how much manpower they have left with an easy overview. So I need some way to have a handout calculate those numbers for me in a kind of table.
April 03 (10 years ago)
The Aaron
Roll20 Production Team
API Scripter
You could certainly add the macro that Mark G. is suggesting to the tokens as a Token Action by putting it in a character's abilities.

From what you've got up above, it looks like you're creating a sort of board game, right? Maybe if you explain a bit of the mechanics you're going for, we can find some better options. For one thing, it might make sense to only have 2 Characters (one for horde and one for alliance) and then just have separate attributes for each unit ( @{horde|venomspit_men}, @{horde|korkronvanguard_men}, etc). That would simplify your journal a bit and let you add other abilities. However, it's hard to say without knowing just a little bit more.
It's more like a roleplaying game, honestly. We're a small community of instant chat RPers and we wanted to get the tactical element down for years. People've been promising to build RTSes to serve our needs for years (six years in fact), but it never came to happen. I wanted to give it a try this way.

The rules are just; the Horde and Alliance have a finite amount of men, stationed in these places. Every person you lose in a battle you lost permanently and that is reflected on the map. I want players to be able to review how many men the Horde and Alliance have left and have lost. ANd for that matter, any other faction that I'm going to make as well.
April 04 (10 years ago)
The Aaron
Roll20 Production Team
API Scripter
Ok. If you don't mind the tedium, probably Mark G.'s suggestion or my modification on it would be the way to go.