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 .
×

[HELP] 5e OGL equipment question

Hi! How do I display an item description in a chat from character sheet? I've tried to use  ' repeating_inventory_$0_itemcontent'  attribute   in a  default template but it didn't work. It displayed me tab and the buttons but neither of them function. What I'm trying to achive looks like this: The above pic is from a different thread  where  keithcurtis  showed how to combine description of an item with a button that allows to roll particular skill/tool.
1610499405

Edited 1610499682
Oosh
Sheet Author
API Scripter
Do your items have descriptions entered into the itemcontent area? Something like this should work: &{template:npcaction} {{rname=@{selected|repeating_inventory_$0_itemname}}} {{name=@{selected|repeating_inventory_$0_itemmodifiers}}} {{description=@{selected|repeating_inventory_$0_itemcontent}}} Or if you want a button, you can use a couple of tricks: [@{selected|repeating_inventory_$0_itemname}](`#&{template:npcaction} {{rname=@{selected|repeating_inventory_$0_itemname}}} {{name=@{selected|repeating_inventory_$0_itemmodifiers}}} {{description=@{selected|repeating_inventory_$1_itemcontent}}}" style="color:blue;font-weight: bold) Those $0 row indices are the easiest way to reference a repeating section, however they'll also change order when a player reshuffles that section. If you'd like to have the Attribute calls always point to the same item, you'll need to find the actual row ID via HTML inspection, the lines look like this: <div class="repitem" data-reprowid="-M3oR7AZOEE84nCbcAph"> and you grab the -M3oR7AZOEE84nCbcAph part. @{selected|repeating_inventory_ $0 _itemname} becomes @{selected|repeating_inventory_ -M3oR7AZOEE84nCbcAph _itemname}. These references never change unless the row is deleted.
1610499726

Edited 1610502368
Tom
Plus
Both solutions works. Thank you! EDIT: That's also a great suggestion. Thank you once more! 
One more question: can I somehow add it to the roll template? If yes, what is a correct code?
1611141912
Oosh
Sheet Author
API Scripter
Do you have an example of what you mean by adding it to a template? Do you have a macro where you want to place this, or somewhere on the actual character sheet? If you mean the actual roll template in the HTML, that can't be modified (not without a huge amount of effort, anyway).
I've tried somehow combine your code by wraping it with default template. Sadly, without any success. /w gm &{template:default} {{name=**Equipment**}}{{ Inventory = [@{selected|repeating_inventory_$0_itemname}] (`#&{template:npcaction} {{rname=@{selected|repeating_inventory_$0_itemname}}} {{name=@{selected|repeating_inventory_$0_itemmodifiers}}} {{description=@{selected|repeating_inventory_$1_itemcontent}}}") }} I would like to have one token button that displays in chat a template that has buttons assigned to particular inventory items (item 0,1,2 etc. in compliance with reapeting inventory section).
1611812088
Oosh
Sheet Author
API Scripter
Ah ok, there's a couple of issues in there, which only crop up once you try to nest it inside another template. All of the @ and the double left braces need to be escaped to avoid confusing the default roll template: /w gm &{template:default} {{name=**Equipment**}}{{Inventory=[@{selected|repeating_inventory_$0_itemname}](`#&{template:npcaction} {{rname=@{selected|repeating_inventory_$0_itemname}}} {{name=@{selected|repeating_inventory_$0_itemmodifiers}}} {{description=@{selected|repeating_inventory_$1_itemcontent}}}") }} Nesting entire templates in buttons is a relatively recent arcane art, but the good thing is you can generally escape anything inside the ( parentheses ), since we don't need any of it to parse successfully when the macro is run. There's a few single { braces left in there which could also be escaped, but leaving them in there to see what they break in the future is also fun :) Just make sure you leave the attribute reference in the [ squackets ] alone, or you'll get a very ugly button label!
Well, paraphrase Keanu: Oosh, you are breathtaking! Thank you :-)
1611875700
Oosh
Sheet Author
API Scripter
Wait, when did Keanu say that to me? I feel sure I'd remember...