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

[Macro Help] Specific Roll20 Reference for a Token's "GM Notes" Field

1556476867

Edited 1556477655
I'm trying to make a macro that outputs various references of the character sheet and tokens of PCs/ Monsters/ NPCs for GM reference. I got most of it, but there is one field that I can't seem to refer to, the token's "GM Notes" Field.  I've dabbled with a few ideas, but I don't know how to tag it specifically, it keeps failing. tried /w gm @{selected|gm_notes} ... outright failed. tried /w gm @{selected|token_id|gm_notes} ... yields the token_id.  That was almost predictable, but I was trying. Anyone got any ideas?  I sometimes jot things down in the token's field that might come up later, rather than the character sheet.  The token is usually easier to grab than the sheets Bio tab in the middle of game, so it's just a matter of getting those notes on demand when I want to reference them as quickly.  It's also useful when named NPCs share the same character sheet, such as commoners.  If I had a macro I could run by selecting the token and it would pop up, that'd be great for these purposes. I want to avoid running API's on this one, as I'm sure Roll20 built a way to reference that field into it.
1556486235
The Aaron
Roll20 Production Team
API Scripter
There isn't an automated way to access it beyond the API.
1556486446
The Aaron
Roll20 Production Team
API Scripter
Here's a script I wrote for accessing it. !wgmnote will whisper the contents to the GM for all selected tokens. You can show them to the players with: !gmnote and you can append something with a - to search for any lines containing that: !wgmnote-gold Code: on('ready',()=>{ const blockElements = [ 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'pre', 'address', 'blockquote', 'dl', 'div', 'fieldset', 'form', 'hr', 'noscript', 'table','br' ]; const rStart=new RegExp(`<\\s*(?:${blockElements.join('|')})\\b[^>]*>`,'ig'); const rEnd=new RegExp(`<\\s*\\/\\s*(?:${blockElements.join('|')})\\b[^>]*>`,'ig'); const getLines = (str) => (rStart.test(str) ? str .replace(/[\n\r]+/g,' ') .replace(rStart,"\r$&") .replace(rEnd,"$&\r") .split(/[\n\r]+/) : str .split(/(?:[\n\r]+|<br\/?>)/) ) .map((s)=>s.trim()) .filter((s)=>s.length) ; const cmdRegex = /^!(w?)gmnote(?:-(.*))?(.*)$/i; on('chat:message',(msg) => { if('api' === msg.type && cmdRegex.test(msg.content) && playerIsGM(msg.playerid) ){ let parts = msg.content.split(/\s+--ids\s+/i); let match=parts[0].match(cmdRegex); let output = match[1].length ? '/w gm ' : ''; let regex; let ids = (msg.selected ? msg.selected.map((o)=>o._id) : []); if(parts[1]){ ids = [...ids, ...parts[1].split(/\s+/)]; } if(match[2]){ regex = new RegExp(`^${match[2]}`,'i'); } ids.map( id => getObj('graphic',id)) .filter( o =>undefined !== o && o.get('gmnotes').length > 0 ) .forEach( o => { log(o); if(regex){ let lines = _.filter( getLines(unescape(o.get('gmnotes'))), (l) => regex.test(l.replace(/<[^>]*>/g,'')) ).join('<br>'); sendChat(o.get('name'), `${output}${lines}`); } else { sendChat(o.get('name'), `${output} &{template:spell}}{{name=${unescape(o.get('gmnotes')).replace(/(?:[\n\r]+|<br\/?>)/g,'<br>')} }}`); } }); } }); });
Thanks Aaron.  I wish that would fit the role I wanted, but - as I understand it, API's always have to be called out of format, on the beginning of a new line with the preceding "!" being the first thing. In this case I wanted it as part of the existing template, as a reference field that could be modified to said template (in my case always being the 5e-shaped one) So, for example, it would go like this: /w gm &{template:5e-shaped}{{title=some title}}{{Token GM Notes=!wgmnote}} Versus that method because of constraints of API calls /w gm &{template:5e-shaped}{{title=some title}}{{Token GM Notes=Nothing Appears}} !wgmnote
1556495553
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Actually, that template code is in the script. You can edit it for whatever roll template you want.
1556497136
The Aaron
Roll20 Production Team
API Scripter
If you have a bar you don't use, I could make a script that keeps that bar's value set to the contents of the GM notes. Could even be the max of a bar you only use current on.  That would let you edit the GM notes to your heart's content, and reference it as a bar. 
The Aaron said: If you have a bar you don't use, I could make a script that keeps that bar's value set to the contents of the GM notes. Could even be the max of a bar you only use current on.  That would let you edit the GM notes to your heart's content, and reference it as a bar.  I think your onto something there, but what if there were an API that would regularly update information from the token's GM Note field, to a new Attribute called "token_gm_note" on it's character sheet.  In doing so, I could easily reference it as "@{selected| token_gm_note }" to draw it into a macro, without having to invoke the API as part of that reference, skirting around the issue of formatting.  Would that work?  If so, could the same API also reference the character sheet's GM Note's the same way (creating "character_gm_note" and referencing "@{selected| character_gm_note }" )? I'm guessing this would involve sheetworkers, though I only vaguely understand that meaning.  They would have to keep regular updates on changes made to each token/ character's fields to accomplish this as a current events type of thing. I don't know.  I'm just spitballing ideas as usual.
1556498467

