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

[Script] TokenNameNumber -- Automatic Numbering of Qualifying Tokens

May 06 (9 years ago)
The Aaron
Pro
API Scripter
Update 0.5.3: Fixed a bug in 0.5.2 preventing naming. (Thanks Gozer, Vince, Laurent!)
May 06 (9 years ago)
vÍnce
Pro
Sheet Author

The Aaron said:

Update 0.5.3: Fixed a bug in 0.5.2 preventing naming. (Thanks Gozer, Vince, Laurent!)
Thanks Aaron. We aim to break your scripts. :-P

May 06 (9 years ago)
The Aaron
Pro
API Scripter
Quality Assurance is very important and definitely appreciated! =D
thanks for this Script @Aaron and the visual of what it does and the sample how to. This helped alot since im new to the API scetion of this system. please keep up the great work. also do you do this tutorial in a sense for other scripts?
May 11 (9 years ago)
The Aaron
Pro
API Scripter
No problem!

I don't know... I certainly COULD do it for other scripts. I'd say just post on whatever one you'd like a tutorial for and I'll see what I can do. =D

The Aaron said:

No problem!

I don't know... I certainly COULD do it for other scripts. I'd say just post on whatever one you'd like a tutorial for and I'll see what I can do. =D


Are there any scripts and/or with Tutroial on random hit dice to go with these automatic token generating?
Here's the wiki listing of official scripts:

https://wiki.roll20.net/API:Script_Index

And the official script repository:

https://github.com/Roll20/roll20-api-scripts

And the script I use to assign random HP:

https://github.com/shdwjk/Roll20API/blob/master/Mo...
May 12 (9 years ago)
The Aaron
Pro
API Scripter
What he said. :)

That GitHub link isn't working for me. Try this one: https://github.com/shdwjk/Roll20API/blob/master/Mo...
May 12 (9 years ago)

Edited May 12 (9 years ago)
I think that one is to the 5e script. I use this one (url copied from my actual script - thanks very much for putting that info in the comments, Aaron!).

https://github.com/shdwjk/Roll20API/blob/master/Mo...

And now that I look at them, they look to be the same, with the exception of the name of the attribute for hit dice. I think I also modified it further because I use bar 1 for HP, and I think your script uses bar 2.
May 12 (9 years ago)
The Aaron
Pro
API Scripter
They are actually the same, at some point I duplicated one and checked it in with a different configuration. Dumb... I need to clean those up. They are hacks, should make a more unified and configurable system...
See, aren't you glad when us newbies come along, and start rooting through your old stuff? Just what you need, more scripts to write! :)
May 12 (9 years ago)
The Aaron
Pro
API Scripter
=D
May 12 (9 years ago)
Gen Kitty
Forum Champion
Scripts to write, scripts to clean up, scripts to prettypretty up with tutorials....
May 12 (9 years ago)
The Aaron
Pro
API Scripter
Incantations of an Arcane Scriptomancer are never finished...
A wedding to plan, my fiance to kill, and Gilder to frame for it. I'm swamped!
May 12 (9 years ago)
The Aaron
Pro
API Scripter
heheheheeh =D
May 19 (9 years ago)
Gen Kitty
Forum Champion
I came here to lament that somehow my script had stopped randomly numbering my tokens, when i discovered that I'm on v.0.2.1 and you're up to 0.5.3, so maybe updating will help. :P

No, no updating didn't help. I went to line 41 and made 'randomSpace' be 3, but I still have increments of 1. What am I doing wrong? :/
May 19 (9 years ago)
The Aaron
Pro
API Scripter
Ah, don't change line 41. That's part of the state initialization code (which will have already run, so won't make a difference.

Run:
!tnn

May 19 (9 years ago)

Edited May 19 (9 years ago)
Gen Kitty
Forum Champion
Ack, cat is ambushed by another wall of text!

YAY, random numbers are now reasonably random!

All scripts are updated, I can go back to trying to break Powercards 3.0b!)

