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

Drop Down Macro Pokemon Tabletop United (PTU)

I'm trying to make a macro that can nestle multiple moves from the PTU Character Sheet in a drop-down menu. As an example, I'm trying to combine these two moves into one macro. &{template:PTU} {{critsOn=20}} {{nick=@{Sophia|nickname}}} {{name=Energy Ball (Nature Power, Forest)}} {{AR=[[1d20cs>20+@{Sophia|Acc}]]}} {{AC=2}} {{Type=Grass}} {{Frequency=EOT}} {{damage=[[3d10+10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0]]}} {{dmgcrit=[[(3*(2+@{Sophia|sniper}))d10+(2+@{Sophia|sniper})*10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=4, 1 Target}} {{effect=Energy Ball lowers the foe's Special Defense 1 Combat Stage on 17+.}} And  &{template:PTU} {{critsOn=20}} {{nick=@{Sophia|nickname}}} {{name=Mud Bomb (Nature Power, Wetlands)}} {{AR=[[1d20cs>20+@{Sophia|Acc}]]}} {{AC=4}} {{Type=Ground}} {{Frequency=EOT}} {{damage=[[2d6+10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0]]}} {{dmgcrit=[[(2*(2+@{Sophia|sniper}))d6+(2+@{Sophia|sniper})*10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=6, 1 Target}} {{effect=The target’s Accuracy is lowered by -1 on 16+.}}
1578649096

Edited 1578649184
Ziechael
Forum Champion
Sheet Author
API Scripter
So, nesting templates gets pretty messy very quickly due to the number of characters that need html replacements . First step is to remove all unnecessary ones as a matter of course (the commas in the move name and range section are key candidates). Then you want to keep all repeated content across all options outside of the query: &{template:PTU} {{critsOn=20}} {{nick=@{Sophia|nickname}}} {{name= Then you can put the rest of each move into the query bar the final }} since they can come after the query resolves. For each {{}} section you need to replace the }} with }} and this will apply to all necessary "," "|" and "}" that aren't part of attribute calls as per the wiki linked above. This should  work as intended but is untested (I've put the non-query stuff in bold for visibility): &{template:PTU} {{critsOn=20}} {{nick=@{Sophia|nickname}}} {{name= ?{Move|Energy Ball (Nature Power - Forest)|Energy Ball (Nature Power - Forest)}} {{AR=[[1d20cs>20+@{Sophia|Acc}]]}} {{AC=2}} {{Type=Grass}} {{Frequency=EOT}} {{damage=[[3d10+10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0]]}} {{dmgcrit=[[(3*(2+@{Sophia|sniper}))d10+(2+@{Sophia|sniper})*10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=4 - 1 Target}} {{effect=Energy Ball lowers the foe's Special Defense 1 Combat Stage on 17+.|Mud Bomb (Nature Power - Wetlands),Mud Bomb (Nature Power - Wetlands)}} {{AR=[[1d20cs>20+@{Sophia|Acc}]]}} {{AC=4}} {{Type=Ground}} {{Frequency=EOT}} {{damage=[[2d6+10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0]]}} {{dmgcrit=[[(2*(2+@{Sophia|sniper}))d6+(2+@{Sophia|sniper})*10+0+@{Sophia|SPATK_total}+floor(0*@{Sophia|ATK_total}/2)+0+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=6 - 1 Target}} {{effect=The target’s Accuracy is lowered by -1 on 16+.} }}
Thank you so much! This is a huge help.
1578660679
Ziechael
Forum Champion
Sheet Author
API Scripter
No worries, it's a steep learning curve for sure. If any other issues/questions arise just fire away, this community is super helpful.
Using those two as an example, if the two moves had different critical hit rates say one was {{critsOn=18}} and the other was {{critsOn=20}} how would you nest this part of the macro?
1578670000
Ziechael
Forum Champion
Sheet Author
API Scripter
You'd need to move the start of the query to include that section: &{template:PTU} {{critsOn= ?{Move|Energy Ball (Nature Power - Forest),20}} {{nick=@{Sophia|nickname}}} {{name=Energy Ball (Nature Power - Forest)}} {{AR=[[1d20cs>20+@{Sophia|Acc}]]}} {{AC=2}} {{Type=Grass}} {{Frequency=EOT}} {{damage=... etc etc
I could not get that one to work for some reason. Sorry for another macro issue, but these moves are on the PTU standard move box and when I did the html replacements for them the macro would fail. I tried moving the critical range into the inside of the macro, but that did not work nor did leaving it on the outside. &{template:PTU} {{critsOn=@{Sophia|Move1_critsOn}}} {{nick=@{Sophia|nickname}}} {{name=@{Sophia|Move1_Name}}} {{AR=[[1d20cs>@{Sophia|Move1_critsOn}+@{Sophia|Acc}]]}} {{AC=@{Sophia|Move1_AC}}} {{Type=@{Sophia|Move1_Type}}} {{Frequency=@{Sophia|Move1_Freq}}} {{damage=[[@{Sophia|Move1_Amount}@{Sophia|Move1_Dice}+@{Sophia|Move1_Bonus}+@{Sophia|Move1_dam_B_t}+@{Sophia|SPATK_total}+floor(@{Sophia|Move1_smod}*@{Sophia|ATK_total}/2)]+@{Sophia|Move1_diebonus}]]}} {{dmgcrit=[[(@{Sophia|Move1_Amount}*(2+@{Sophia|sniper}))@{Sophia|Move1_Dice}+(2+@{Sophia|sniper})*@{Sophia|Move1_Bonus}+@{Sophia|Move1_dam_B_t}+@{Sophia|SPATK_total}+floor(@{Sophia|Move1_smod}*@{Sophia|ATK_total}/2)+@{Sophia|Move1_diebonus}+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=@{Sophia|Move1_Range}}} {{effect=@{Sophia|Move1_Effects}}} &{template:PTU} {{critsOn=@{Sophia|Move5_critsOn}}} {{nick=@{Sophia|nickname}}} {{name=@{Sophia|Move5_Name}}} {{AR=[[1d20cs>@{Sophia|Move5_critsOn}+@{Sophia|Acc}]]}} {{AC=@{Sophia|Move5_AC}}} {{Type=@{Sophia|Move5_Type}}} {{Frequency=@{Sophia|Move5_Freq}}} {{damage=[[@{Sophia|Move5_Amount}@{Sophia|Move5_Dice}+@{Sophia|Move5_Bonus}+@{Sophia|Move5_dam_B_t}+@{Sophia|SPATK_total}+floor(@{Sophia|Move5_smod}*@{Sophia|ATK_total}/2)+@{Sophia|Move5_diebonus}]]}} {{dmgcrit=[[(@{Sophia|Move5_Amount}*(2+@{Sophia|sniper}))@{Sophia|Move5_Dice}+(2+@{Sophia|sniper})*@{Sophia|Move5_Bonus}+@{Sophia|Move5_dam_B_t}+@{Sophia|SPATK_total}+floor(@{Sophia|Move5_smod}*@{Sophia|ATK_total}/2)+@{Sophia|Move5_diebonus}+@{Sophia|snipern}]]}} {{dmgcat=Special}} {{range=@{Sophia|Move5_Range}}} {{effect=@{Sophia|Move5_Effects}}}