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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Button with Character ID?

Howdy all! I'd like to put a button on my character sheet that puts out !myfunction character_id to the API. How do I do that? I've tried @{Name|id} @{Name|_id} @{Name|characterid} @{Name|_characterid} and none of it works, because I think it's searching the attribute space and not the property space. Is there an easy way to spit out the character id, or will I have to kludgily handle this on the API side?
1401952738
Alex L.
Pro
Sheet Author
Kim L. said: Howdy all! I'd like to put a button on my character sheet that puts out !myfunction character_id to the API. How do I do that? I've tried @{Name|id} @{Name|_id} @{Name|characterid} @{Name|_characterid} and none of it works, because I think it's searching the attribute space and not the property space. Is there an easy way to spit out the character id, or will I have to kludgily handle this on the API side? Isnt it just @{character_id} although that may only work with selected and target and it may only work for tokens.
1401953339

Edited 1401953447
Try @(selected|character_id} or @{Name|character_id} I figured it out because they added attr_character_name to link character_name to the new character sheets, and at a guess I found character_id links to the character id, not the token id. Looks like Alex scooped me on it. It works for selected tokens or by name references, and by @{target|character_id} too, in a character sheet it'd be value=@{character_id} disabled=true
1401953456
Alex L.
Pro
Sheet Author
Logan P. said: Try @(selected|character_id} or @{Name|character_id} I figured it out because they added attr_character_name to link character_name to the new character sheets, and at a guess I found character_id links to the character id, not the token id. its just @{character_id}
Works like a charm. It's always the placement of the underscore... Thanks a bunch! :-)