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

1430915338
The Aaron
Pro
API Scripter
Update 0.5.3: Fixed a bug in 0.5.2 preventing naming. (Thanks Gozer, Vince, Laurent!)
1430919396
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
1430920080
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?
1431372012
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: <a href="https://wiki.roll20.net/API:Script_Index" rel="nofollow">https://wiki.roll20.net/API:Script_Index</a> And the official script repository: <a href="https://github.com/Roll20/roll20-api-scripts" rel="nofollow">https://github.com/Roll20/roll20-api-scripts</a> And the script I use to assign random HP: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>...
1431430841
The Aaron
Pro
API Scripter
What he said. :) That GitHub link isn't working for me. Try this one: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>...
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!). <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>... 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.
1431436981
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! :)
1431439730
The Aaron
Pro
API Scripter
=D
1431457852
Gen Kitty
Forum Champion
Scripts to write, scripts to clean up, scripts to prettypretty up with tutorials....
1431458483
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!
1431464205
The Aaron
Pro
API Scripter
heheheheeh =D
1432064597
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? :/
1432064725
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
1432065184

Edited 1432065329
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!)
1432065310
The Aaron
Pro
API Scripter
=D And if you like dots, you can turn those on. =D
1432065370
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.
1432065714
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
1432066669
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. )
1432066767
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...
1432067102
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 :&gt;
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?
1433936163
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... :)
1433940920
The Aaron
Pro
API Scripter
I don't know that there is one currently.
Now there is. <a href="https://app.roll20.net/forum/post/2057653/allow-api-to-roll-tokens-from-rollable-table/#post-2057653" rel="nofollow">https://app.roll20.net/forum/post/2057653/allow-api-to-roll-tokens-from-rollable-table/#post-2057653</a>
1433942039
The Aaron
Pro
API Scripter
+1'd =D
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.
1434681531
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.
1434682751
The Aaron
Roll20 Production Team
API Scripter
Joe Z: Read this wiki page: <a href="https://wiki.roll20.net/Linking_Tokens_to_Journals" rel="nofollow">https://wiki.roll20.net/Linking_Tokens_to_Journals</a> That should solve your woes. =D
1434749214

Edited 1434749245
Unlink the HP!!! Okay. Tested and working. Thank you Aaron and GenKitty!!!
1434762260
The Aaron
Pro
API Scripter
No problem!
1434791099

Edited 1434794298
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!
1434807972
Gen Kitty
Forum Champion
Your game, your quirks. I adjusted :&gt;