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

TokenMod monster fix macro naming issue?

January 15 (4 years ago)

Edited January 15 (4 years ago)

Hello!

Using TokenMod, TokenNameNumber, and MonsterHitDice, I have the following macro:

!token-mod --set name|"@{selected|character_id} %%NUMBERED%%" bar2_link|npc_ac 
!token-mod --set defaulttoken

So, when I run the macro while having a token selected that represents an npc character (or creature), it does all the things correctly except the name is a random string of values that I assume to be a page- or campaign-specific character_id, but I would rather it display the as "Character Name %%NUMBERED%%" so that it will display in the turn order with the appropriate name.

This is loosely based on a macro I saw TheAaron say he used, but that was from a four year old discussion post and it wasn't working for me so I started from the bottom and just had it affect the things I needed. 

Any ideas?

Additionally, if anyone knows if TokenMod can query which character the token belongs to, instead of a manual edit, that would be super useful to start this macro with.

January 15 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Try this:

!token-mod --set name|"@{selected|character_name} %%NUMBERED%%" bar2_link|npc_ac defaulttoken
January 15 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

What do you mean by your last sentence?

January 15 (4 years ago)

Thanks Aaron, that worked exactly as I needed!

Oh, I mean if it is possible for token mod to accept a query that could open a dropdown to select a character that the selected token represents, instead of either manually writing the command, or going into the token settings to set the Represents field. 

January 15 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Ah, I see.  TokenMod is pretty forgiving of what you pass it for represents:

!token-mod --set represents|"?{What character}" 


Here's from the help file:

Character ID

You can use the @{CHARACTER NAME|character_id} syntax to specify a character_id directly or use the name of a character (quoted if it contains spaces) or just the shortest part of the name that is unique ('Sir Maximus Strongbow' could just be 'max'.). Not case sensitive: Max = max = MaX = MAX

Available Character ID Properties:
represents

Here is setting the represents to the character Bob.

!token-mod --set represents|@{Bob|character_id}

Note that setting the represents will clear the links for the bars, so you will probably want to set those again.

January 15 (4 years ago)

Ah okay, I had seen that earlier, and had tried figuring something out with what I did now of query syntax, with no luck. I think I was missing the quotation marks to let there be spaces in the name. Thanks!

January 15 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Yeah, I keep meaning to rewrite all of the documentation for TokenMod... and all of TokenMod... but of course, time is always short... =D