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

Assigning hit points to non-character sheet tokens via api

1638819436

Edited 1638819556
Did this ever happen? Aaron: “ have a script called MonsterHitPoints that can be configured to roll hitpoints on token creation. It's based on characters though. I could certainly write something for you. I've been meaning to make individual changes for tokens, maybe I can prioritize that.” I also want the (condensed) bar 3 to show.  Using a macro to accomplish. Thanks!!
1638849399
The Aaron
Roll20 Production Team
API Scripter
You can set the condensed bar using TokenMod. I have not modded MonsterHitDice to support non-character tokens. If you can provide the use case you're trying to meet, I might have some suggestions. 
I want to be able to grab tokens - unattached to any character sheet, click on one or more, then click a macro to run TokenMod to add hit points to all of them all into Bar 3, (compact bar - players can see but not edit). The formula for HP can always be "25+1d12". This would save me a great deal of time. Thanks so much.
Giving HP to all of these people with a compact Bar 3 visible to players takes a long time. And character sheets for them? A lifetime. I want to grab them all and do it in one click.
1638899244
timmaugh
Pro
API Scripter
Hey, John... if you want to apply an individual result of that formula to all of your selected tokens, you can use TokenMod and SelectManager (a metascript). !forselected(^) token-mod --set bar3|[^[^25+1d12^]^] =D
1638905176
The Aaron
Roll20 Production Team
API Scripter
As Tim said. =D  If you don't mind them all being the same value, you could do: !token-mod --set bar3|[[25+1d12]] I've been meaning to add an individual rolls option to TokenMod, but haven't had the opportunity to work on it yet.  Tim's SelectManager script is a great alternative for now.
That's brilliant, thanks. Now any way to make the player permissions on bar3 "See" but not edit, and the bar itself to be "compact"? And we are good to go. Thanks so much!
John S. said: That's brilliant, thanks. Now any way to make the player permissions on bar3 "See" but not edit, and the bar itself to be "compact"? And we are good to go. Thanks so much! <a href="https://app.roll20.net/forum/permalink/10136003/" rel="nofollow">https://app.roll20.net/forum/permalink/10136003/</a> !token-mod --set compact_bar|on !token-mod --set showplayers_bar3|on
1638924476
David M.
Pro
API Scripter
Just for future reference: when you install token-mod it creates a handout in your journal called "Help: TokenMod" that has a ton of documentation in it including examples! I find myself going back to it all the time :)
1638925610
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Pro tip: Open that handout up in your external journal in the browser and bookmark it. You will have the documentation at your fingertips, in-game or out.
So great! Thanks a lot everyone. What a terrific community!