May 19 (9 years ago)
The Aaron
Pro
API Scripter
=D And if you like dots, you can turn those on. =D
May 19 (9 years ago)
Gen Kitty
Forum Champion
I turned them on and nothing made sense, at all. And since I need the dots for marking (4e), I turned them back off.
May 19 (9 years ago)
The Aaron
Pro
API Scripter
=D It's just a way to have something the players can refer to instead of a number 'I'm attacking the pink-green one."

Not for everyone, but it was fun to write, so yay! =D
May 19 (9 years ago)
Gen Kitty
Forum Champion
*shudder* GMs who do that to their players are making everyone's lives more difficult, in my highly biased opinion ^_-

(My 13th Age GM does this, which means I can't use @{target|token_name}, I have to do ?{Target} and enter Green 1 or Red 4. )
May 19 (9 years ago)
The Aaron
Pro
API Scripter
Should introduce him to TokenNameNumber... =D

BTW, how are you handling the escalation die? I have a script for that I wrote on a lark...
May 19 (9 years ago)
Gen Kitty
Forum Champion
I believe he's using an escalation die script. And I did point him at your token numbering script. He didn't bite. His game, his quirks. I adjusted :>
Can this script be used to roll a token face from a table, as well as numbering? For instance, I have a rollable table that I've assigned to a token, so that I can pull up multiple Gnolls with 1 token. I want to pull the token onto the table (from the journal entry), have it automatically number, and then randomly roll for a side for the token. Is this possible? Or is there another script that would accomplish this functionality?
June 10 (9 years ago)
The Aaron
Pro
API Scripter
This script doesn't do that.

Sadly, that isn't currently possible. To do that, you'd change the side property of the token, however changes to that property do not cause the imgsrc to update. Further, if the images listed in the table are from the marketplace, you can't even fake it by looking up the right image and setting the imgsrc property as the API can't set imgsrc to anything in the marketplace.
Bummer. Is there a suggestion to allow this to which I could lend my support? If not, I could make one, but I wouldn't even know how to word it. Imgsrc just seems to have too many consonants for me... :)
June 10 (9 years ago)
The Aaron
Pro
API Scripter
I don't know that there is one currently.
Now there is.

https://app.roll20.net/forum/post/2057653/allow-api-to-roll-tokens-from-rollable-table/#post-2057653
June 10 (9 years ago)
The Aaron
Pro
API Scripter
+1'd =D
June 18 (9 years ago)
So maybe I am not doing something correct in managing my tokens. The script works awesome and the names on the tokens update. The monster script rerolls all the HP and everyone is different at the start. But once I change one tokens HP. They all change. I think that I've gone through all the posts here but I just dont see where anyone else see's this behavior. What am I missing? Bar3 is set to HP.
June 19 (9 years ago)
Gen Kitty
Forum Champion
If you have multiple tokens linked to one character sheet, a change to the HP of one will change all linked HPs. What you need to do is doubleclick on the token and unlink bar3. It will keep the numbers it had previously, and you will still have all the token abilities and character attributes you had before.
June 19 (9 years ago)
The Aaron
Roll20 Production Team
API Scripter
Joe Z: Read this wiki page: https://wiki.roll20.net/Linking_Tokens_to_Journals

That should solve your woes. =D
June 19 (9 years ago)

Edited June 19 (9 years ago)
Unlink the HP!!! Okay. Tested and working. Thank you Aaron and GenKitty!!!
June 20 (9 years ago)
The Aaron
Pro
API Scripter
No problem!
June 20 (9 years ago)

Edited June 20 (9 years ago)
Andrew R.
Pro
Sheet Author

GenKitty said:

*shudder* GMs who do that to their players are making everyone's lives more difficult, in my highly biased opinion ^_-

(My 13th Age GM does this, which means I can't use @{target|token_name}, I have to do ?{Target} and enter Green 1 or Red 4. )

Oh, well, I'll try it if it'll make it easier for you. The whole Star Wars joke was a success, but that was before you started playing. ;-)

Edit: Done! Existing mooks, at least. Now to prep for the next session!
June 20 (9 years ago)
Gen Kitty
Forum Champion
Your game, your quirks. I adjusted :>