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

Using token name in a macro

Okay, you can indeed use @{selected|token_name} and it will return token name in chat box. But what about something like @{Jack|token_name}? It doesn't seem to work for me. Game is trying to read character attributes when you using direct name of a character for some reason. Is there a way to use token name of said "Jack" in macros?
December 17 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

The problem is that a character would have a one-to-many relationship. Any number of tokens could be assigned to the character Jack. So far as I know, there is no macro command to pull a default token name, though I imagine it is likely possible with the API.

well that's bad news for me. thanks for the answer sir.

December 18 (6 years ago)
GiGs
Pro
Sheet Author
API Scripter

Does it need to be the token name? i think you can use @{Jack|character_name} 

Thinking about it, I'm having trouble figuring out why you'd need this. If you already know this bit @{Jack|, why do you need to extract the token name programmatically. You can just write it in, since you are already writing Jack.

https://i.imgur.com/xT4qUCV.jpg

the idea behind that is to make a visual sheet and inventory without using standart character sheets nor using API. let's imagine there is character named Jack. there is going to be tokens such as "Jack's dexterity" or "Jack's stamina" or "Jack's fatigue". and player that controls Jack will input hes stats as said token names right on the playing field. 

i can do that no problem, sure, but i need to automate the whole process of check rolling because my game having some complicated rules that are hard to remember but ok if they are in the macro.

so problem is i can't use needed dynamic part (token name) of a "Jack's dexterity" to make this all work. 

sorry for bad english

December 18 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I don't think that you can do what you are trying to do without the API. Tokens just aren't built to act that way. Basically, you are trying to create an entirely different way to do a character sheet. I would suggest using Attributes on the Attributes and abilities tab, and having players pop the tab out of the window for easy reference during play.

yeah it's basically my plan for now.