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

[Request] Show floating numbers instead of bars when not selected

1445068734

Edited 1445068756
WurmD
KS Backer
The title says it all :) For the game mentioned in&nbsp; <a href="https://app.roll20.net/forum/post/2506250/request-targeting-all-tokens-to-sum-up-all-mana-values" rel="nofollow">https://app.roll20.net/forum/post/2506250/request-targeting-all-tokens-to-sum-up-all-mana-values</a> to minimize errors of the type "forgot to fill the Maintenance value of unit" have an API call to display floating numbers in all tokens corresponding to their bar values.
1445101412

Edited 1445102084
The Aaron
Pro
API Scripter
Hmmm. That gets a bit more problematic. The API doesn't have a way to create user interface elements. It could be done by creating text objects with the values on the map or object layer. The size will be problematic because it wouldn't change with the zoom.&nbsp;
How about a work around? writting the bar contents in the name-plate, and having all name-plate turned ON? :)
1445186476
The Aaron
Pro
API Scripter
That could be done, smart thinking! So, what format? &nbsp;Say you have Bob the Killer , what would you want his name to be shown as? &nbsp;Heres some options to get you started, but pretty much any text string can be duplicated: Bob the Killer 15 30 2 Bob the Killer 15/20 30/30 2 Bob the Killer | [15/20] [30/30] [2] Could even change the way something is displayed based on it's relation ship to max: Possible options for current = max: 20 20/20 20= Possible options for current &lt; max: 15 15/20 15&lt; 15- Possible options for current &gt; max 25 25/20 25&gt; 25+ 20(+5) And of course, anything you could think of.
For this play-by-post game, most units won't have names, and all units will only have one value in one of the bars, with no max (it's maintenance value :), or its production value) So a format could simply be Bob the Killer 15302 which really will be either Elite Ant Soldier -57 or Formicadia city 1500 But really anything goes :), because I'm able to go into the script and edit the format afterwards. Thanks for your time Aaron :)
1445888038

Edited 1445890591
WurmD
KS Backer
We're good, I haven't written it fully yet, but with your example that cycles all object it's pretty straightforward taking the bar values and writting it in the "name" field, and also turning the "showname" and "showplayers_name" fields to true something similar to case '!name-off': _.reduce(findObjs({ pageid: Campaign().get('playerpageid'), &nbsp; &nbsp; type: 'graphic', &nbsp; &nbsp; isdrawing: false, &nbsp; &nbsp; layer: 'objects' }),function(m,o){ &nbsp; &nbsp; o.set('showname',false); &nbsp; &nbsp; o.set('showplayers_name',false); },{}); sendChat('','All nameplates turned off.'); break; this case turns all nameplates back off
1445890674
The Aaron
Pro
API Scripter
Great!&nbsp; You can actually put those sets together by passing in the changes as an object: case '!name-off': _.reduce(findObjs({ pageid: Campaign().get('playerpageid'), &nbsp; &nbsp; type: 'graphic', &nbsp; &nbsp; isdrawing: false, &nbsp; &nbsp; layer: 'objects' }),function(m,o){ &nbsp; &nbsp; o.set({ showname: false. &nbsp; &nbsp; showplayers_name: false }); },{}); sendChat('','All nameplates turned off.'); break;