Renamer Macro

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Raktus
Giant
Posts: 200
Joined: Fri Nov 26, 2010 10:18 pm

Renamer Macro

Post by Raktus »

Is there a way to randomize only a PART of a tokens name via macro?

I've been using a macro that defines a function on campaign load and then uses that function to choose a name from a random list of names.

What I need now is for the existing name on the token to only be amended by additional text.
So if I had a token that said 'Goblin' it could be changed to 'Nasty Goblin' or 'Diseased Goblin' with the push of a button.

The main problem I am having is that it's use is for everything, not just Goblins.

So is there a way to make a macro that changes the token name to "'RANDOM FROM LIST' 'USER ENTERED'"?

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Renamer Macro

Post by Irrlicht »

There are some passages I may not have understood, but look at this and tell me how it is.

First, you should set a table* (or more than one, that depends on you, but here I'll assume it is just one) where you store the "Nasty", "Diseased", etc.
Let's assume this table is called "Name Attributes".

Code: Select all

[h: Attr = table("Name Attributes")]

[h: token.name = Attr + " " + token.name]

Done. Remember to check the "apply to selected token" box in the macro.
You can select multiple tokens and have each of them renamed randomly with just one click (only, unless some intricated code is added, you may end up with two or more of them receiving the same attribute, but the probability for that lowers if your table has many entries).
Also, you may want to add an input of sort to ask you if you're sure about renaming them, to avoid accidentally clicking that macro button and having something renamed when it shouldn't be.

* You could use lists or json objects too, but to me it looks like tables are just plain simpler.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

Post Reply

Return to “Macros”