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

Help with drop down menu of abilities. Abilities use templates. & HTML entities replacement

1587764736

Edited 1587766100
Past:  Sheet abilities with "Show as Token Action" clutter the screen. Each ability uses &{template:default}. I created an ability called "SkillMenu" that creates a chat menu listing abilities and even put them inside a template. Now chat is cluttered. I want a drop down menu instead. This requires HTML entities replacement text. What works: SkillMenu ?{Skill |Skill1, %{selected|Skill1} |Skill2,%{selected|Skill2} } Skill1 &{template:default}{{Skill1=[[1d6+100]]}}   I want to add name & add attribute to the role calculation so that it looks like this: However, it breaks when add a template name or attribute to Skill1 ability: Normal With HTML replacements Template Name &{template:default&{{name=@{selected|token_name}}}{{Skill1=[[1d6+100]]}} &{template:default}{{name=@{selected|token_name}}}{{Skill1=[[1d6+100]]}} Attribute &{template:default}{{Skill1=[[1d6+@{Intelligence}]]}} &{template:default}{{Skill1=[[1d6+@{Intelligence}]]}}
1587785923

Edited 1587785983
GiGs
Pro
Sheet Author
API Scripter
You never, ever add html replacements within an attribute call. So dont do this: @{selected|token_name} or this @{Intelligence} PS: thats a great way to describe your problem. You formatted the question excellently.
Thanks for the complement. I already did HTML replacements within "What works" in my original post. I figure there's some bit of coding I'm doing wrong, perhaps putting an HTML replacement where I shouldn't or using @ when I should use # or % or ~. Not sure.
1587786958
GiGs
Pro
Sheet Author
API Scripter
I just pointed out some html replacements you are trying, that you should not do.  never use rolltemplates on anything that begins @{ or %{.
Oh, I get it. Any other ideas?
1587825993
GiGs
Pro
Sheet Author
API Scripter
Yes, try replacing the other stuff, but not those. Personally I rarely use any macros that require html substution any more. I prefer using chat menus : you set up up a macro for each skill (a very simple macro with no html), and then create a chat menu that prints a button for each skill in chat. Then you can click the skill you want.
I'm still attempting drop down menu of abilities with templates. Solution to cluttered chat menu: /w @{selected|character_name}. That way, it's a private message to yourself. I can get the drop down to work if I sacrifice templates, but I'm not willing to do that.
1587837022

Edited 1587837099
Ziechael
Forum Champion
Sheet Author
API Scripter
Your initial usecase should work as you've done it (taking into account the unecessary replacements that GiGs pointed out: &{template:default} {{name=@{selected|token_name}}} {{Skill1=[[ 1d6+@{intelligence} ]]}}
Great! It works.