Way to populate tokens with names randomly
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.
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.

-
- Giant
- Posts: 225
- Joined: Mon Apr 11, 2011 8:11 pm
Way to populate tokens with names randomly
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?
Re: Way to populate tokens with names randomly
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.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Way to populate tokens with names randomly
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.
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.
-
- Giant
- Posts: 225
- Joined: Mon Apr 11, 2011 8:11 pm
Re: Way to populate tokens with names randomly
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.
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.
Re: Way to populate tokens with names randomly
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.
Re: Way to populate tokens with names randomly
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

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