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

i'm wanting a query inside a query what am i doing wrong

1614725837

Edited 1614725928
?{Rarity?|Common,[[1d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr,+3}]]/3|Uncommon,[[2d4]]/6|Rare,[[4d4]]/12|Very Rare,[[8d4]]/24|Legendary,[[16d4]]/48}
what am i doing wrong?
1614727818
GiGs
Pro
Sheet Author
API Scripter
You have commas inside the inner query - those need replacing too.
As GiG stated, you need to replace your commas inside the inner query, the HTML CODE is  ,
/me is rolling for the ?{which roll?|first, first|second, second} time for a ?{Consumable?|yes,consumable |no,} ?{magic item?} paying ?{Bonus?|No,0|100Fr,+1|200Fr,+2|300Fr,+3} ?{Rarity?|Common,[[1d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr, +3}]]/3|Uncommon,[[2d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr, +3}]]/6|Rare,[[4d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr, +3}]]/12|Very Rare,[[8d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr, +3}]]/24|Legendary,[[16d4?{Bonus?|No,0|100Fr,+1|200Fr,+2| 300Fr, +3}]]/48} This works unless its a macro, if i type it in it works, if i set it up as a macro it doesn't work
1614779639
Ziechael
Forum Champion
Sheet Author
API Scripter
If you are setting it up as a macro in the collections tab then it should  work as per the chat unless  you reopen the macro again. It will transform all of your hard inputted html when you do that and effectively break it. Storing it as an ability on a sheet prevents that from happening as does saving the collections macro and never  opening it again. Keeping a copy elsewhere should you need to update it is advised ;)
just for my very tired brain, on sheets my macro will work, but in the collection it won't work? is there anyway to fix that as its a macro i want to link to all players Ziechael said: If you are setting it up as a macro in the collections tab then it should  work as per the chat unless  you reopen the macro again. It will transform all of your hard inputted html when you do that and effectively break it. Storing it as an ability on a sheet prevents that from happening as does saving the collections macro and never  opening it again. Keeping a copy elsewhere should you need to update it is advised ;)
1614935022
Ziechael
Forum Champion
Sheet Author
API Scripter
It should  work as a collections macro, you just need to never reopen it once you've saved it... also make sure you scroll down an give all players permission to use/see the macro, you can even mark it as a token action if you want it to show on EVERY token's top bar. I'm not 100% that the macro is formatted to do what you want currently though, appears to be some missing mathematical operators and/or syntax in there with my limited understanding of what it is trying to achieve. What system is this pricing equation from?
its a homebrew thing for a 5e game, its to roll for a chance for a requested magic item to appear, i invented an item called "fortune runes" because my players were becoming over encombered with all the platnium they had, so Fr is a fortune rune which each 1 costs 100pp. do you know why i can't ever reopen it? what causes that?
1614979784
Kraynic
Pro
Sheet Author
When you reopen a macro in the collections tab, all of your html replacements get resolved and then resaved as the characters.  That breaks all of your nesting.
1615026103
Ziechael
Forum Champion
Sheet Author
API Scripter
Ah, home brew... no wonder I couldn't find anything online lol... would you mind explaining this simplified version of a common item: [[1d4 +?{Bonus} ]]/3 Does that result in a 1d4+x chance out of 3 that the item is available or is it 1d4+x divided by three as a result you want to see?
So the average roll on a d4 is 3,so to get the magic item you're after you have to roll a 3 or higher, you can pay the equivalent to 10000pp to give yourself a plus 1 to your chance
Ziechael said: d oes that result in a 1d4+x chance out of 3 that the item is available or is it 1d4+x divided by three as a result you want to see? It's a 1d4+ x out of 3
1615150252

Edited 1615150298
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, so that turned out to be a little more involved than I first thought lol... here is an example of one that takes all of the information and outputs a reasonably legible 'is this item available' result: ! ?{which roll|first,first|second,second} ?{Consumable|yes, consumable|no,​} ?{Bonus|No,0|100Fr,1|200Fr,2|300Fr,3} /me is rolling for the ?{which roll} time for a?{Consumable} ?{magic item?}: [[ {[[?{Rarity?|Common,1d4+?{Bonus}]],0}>3|Uncommon,2d4+?{Bonus}]],0}>6|Rare,4d4+?{Bonus}]],0}>12|Very Rare,8d4+?{Bonus}]],0;}>24|Legendary,16d4+?{Bonus}]],0}>48} ]] available! It uses some complex syntax to cover the grouping of dice for a comparison roll as well as accounting for the 'no' option of the consumable needing to output something (otherwise it will default to just putting 'no' in your macro). In this case I've set it to output a zero width character ;) Hope it makes sense and does what you need it to? The overall comparison will output a 0 or a 1 but if you need to see the total of the roll made just hover over the availability result.