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

Help Refining Leadership Income Macro

1574938527

Edited 1574939896
I currently have a macro for leadership (will paste at bottom) for weekly income that I'd like to make 2 small changes to. I'm not quite sure how, however. The first change is I'd like to make it where it doesn't spam me with questions about how many followers per level I have and instead just rolls the dice with the data inside thats already there and it will just be my responsibility to keep it up to date. At lower levels being able to change it on the fly was nice, now however the pop up box spam is a bit much.... Secondly, I'd like to a line at the bottom that tells me the total of all the other lines. Again at low levels adding them all manually wasn't much of an issue. Now however its a bit.... annoying. Thank's much in advance for any help! &{template:DnD35StdRoll} {{skillflag=true}} {{name=Tink's }} {{subtags=Biggest Fans.}} {{Lv1=[[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] gold per week.}} {{Lv2=[[(?{Lvl 2s|920}d20+?{Lvl 2s}8)/2]] gold per week.}} {{Lv3=[[(?{Lvl 3s|460}d20+?{Lvl 3s}9)/2]] gold per week.}} {{Lv4=[[((?{Lvl 4s|230})-1)d20+?{Lvl 4s}11)/2]] gold per week.}} {{Lv5=[[(?{Lvl 5s|115}d20+?{Lvl 5s}12)/2]] gold per week.}} {{Lv6=[[(?{Lvl 6s|58}d20+?{Lvl 6s}13)/2]] gold per week.}} {{Lv7=[[(?{Lvl 7s|29}d20+?{Lvl 7s}14)/2]] gold per week.}} {{Lv8=[[(?{Lvl 8s|15}d20+?{Lvl 8s}16)/2]] gold per week.}} {{Lv9=[[(?{Lvl 9s|8}d20+?{Lvl 9s}17)/2]] gold per week.}} {{Lv10=[[(?{Lvl 10s|4}d20+?{Lvl 10s}18)/2]] gold per week.}} {{Lv11=[[(?{Lvl 11s|2}d20+?{Lvl 11s}19)/2]] gold per week.}} {{Lv12=[[(?{Lvl 12s|1}d20+?{Lvl 12s}21)/2]] gold per week.}} EDIT: So I figured out a roundabout way of getting the total. I still don't know how to get rid of all the pop ups. The new version is pasted below: &{template:DnD35StdRoll} {{skillflag=true}} {{name=Tink's }} {{subtags=Biggest Fans.}} {{Weekly Income=[[ [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]]+[[(?{Lvl 2s|920}d20+?{Lvl 2s}8)/2]]+[[(?{Lvl 3s|460}d20+?{Lvl 3s}9)/2]]+[[((?{Lvl 4s|230})-1)d20+?{Lvl 4s}11)/2]]+[[(?{Lvl 5s|115}d20+?{Lvl 5s}12)/2]]+[[(?{Lvl 6s|58}d20+?{Lvl 6s}13)/2]]+[[(?{Lvl 7s|29}d20+?{Lvl 7s}14)/2]]+[[(?{Lvl 8s|15}d20+?{Lvl 8s}16)/2]]+[[(?{Lvl 9s|8}d20+?{Lvl 9s}17)/2]]+[[(?{Lvl 10s|4}d20+?{Lvl 10s}18)/2]]+[[(?{Lvl 11s|2}d20+?{Lvl 11s}19)/2]]+[[(?{Lvl 12s|1}d20+?{Lvl 12s}21)/2]] ]] Gold Pieces}}
1574945121
Ziechael
Forum Champion
Sheet Author
API Scripter
The easiest solution would be to add a number of custom attributes to the appropriate character journal for the various level of followers and store the values there... that way you could replace all of your ?{} queries with @{} attribute calls instead. No pop-ups and you'd only need to update them once, on the sheet, whenever the numbers change. In terms of totalling the income while maintaining visibility you would either need to utilise the API or you could use roll tagging to highlight the breakdown in the tooltip of the total. [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] becomes [[( @{ My Character |Lvl 1s} d20+ @{ My Character |Lvl 1s} 7)/2 [Levels 1s] ]]
1574945361
Ziechael
Forum Champion
Sheet Author
API Scripter
Out of interest, what is the actual base formula for working out income? [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] resolves to [[(9200d20+92007)/2]] Which seems like it would be wrong?!
I've been scratching my head at the math on this macro for a while as it seems off. I borrowed it from a friend. The base formula is their profession checks divided by 2. I happen to have 9200 lvl 1 followers (high level campaign) and this macro assumes they are maxing out their profession skill every level and have a decent amount of wisdom (i forget the exact number) I think a more accurate and simpler equation would be 9200(d20+7) I think his original intent was to roll 9200 d20s and then add on 9200 7s (obviously the 9200 AND the 7 would change by follower level) Ziechael said: Out of interest, what is the actual base formula for working out income? [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] resolves to [[(9200d20+92007)/2]] Which seems like it would be wrong?!
Again one more time in English please sir...? Ziechael said: The easiest solution would be to add a number of custom attributes to the appropriate character journal for the various level of followers and store the values there... that way you could replace all of your ?{} queries with @{} attribute calls instead. No pop-ups and you'd only need to update them once, on the sheet, whenever the numbers change. In terms of totalling the income while maintaining visibility you would either need to utilise the API or you could use roll tagging to highlight the breakdown in the tooltip of the total. [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] becomes [[( @{ My Character |Lvl 1s} d20+ @{ My Character |Lvl 1s} 7)/2 [Levels 1s] ]]
1575010832

Edited 1575010862
GiGs
Pro
Sheet Author
API Scripter
Malazan said: I've been scratching my head at the math on this macro for a while as it seems off. I borrowed it from a friend. The base formula is their profession checks divided by 2. I happen to have 9200 lvl 1 followers (high level campaign) and this macro assumes they are maxing out their profession skill every level and have a decent amount of wisdom (i forget the exact number) I think a more accurate and simpler equation would be 9200(d20+7) I think his original intent was to roll 9200 d20s and then add on 9200 7s (obviously the 9200 AND the 7 would change by follower level) Ziechael said: Out of interest, what is the actual base formula for working out income? [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] resolves to [[(9200d20+92007)/2]] Which seems like it would be wrong?! That makes sense. In each row, you shpuld add a multiplication sign (*) before the professional skill, so [[(?{Lvl 1s|9200}d20+?{Lvl 1s}7)/2]] becomes [[(?{Lvl 1s|9200}d20+?{Lvl 1s}*7)/2]] Ziechael's suggestion is: Create a character sheet to keep track of these professionals*. Add some new attributes on the Attributes & Abilities tab: lvl-1s, lvl-2s, lvl-3s, and so on. In those attributes, enter the number of professionals. So for the above macro, lvl-1s would have a value of 9200. If PCs each have their own professionals, add them to the pcs sheet's attributes & abilities tab. As a Pro user, you can use the script chatsetAttr to automate the creation and updating of those scores, and can use a macro to display current totals. So, lets say you add them to a character whose name is Frodo. In this section of the macro: [[(?{Lvl 1s|9200}d20+?{Lvl 1s}*7)/2]] You'd change it to  [[(@{Frodo|lvl-1s}d20+@{Frodo|lvl-1s}*7)/2]] And then you wouldnt get prompted for entering numbers. They'd all be in the character sheet already, you just need to run the macro to get the total.