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

Dropdown not recognizing other macros?

December 21 (6 years ago)
Wab
Pro

This is all concerning DnD 5e and the abilities section.

I currently have been using macros for my weapon attacks (I like the layout, and we have an additional "achievement" type of damage in my game called Vanquisher). This currently looks like this:

@{Morren Arakhora|wtype}&{template:traits} @{Morren Arakhora|charname_output} {{name=Rapier}} {{source=Melee}} {{description=Attack:  [[[[1d20]] + @{Morren Arakhora|dexterity_mod} + @{Morren Arakhora|pb}]] |  [[[[1d20]] + @{Morren Arakhora|dexterity_mod} + @{Morren Arakhora|pb}]]
Dmg: [[[[1d8]] + @{Morren Arakhora|dexterity_mod}]] (Piercing) + Crit: [[1d8]]
Vanquisher Dmg: [[1d6>5cf<0cs>5]] }}


Anyways I am trying to streamline my attacking, so I tried to make an "Attack" macro that has a dropdown with each of the weapons I have to choose from. I didn't even get the bones set up and I am already having issues.

So I am going off of the wiki and trying the method below

?{Name of Query|Label1, value1|Label2, value2|Label3, value3}

but when I do a simple replacement with the ability

?{Name of Query|Label1, %{Morren Arakhora|Rapier}|Label2, value2|Label3, value3}

I get a text box with "Label1, &{template:traits" inside of it. I have tried replacing various aspects with its &# number (depicted below), but then I get an error saying "No ability was found for %{Label2, value2|Label3, value3}"

?{Name of Query|Label1,%{Morren Arakhora|Rapier&#125;|Label2, value2|Label3, value3}

Can someone explain what I am doing wrong? Am I derping hard or is this an issue?


I appreciate any assistance,


Wab

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

Unfortunately you're running into the most common error that occurs once people start getting fancy with macros. Roll20 doesnt really support nested queries and macros very well, and you need to master html replacements (as described here) to make it work. 

If the nesting macro is fairly simple, it's not too hard, but the macro you are trying to nest there will be very tricky to code. The first thing to realise: you can't call anotheer macro when nesting in this way. You have to take the entire text of every macro, and put them in the same macro, and then figure out which characters you need to replace with html entities.

A simpler alternative is to create a chat menu: whisper a set of buttons to yourself in chat, one for each attack, then click the one you need. Chat Menus are described here.

December 21 (6 years ago)
Wab
Pro

Thank you. I have tried the html replacements, but It just seems to error on various parts of the rest of the line.

I have a menu macro in place (for my Ranger Spells), but I was playing around and thought the drop down would be a neat thing to try. I might try to make a massive macro for it and see how it looks/feels. It might be too much for a simple attack macro, but you never know until you try eh?

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

GiGs' suggestion of Chat Menus is something I would highly recommend. Much, much simpler.

December 22 (6 years ago)

Edited December 22 (6 years ago)

I was where you are right now 4 months ago. The chat menu macro is your friend here!

Here is a working code for a dwarf character in my game. We use the 5e OGL sheet. I use pics in the chat so if you don't want to use it in your game just delete that section of code. It is important to note that the weapon macros are stored on the character sheet they are being rolled from. This macro just selects the weapon from the character's sheet. Naming the weapons without spaces is critical if you want this to work. I hope this example helps? I almost forgot, i use the whisper function for the players to only see this so it doesn't clutter up the chat window.

/w Ulf Aksel[Image](https://s3.amazonaws.com/files.d20.io/images/48167833/EzLF7h_d20uJVDTzUsQN5g/med.jpg)}}
/w Ulf Aksel @{Ulf Aksel|wtype}&{template:npcaction} {{rname=Melee Weapons}} {{name=Ulf Aksel}} {{description=Select your Weapon:
[Battleaxe](~Battleaxe)[Two Handed Battleaxe](~TwoHandedBattleaxe)
[Warhammer](~Warhammer)
[Two Handed Warhammer](~TwoHandedWarhammer)}}