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

Tokenmod question->Change Bar values MAX and Current

Hello! Is there a way with TokenMod to automatically enter both current and max values from a linked atrribute in Bar ?  For example Bar 3 should be linked with hp and at the same time the number should be entered in current and max. LG
1587473492
The Aaron
Roll20 Production Team
API Scripter
This should be the default behavior.  If you are not getting a current or max value, the linked attribute is missing the value, unless something has gone dreadfully wrong.  You can test the attribute easily with: @{selected|name} is @{selected|attr}/@{selected|attr|max}
Thanks for the quick answer! Is there a way to customize this macro !token-mod {{   --on showname light_hassight showname   --off isdrawing    --on showplayers_bar1   --off showplayers_bar2   --off showplayers_bar3   --on playersedit_bar1   --off playersedit_bar2   --off playersedit_bar3   --on showplayers_aura1   --on showplayers_aura2   --off playersedit_aura1   --off playersedit_aura2   --set     name|"@{selected|character_name} %%NUMBERED%%"     bar1_link|npc_ac     bar2_link|nothing     bar3_link|hp     light_radius|5      light_dimradius|=-5   ?{Player Visible?|No,--off|Yes --on} light_otherplayers }} to automatically write the same value into MAX and Current? So if Max has 15 and Current has nothing, then he should write the value from MAX, if Current has 15 and MAX has nothing, then the other way round. One last question: Is there a way to bring the bars down? With token mod? Greetings Sebastian
1587477794

Edited 1587477856
The Aaron
Roll20 Production Team
API Scripter
You can use the bar#_reset special property to set the current value to the current max value: !token-mod {{ --on showname light_hassight showname --off isdrawing --on showplayers_bar1 --off showplayers_bar2 --off showplayers_bar3 --on playersedit_bar1 --off playersedit_bar2 --off playersedit_bar3 --on showplayers_aura1 --on showplayers_aura2 --off playersedit_aura1 --off playersedit_aura2 --set name|"@{selected|character_name} %%NUMBERED%%" bar1_link|npc_ac bar2_link|nothing bar3_link|hp bar3_reset| light_radius|5 light_dimradius|=-5 ?{Player Visible?|No,--off|Yes --on} light_otherplayers }} You can also set both to a specific value at once with bar# (mostly useful for initializing from a roll): !token-mod {{ --on showname light_hassight showname --off isdrawing --on showplayers_bar1 --off showplayers_bar2 --off showplayers_bar3 --on playersedit_bar1 --off playersedit_bar2 --off playersedit_bar3 --on showplayers_aura1 --on showplayers_aura2 --off playersedit_aura1 --off playersedit_aura2 --set name|"@{selected|character_name} %%NUMBERED%%" bar1_link|npc_ac bar2_link|nothing bar3_link|hp bar3|@{selected|hp|max} light_radius|5 light_dimradius|=-5 ?{Player Visible?|No,--off|Yes --on} light_otherplayers }} The bar position is not exposed to the API yet, but I will add it to TokenMod once it is.
Thank you! That helps me a lot! If I quickly click the two macros one after the other, the HP are automatically entered in Current and Max. Is the same possible with npc_ac? Then I would have to click four macros in a row. But this is much faster than opening the sheet and entering it manually. Maybe you can combine these macros into one? Or make it run in a "Query Macro"? Something else. My players report that despite the macro they can't see the monster's name or npc_ac. I don't understand that. Greetings
Hey Aaron, With this macro: !token-mod {{   --on showname light_hassight showname    --off isdrawing    --set     name|"@{selected|character_name} %%NUMBERED%%"     bar1|@{selected|npc_ac}     bar2|@{selected|sr}     bar3_link|hp     bar3|@{selected|hp|max}     bar3_link|nothing     light_radius|5      light_dimradius|=-5   ?{Player Visible?|No,--off|Yes --on} light_otherplayers  --set defaulttoken }} and the basic settings for the OGL sheet: Bar_1 Max: npc_ac Bar_1 Link: npc_ac Bar_3 Max: hp_max Bar_3 Link: hp_max and game settings Bar_1 See everyone, I have my perfect solution. Each monster from the compendium has after application of the macro automatically in Bar_1 npc_ac and in Bar_3 the HP. Players only see bar_1. And the changed token automatically becomes the standard token. Thanks for the excellent ideas! Together with the standard macros for Saves, Skills etc. my Monster Compendium can now be created.
One more thing. That would make everything so much better. Can I use Token mod or another script to include a command in the macro that automatically adds a completely new attribute to the NPC? would need an attribute called sr. This should then be assigned 1 by default. greetings
1587577989
The Aaron
Roll20 Production Team
API Scripter
For the token name, showname controls if the name is present beneath the token. Whomever can control it will see it if that setting is on. For those that don't control it you need to turn in showplayers_name.  The API script ChatSetAttr can be used to create and manipulate attributes.