Edited 1556498484
The Aaron
Roll20 Production Team
API Scripter
I could do that also (I've done similar for status markers), but you'd lose the ability to reference the GM notes of different tokens representing the same character.  The last one updated would always be the one in the attribute. Also, no sheet workers required.
btw - i had a total fail for the snippet, but changed a couple lines at the very end.  Turns out i don't have access to the "Spell" template.  I could have changed it to default, but decided on my usual 5e-shaped with some additional formatting: ... else {                         sendChat(o.get('name'), `${output} &{template:5e-shaped}}{{title=Referenced Token's GM Notes}}{{text_center=${unescape(o.get('gmnotes')).replace(/(?:[\n\r]+|<br\/?>)/g,'<br>')} }}`);                     }                 });         }     }); });
1556499630
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Wolf Thunderspirit said: btw - i had a total fail for the snippet, but changed a couple lines at the very end.  Turns out i don't have access to the "Spell" template.  I could have changed it to default, but decided on my usual 5e-shaped with some additional formatting: ... else {                         sendChat(o.get('name'), `${output} &{template:5e-shaped}}{{title=Referenced Token's GM Notes}}{{text_center=${unescape(o.get('gmnotes')).replace(/(?:[\n\r]+|<br\/?>)/g,'<br>')} }}`);                     }                 });         }     }); }); Great idea! ;)
1556499927

Edited 1556500133
The Aaron said: I could do that also (I've done similar for status markers), but you'd lose the ability to reference the GM notes of different tokens representing the same character.  The last one updated would always be the one in the attribute. Also, no sheet workers required. Yeah, that would be a problem.  Alot of the one's I want to ref are based on the commoner character sheet.  But these commoners have names.  I just realized the issue you're referring to now. Unless we could make it dynamic and additive?  Bear with me here: Let's adapt the idea from being so singular to being specific.  So its not only a reference, but a direct-to-token reference also.  The character GM Notes should be the same way as I mentioned above, because if you're wanting info from the character sheet, fine, one size needs to fit all.  But for Tokens, one stat may fit all, but name, etc. may change, and the way we do that is through token id.  So why not incorporate that into the reference attribute? keeping with the theme above, we draw the token_id as part of the attribute, and reference it as well.  This would mean that the same character sheet may have many obscure attributes as more tokens reference the sheet.  So let's say we have a token named Bob that has the token id "-LdNGuMUZ0rw5Hj608KG", and Sally has "-LdNH2FeqnyeSccpW7zu", but both reference the Commoner sheet.  If I knew how to do it, I'd let the API know that "token_gm_note_-LdNGuMUZ0rw5Hj608KG" attribute refers to Bob, and when referenced by @{selected|token_gm_note_@{selected|token_id}}, it shows "I am Bob", because that's what's written in the token's GM Notes and the attribute when it updates.  Then, by the same manner, "token_gm_note_-LdNH2FeqnyeSccpW7zu" shows "I am Sally" for the same reason. Is that do-able or no?
1556503035
The Aaron
Roll20 Production Team
API Scripter
The API part is and I had considered it, but I rejected it because I don't think you can construct attribute names in that manner. Happy to be proven wrong though. =D
Were you proven wrong?  I'm not sure on half this stuff Aaron - I am spitballing and speculating ... it would be easy - at my knowledge level - to get tripped up on idea vs what is possible. The Aaron said: The API part is and I had considered it, but I rejected it because I don't think you can construct attribute names in that manner. Happy to be proven wrong though. =D
1556517945
The Aaron
Roll20 Production Team
API Scripter
I haven't been back to my computer to try it yet, I was being lazy. =D I'll do some experimenting tomorrow. 
1556521074
GiGs
Pro
Sheet Author
API Scripter
Aaron, in your gmnote script above, can you explain this line? let parts = msg.content.split(/\s+--ids\s+/i); I dont know regex, and I can gather this is creating an array, but what will the parts be?
Well, I know the calls will work, if they can be interpreted as something valid.  It's just a matter of moving them from their respective GM notes onto an Attribute.  The example above was drawn by calling (Token) @{selected|token_gm_notes_@{selected|token_id}} and (Character) @{selected|character_gm_notes} - they fail to be found because there is nothing, but what is left in its place shows that if there were something, then I'd be in business to Identify Commoners with different notes using the same npc stat sheet. The Aaron said: I haven't been back to my computer to try it yet, I was being lazy. =D I'll do some experimenting tomorrow. 
1556532585

Edited 1556532640
GiGs
Pro
Sheet Author
API Scripter
Are you saying this worked:   @{selected|token_gm_notes_@{selected|token_id}} ? It's my understanding that because of the roll20 parser's order of operations, you cannot construct attribute names that way (or any way from parts). I'd love to be proven wrong because it opens up a lot of uses, but I've never seen anyone make it work.
1556538563
The Aaron
Roll20 Production Team
API Scripter
GiGs said: Aaron, in your gmnote script above, can you explain this line? let parts = msg.content.split(/\s+--ids\s+/i); I dont know regex, and I can gather this is creating an array, but what will the parts be? It splits on the string " --ids ". Basically giving the command in 0, and the space delimited token ids in 1.     \s matches any white space.     + makes the previous matcher match 1 or more.     /PATTERN/i makes it case-insensitive.  Looks like you can pass that script a bunch of token ids too.
1556538650
The Aaron
Roll20 Production Team
API Scripter
I think that will just create the text in chat, not actually do the expansion to the contents. Wolf Thunderspirit said: Well, I know the calls will work, if they can be interpreted as something valid.  It's just a matter of moving them from their respective GM notes onto an Attribute.  The example above was drawn by calling (Token) @{selected|token_gm_notes_@{selected|token_id}} and (Character) @{selected|character_gm_notes} - they fail to be found because there is nothing, but what is left in its place shows that if there were something, then I'd be in business to Identify Commoners with different notes using the same npc stat sheet. The Aaron said: I haven't been back to my computer to try it yet, I was being lazy. =D I'll do some experimenting tomorrow. 
GiGs said: Are you saying this worked:   @{selected|token_gm_notes_@{selected|token_id}} ? It's my understanding that because of the roll20 parser's order of operations, you cannot construct attribute names that way (or any way from parts). I'd love to be proven wrong because it opens up a lot of uses, but I've never seen anyone make it work. The Aaron said: I think that will just create the text in chat, not actually do the expansion to the contents. Wolf Thunderspirit said: Well, I know the calls will work, if they can be interpreted as something valid.  It's just a matter of moving them from their respective GM notes onto an Attribute.  The example above was drawn by calling (Token) @{selected|token_gm_notes_@{selected|token_id}} and (Character) @{selected|character_gm_notes} - they fail to be found because there is nothing, but what is left in its place shows that if there were something, then I'd be in business to Identify Commoners with different notes using the same npc stat sheet. The Aaron said: I haven't been back to my computer to try it yet, I was being lazy. =D I'll do some experimenting tomorrow.  If that's going to be the case, then that will be a problem in selective based referencing.  I thought seeing the text there meant the operation would call.  I should manually make an attribute and see if it works.  bbiab.  Suspecting you're both right, which means my remedy will go to nada very shortly.
I'm just gonna sit here and cry now.  I thought maybe placing a formula within the sheet to prepare the attribute before call would work, but I'm just not skileld enough with math and forcing it to use math to work.  I've seen Aaron use kh in rolls to select something abstracted, but I don't know how to set it up in this case to prepare the Attribute to be called in order of operations.  Bah ... back to the drawing board.  Thanks for the heads up GiG - still getting used to all this code.  Sometimes it gives me a headache. Is there any way to use an API call as a substitute?  So that it's raw information can be formatted and work internal to templates?  Or does the API call (!) have to always be the first thing in a line, and outside of a template, in order to work? I'm guessing, in other words, you can't have this call just be a direct from selection output, anywhere in the macro, i.e, this isn't possible: {{GM NOTES (TOKEN)=!wgmnotes}} Could always work as a link though.  I know that you can format links with API calls, but they won't fire until the link is hit.  And I suppose I don't 'always' need the info - the dump I pull is for a lot of computational info that the shaped statblock doesn't give, like drowning, jumping, and other rules.  So, probably just sit on this unless other ideas for a workaround are figured.  I don't understand order of operations (clearly) to get ahead of the process myself. My idea was to go through math, if it's order was higher, and use substitution, in the way queries do.  So give a 1 and 0 value, give the 1 a substitute output of the formatted token_gm_notes_[selected token id], and do "kh1".  But I'm not that good at getting these things myself, so I couldn't get it to work.
1556579831
The Aaron
Roll20 Production Team
API Scripter
The only options with the API are: API Command Button:  {{GM NOTES=[Token](!wgmnotes)}} API to put it in one of the bars: {{GM NOTES (Token)=@{selected|bar3|max} }} API to put it in an attribute (and live with it being character only): {{GM NOTES (Token)=@{selected|gm_notes_token} }}
1556593602

Edited 1556593676
The Aaron said: The only options with the API are: API Command Button:  {{GM NOTES=[Token](!wgmnotes)}} API to put it in one of the bars: {{GM NOTES (Token)=@{selected|bar3|max} }} API to put it in an attribute (and live with it being character only): {{GM NOTES (Token)=@{selected|gm_notes_token} }} Based on those constraints; Stuck with #1 1) Only Feasible option 2) bar 1 = HP, bar 2 = AC, bar 3 = speed 3) defeats the point of the idea - which was to separate information across a broad range of creatures that might use the same character sheet with diff tokens/ names.  Just Phandalin alone is tons of commoners with different names, quest hooks, and agendas/ factions. I wish that Roll20 had made those fields acquirable at the macro level.  But wish in one ...
1556595370
GiGs
Pro
Sheet Author
API Scripter
I'm not sure I totally understand your goal here, but I know whatever it is, it'll be achievable through the API. I'm confused by this section Let's adapt the idea from being so singular to being specific.  So its not only a reference, but a direct-to-token reference also.  The character GM Notes should be the same way as I mentioned above, because if you're wanting info from the character sheet, fine, one size needs to fit all.  But for Tokens, one stat may fit all, but name, etc. may change, and the way we do that is through token id.  So why not incorporate that into the reference attribute? keeping with the theme above, we draw the token_id as part of the attribute, and reference it as well.  This would mean that the same character sheet may have many obscure attributes as more tokens reference the sheet.  So let's say we have a token named Bob that has the token id "-LdNGuMUZ0rw5Hj608KG", and Sally has "-LdNH2FeqnyeSccpW7zu", but both reference the Commoner sheet.  If I knew how to do it, I'd let the API know that "token_gm_note_-LdNGuMUZ0rw5Hj608KG" attribute refers to Bob, and when referenced by @{selected|token_gm_note_@{selected|token_id}}, it shows "I am Bob", because that's what's written in the token's GM Notes and the attribute when it updates.  Then, by the same manner, "token_gm_note_-LdNH2FeqnyeSccpW7zu" shows "I am Sally" for the same reason. Along with your other posts, I'm just not grasping what it is you want. Can you give concrete examples. Don't use hypotheticals, like "I am Bob". I'm very literal and have trouble parsing them. Pick a character sheet you already have that you want to access in this way, what tokens are linked to it, and what specific  information do you want to store about those tokens to display later. In your single macro that displays information to chat, how many attributes would it read, and what would they contain? Also, are you displaying the information to the PCs, or for your own use. Basically, try to describe a complete use-case, not partial bits that we have to guess how they fit together.
1556595633
The Aaron
Roll20 Production Team
API Scripter
For 2, you could use the max portion of bar 2 or bar 3 as you probably don't have a range of AC or Speed   Wolf Thunderspirit said: The Aaron said: The only options with the API are: API Command Button:  {{GM NOTES=[Token](!wgmnotes)}} API to put it in one of the bars: {{GM NOTES (Token)=@{selected|bar3|max} }} API to put it in an attribute (and live with it being character only): {{GM NOTES (Token)=@{selected|gm_notes_token} }} Based on those constraints; Stuck with #1 1) Only Feasible option 2) bar 1 = HP, bar 2 = AC, bar 3 = speed 3) defeats the point of the idea - which was to separate information across a broad range of creatures that might use the same character sheet with diff tokens/ names.  Just Phandalin alone is tons of commoners with different names, quest hooks, and agendas/ factions. I wish that Roll20 had made those fields acquirable at the macro level.  But wish in one ...
Won't matter, as to call the reference would be very difficult, since the idea of @{selected|toke_gm_notes_@{selected|token_id}} isn't allowed by order of operations, as you said correctly. I will include the lengthy macro for you below your quote, but to answer some of the other questions: 1) Commoner Character Sheet, links to tokens for Sister Gareale, Queline Alderleaf, and the other NPCs of Phandalin.&nbsp; In each token's GM notes are the factions they belong to, the quests they can give, etc.&nbsp; Anything I write for the selected token's GM notes. 2) As I said - will include the specific info of the macro below 3) Always for DM use only (Eye spy, with my little eye ...) 4) I think I have shown use-case, but trying to expound as your requested. GiGs said: I'm not sure I totally understand your goal here, but I know whatever it is, it'll be achievable through the API. I'm confused by this section Let's adapt the idea from being so singular to being specific.&nbsp; So its not only a reference, but a direct-to-token reference also.&nbsp; The character GM Notes should be the same way as I mentioned above, because if you're wanting info from the character sheet, fine, one size needs to fit all.&nbsp; But for Tokens, one stat may fit all, but name, etc. may change, and the way we do that is through token id.&nbsp; So why not incorporate that into the reference attribute? keeping with the theme above, we draw the token_id as part of the attribute, and reference it as well.&nbsp; This would mean that the same character sheet may have many obscure attributes as more tokens reference the sheet.&nbsp; So let's say we have a token named Bob that has the token id "-LdNGuMUZ0rw5Hj608KG", and Sally has "-LdNH2FeqnyeSccpW7zu", but both reference the Commoner sheet.&nbsp; If I knew how to do it, I'd let the API know that "token_gm_note_-LdNGuMUZ0rw5Hj608KG" attribute refers to Bob, and when referenced by @{selected|token_gm_note_@{selected|token_id}}, it shows "I am Bob", because that's what's written in the token's GM Notes and the attribute when it updates.&nbsp; Then, by the same manner, "token_gm_note_-LdNH2FeqnyeSccpW7zu" shows "I am Sally" for the same reason. Along with your other posts, I'm just not grasping what it is you want. Can you give concrete examples. Don't use hypotheticals, like "I am Bob". I'm very literal and have trouble parsing them. Pick a character sheet you already have that you want to access in this way, what tokens are linked to it, and what specific&nbsp; information do you want to store about those tokens to display later. In your single macro that displays information to chat, how many attributes would it read, and what would they contain? Also, are you displaying the information to the PCs, or for your own use. Basically, try to describe a complete use-case, not partial bits that we have to guess how they fit together. /w gm &amp;{template:5e-shaped}{{title=NPC's Bio on [@{selected|token_name}](<a href="http://journal.roll20.net/character/@{selected|character_id})}}{{.-----Role" rel="nofollow">http://journal.roll20.net/character/@{selected|character_id})}}{{.-----Role</a> Play Characteristics-----= **Languages:** @{selected|languages} **Passive History** @{selected|passive_history} ; *DM Rolls: (** [[1d20+@{selected|history}]] ** / **[[1d20+@{selected|history}]] **)* **Passive Insight** @{selected|passive_insight} ; *DM Rolls: ( **[[1d20+@{selected|insight}]] ** / **[[1d20+@{selected|insight}]] **)* }}{{Height= **Jump:** This rule assumes that the height of your jump doesn’t matter, such as a jump across a stream or chasm. At your DM’s option, you must succeed on a ** *DC 10 Strength (Athletics)* ** check to clear a low obstacle (no taller than a quarter of the jump’s distance), such as a hedge or low wall. Otherwise, you hit it. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Athletics Check Results: (**[[1d20+@{selected|athletics}]] / [[1d20+@{selected|athletics}]]**) When you land in difficult terrain, you must succeed on a ** *DC 10 Dexterity (Acrobatics)* ** check to land on your feet. Otherwise, you land prone. As NPC's, this assumes a height of 5 feet (Average Medium Sized). &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Acrobatics Check Results: (**[[1d20+@{selected|acrobatics}]] / [[1d20+@{selected|acrobatics}]]**) &amp;nbsp;&amp;nbsp;&amp;nbsp;**Running Jump**: Long [[@{strength}]] feet, High [[3+@{strength}]] feet. Reach [[round( [[5*1.5]] + [[3+@{strength}]] )]] feet high. &amp;nbsp;&amp;nbsp;&amp;nbsp;**Standing Jump**: Long [[round(@{strength}/2)]] feet, High [[round((3+@{strength})/2)]] feet. Reach [[round( [[5*1.5]] + [[round((3+@{strength})/2)]] )]] feet high.}}{{Suffocation/ Drowning:= At the start of their next turn after choking, they drop to 0 Hit Points and are dying, and can’t regain Hit Points or be stabilized until they can breathe again. &amp;nbsp;&amp;nbsp;&amp;nbsp;**Hold Breath** [[1+@{selected|constitution_mod}]] minutes. &amp;nbsp;&amp;nbsp;&amp;nbsp;**Choking** [[@{selected|constitution_mod}]] rounds}}{{.-----Combat Characteristics-----= **Passive Perception**: @{selected|passive_perception} ; *DM Rolls: ( **[[1d20+@{selected|perception}]]** / **[[1d20+@{selected|perception}]]** )* **Speed:** &amp;nbsp;&amp;nbsp;&amp;nbsp;Walking: @{selected|speed} &amp;nbsp;&amp;nbsp;&amp;nbsp;Climbing: @{selected|speed_climb} &amp;nbsp;&amp;nbsp;&amp;nbsp;Fly: @{selected|speed_fly} / Hover: @{selected|speed_fly_hover} &amp;nbsp;&amp;nbsp;&amp;nbsp;Swim: @{selected|speed_swim} &amp;nbsp;&amp;nbsp;&amp;nbsp;Burrow: @{selected|speed_burrow} **Damage Immunities:** @{selected|damage_immunities} **Damage Resistances:** @{selected|damage_resistances} **Condition Immunities:** @{selected|condition_immunities}}} {{GM Notes= **(Token):** @{selected|token_gm_notes_@{selected|token_id}} **(Character Sheet):** @{selected|character_gm_notes} }} {{Statblock= [Shaped Statblock](~@{selected|character_id}|Statblock) }}{{Spells:= [Shaped Spell list](~@{selected|character_id}|Spells) }} In Bold is what hasn't worked as yet - as it can't be implemented.&nbsp; That will get replaced (In order to work) with: {{GM Notes= **Character Sheet:** @{selected|character_gm_notes} [Click Here for Selected Token](!wgmnote) }}
That's true.&nbsp; I suppose if it had a config option various places could be set.&nbsp; And bar 2 or 3 max would be open for me - I just didn't know how that would interact with the other values.&nbsp; You're suggesting it has no effect, so, yeah, that'd work, and would make it easy to reference.&nbsp; Would the GM note affect anything if there was a number in there? For example, AC = 14, GM Note = "NPC can call 6 demons to their side".&nbsp; Would Roll 20 try to see this as 14 / 6 and show a Bar? The Aaron said: For 2, you could use the max portion of bar 2 or bar 3 as you probably don't have a range of AC or Speed &nbsp; Wolf Thunderspirit said: The Aaron said: The only options with the API are: API Command Button:&nbsp; {{GM NOTES=[Token](!wgmnotes)}} API to put it in one of the bars: {{GM NOTES (Token)=@{selected|bar3|max} }} API to put it in an attribute (and live with it being character only): {{GM NOTES (Token)=@{selected|gm_notes_token} }} Based on those constraints; Stuck with #1 1) Only Feasible option 2) bar 1 = HP, bar 2 = AC, bar 3 = speed 3) defeats the point of the idea - which was to separate information across a broad range of creatures that might use the same character sheet with diff tokens/ names.&nbsp; Just Phandalin alone is tons of commoners with different names, quest hooks, and agendas/ factions. I wish that Roll20 had made those fields acquirable at the macro level.&nbsp; But wish in one ...
The Aaron said: For 2, you could use the max portion of bar 2 or bar 3 as you probably don't have a range of AC or Speed &nbsp; Wolf Thunderspirit said: The Aaron said: The only options with the API are: API Command Button:&nbsp; {{GM NOTES=[Token](!wgmnotes)}} API to put it in one of the bars: {{GM NOTES (Token)=@{selected|bar3|max} }} API to put it in an attribute (and live with it being character only): {{GM NOTES (Token)=@{selected|gm_notes_token} }} Based on those constraints; Stuck with #1 1) Only Feasible option 2) bar 1 = HP, bar 2 = AC, bar 3 = speed 3) defeats the point of the idea - which was to separate information across a broad range of creatures that might use the same character sheet with diff tokens/ names.&nbsp; Just Phandalin alone is tons of commoners with different names, quest hooks, and agendas/ factions. I wish that Roll20 had made those fields acquirable at the macro level.&nbsp; But wish in one ...
1556689525
GiGs
Pro
Sheet Author
API Scripter
Looking at your macro code, it looks to me like a solution might be: Writing a dedicated script, that you give it a token name, and attribute name, and it constructs the full macro call above, and creates a proper, working reference to an attribute that contains the token "gm notes" Within the script you could easily take the two parts: " @{selected|token_gm_notes_" and "token_id}" &nbsp;and stick them together to get a working reference. You cant do that in a macro, because the order of operations interferes, but you can do it within a script. Then the script can print out the macro call, with the rolltemplate, and get what you want. Wouldnt it be easier to use something like token_name over token_id though? How were you planning to create the attributes which store this information?
1556731882

Edited 1556732645
Aaron was helping me transfer the GM notes from the Token into an attribute within the Character Sheet, however, referencing that specific attribute, because of the order of operations you mentioned, would be difficult via "@{selected|...}".&nbsp; I have no idea about regex code and whatever else the API's in Roll20 use.&nbsp; I tried looking and I - way back a long time ago - used to write php and Javascript, but can't make sense of regex.&nbsp; Guess I need a Regex for Dummies book ... lol. However, if he can use the max field of token bars I don't use, that may work - i just worry that if any numbers are not text written (two vs 2), that the numbers may confuse the Roll20 parser and be thought of as a valid max reference.&nbsp; So, say for instance there is a 14 amor class and somewhere in the GM notes is the number 6, a bar would appear that sees 14 / 6. It may be easier to use the token name, but I don't know for sure.&nbsp; But I think the bar|max idea that Aaron has would be the simplest, as I could call it simply from @{selected|bar2|max}.&nbsp; If the API has a config option, GM notes from the Character Sheet and Token could be stored to the individual's flavor (as mine may not be the same as others) and useful for others who want individual token's information referenced.&nbsp; This could be anything.&nbsp; If you have a bunch of spellcasters, for example, using the same character sheet, you could jot down their spell slot use in the GM notes of the token, etc. - the possibilities being endless to the desire of the individual - but a quick call would reveal how many slots they expended as a token, and not per character sheet in the above example.&nbsp; The main issue being that you don't want to have to create a character sheet for every commoner in the game, but sometimes there are some commoners - such as all of those in LMoP - that actually do need breakdowns, albeit not a complete sheet. Understand that I'm recreating an extension off of LMoP though, not the actual module.&nbsp; For reference, someone else ran the purchased module for us, I'm taking over as DM in the aftermath of that module to make it a full campaign.&nbsp; Just as an aside, mine might have something to do with some 'radiant pools', but that's neither here nor there to the subject at hand ;-) GiGs said: Looking at your macro code, it looks to me like a solution might be: Writing a dedicated script, that you give it a token name, and attribute name, and it constructs the full macro call above, and creates a proper, working reference to an attribute that contains the token "gm notes" Within the script you could easily take the two parts: " @{selected|token_gm_notes_" and "token_id}" &nbsp;and stick them together to get a working reference. You cant do that in a macro, because the order of operations interferes, but you can do it within a script. Then the script can print out the macro call, with the rolltemplate, and get what you want. Wouldnt it be easier to use something like token_name over token_id though? How were you planning to create the attributes which store this information?