Way to populate tokens with names randomly

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Shadow Wizard
Giant
Posts: 225
Joined: Mon Apr 11, 2011 8:11 pm

Way to populate tokens with names randomly

Post by Shadow Wizard »

I thought before I build a macro I should ask if such a thing exists somewhere? Something that will take a map, and populate all the NPC's with random names?

User avatar
aliasmask
RPTools Team
Posts: 9153
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Way to populate tokens with names randomly

Post by aliasmask »

As with most things MT, you can, but it'll take work. See Wiki: copyToken() and Wiki: createToken(). There may be a name generator around here somewhere, but it all depend on how fancy you want to get. Sounds like a BoT project. May want to check out the BoT and see what he has. There may be relevant code if nothing else. Latest builds/links in Discord.

taustinoc
Dragon
Posts: 530
Joined: Mon Aug 03, 2015 6:30 pm

Re: Way to populate tokens with names randomly

Post by taustinoc »

If you're talking about just changing the name on existing tokens, you want the setName() function:

https://wiki.rptools.info/index.php/setName

Easiest would be to set up a table with name and use it in the macro. Shouldn't take more than a few lines of macro code at that point (assuming you have a list of names).

If you need a list of random names, give me a theme and I can make it happen.

Shadow Wizard
Giant
Posts: 225
Joined: Mon Apr 11, 2011 8:11 pm

Re: Way to populate tokens with names randomly

Post by Shadow Wizard »

Yea, I think I will create a macro to do it. I have already done 1/2 the work.
And thank you taustinoc for the reply. I know how to do it, I was just curious if anyone had created a macro to do it, but I do thank you for takign the time to reply.

taustinoc
Dragon
Posts: 530
Joined: Mon Aug 03, 2015 6:30 pm

Re: Way to populate tokens with names randomly

Post by taustinoc »

I have a macro, but it's outdated. Still works, but does stuff that hasn't been needed for quite a while (like padding leading zeros on token IDs to make them the proper length). You'll get a cleaner job of it if you do it yourself.

Jmr3366
Cave Troll
Posts: 86
Joined: Fri Feb 04, 2022 1:08 pm

Re: Way to populate tokens with names randomly

Post by Jmr3366 »

Wolph has a macro on the discord channels that does this and even attempt native names (eg. dwarfs are dwarfy names, elves are more elfie LOL :) )

discord link: https://discord.com/channels/2962308222 ... 8393101362

Post Reply

Return to “MapTool”