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

problems with query macro

1563276181

Edited 1563276405
I'm trying to make a macro for all forms of travelling (on foot (stealthily,normal,fast), on horse, on wagon, on ships & airship. for my hexgrid map where every tile is 48miles. i think i got most of it right, but i'm unsure why only "none" and "1 on foot stealthily" shows up in the query, and it not showing any other options. Can someone help identify if i used a wrong code somewhere, because i'm not seeing it. my code is a repeat of the following: None, | 1 on foot stealthily, &{template:default} {{Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*1]]miles }}{{used rations=[[round((1*48)/18)]] }} {{Days travelled=[[round((1*48)/18)]] {{Rests needed=[[round((1*48)/18)]] }} {{Event=[[2d100kl1]]}}  {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }} | 2 on foot stealthily, &{template:default} {{Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*2]]miles }}{{used rations=[[round((2*48)/18)]] }} {{Days travelled=[[round((2*48)/18)]] {{Rests needed=[[round((2*48)/18)]] }} }} {{Event=[[2d100kl1]]}}  {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }} | 3 on foot stealthily, &{template:default} {{Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*3]]miles }}{{used rations=[[round((3*48)/18)]] }} {{Days travelled=[[round((3*48)/18)]] {{Rests needed=[[round((3*48)/18)]] }} }} {{Event=[[2d100kl1]]}}  {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }} | 4 on foot stealthily, &{template:default} {{Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*4]]miles }}{{used rations=[[round((4*48)/18)]] }} {{Days travelled=[[round((4*48)/18)]] {{Rests needed=[[round((4*48)/18)]] }} }} {{Event=[[2d100kl1]]}}  {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }} | 5 on foot stealthily, &{template:default} {{Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*5]]miles }}{{used rations=[[round((5*48)/18)]] }} {{Days travelled=[[round((5*48)/18)]] {{Rests needed=[[round((5*48)/18)]] }} }} {{Event=[[2d100kl1]] [[2d100kl1]]}}  {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }} }
1563277350
Ziechael
Forum Champion
Sheet Author
API Scripter
Here you go: &{template:default} {{?{Travel method|None,You ain't going anywhere| 1 on foot stealthily, Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*1]]miles }} {{used rations=[[round((1*48)/18)]] }} {{Days travelled=[[round((1*48)/18)]]}} {{Rests needed=[[round((1*48)/18)]] }} {{Event=[[2d100kl1]]}} {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked | 2 on foot stealthily, Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*2]]miles }} {{used rations=[[round((2*48)/18)]] }} {{Days travelled=[[round((2*48)/18)]]}} {{Rests needed=[[round((2*48)/18)]] }} {{Event=[[2d100kl1]]}} {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked | 3 on foot stealthily, Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*3]]miles }} {{used rations=[[round((3*48)/18)]] }} {{Days travelled=[[round((3*48)/18)]]}} {{Rests needed=[[round((3*48)/18)]] }} {{Event=[[2d100kl1]]}} {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked | 4 on foot stealthily, Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*4]]miles }} {{used rations=[[round((4*48)/18)]] }} {{Days travelled=[[round((4*48)/18)]]}} {{Rests needed=[[round((4*48)/18)]] }} {{Event=[[2d100kl1]]}} {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked | 5 on foot stealthily, Name=Travelling by Foot(stealthily)}} {{Distance travelled=[[48*5]]miles }} {{used rations=[[round((5*48)/18)]] }} {{Days travelled=[[round((5*48)/18)]]}} {{Rests needed=[[round((5*48)/18)]] }} {{Event=[[2d100kl1]] [[2d100kl1]]}} {{Description= You are travelling stealthily through the lands. You are hiding your trails from being tracked }}}
1563277507

Edited 1563277569
Ziechael
Forum Champion
Sheet Author
API Scripter
Things I noticed: You can put common factors outside of the query, in this case the template call, opening brackets and final section closing brackets to minimise html replacements You'd missed closing brackets on your days travelled section You had double closing brackets on your rests section (likely copy/paste error from the above issue) You'd not replaced the closing brackets on the events section It was very close to being right mind, and trust me, I can sympathise with the blindness of staring at a nested query for too long!!
1563294695

Edited 1563295580
Ziechael said: Things I noticed: You can put common factors outside of the query, in this case the template call, opening brackets and final section closing brackets to minimise html replacements You'd missed closing brackets on your days travelled section You had double closing brackets on your rests section (likely copy/paste error from the above issue) You'd not replaced the closing brackets on the events section It was very close to being right mind, and trust me, I can sympathise with the blindness of staring at a nested query for too long!! Thank you so much! now i can easily use it for the hex grid map i made to track days spent travelling ^^. It was a thing i found odd during my first 2 campaigns where pretty much the entire campaign ended up happening within a month time. I applied it to all the other travel methods now and it works! Each tile is 48 miles.... so translated between the village of Carn & Parwas in my campaign that would mean: 16 days on foot at a normal pace  24 miles a day 11 days on a small ship (longship/galley) 32 miles a day 8 days on horseback or wagon at 48 miles a day 7 days by large ship (warship/sailship) at 50 miles a day 4 days by airship a 96 miles a day
1563297772
Ziechael
Forum Champion
Sheet Author
API Scripter
Great stuff, happy to help :) Now you just need to add an option to factor in for inclement weather or difficult terrain and you are sorted... because, you know, a DMs work is NEVER done! ;) Happy rolling!!
Ziechael said: Great stuff, happy to help :) Now you just need to add an option to factor in for inclement weather or difficult terrain and you are sorted... because, you know, a DMs work is NEVER done! ;) Happy rolling!! Yeah i was looking into tables for weather effects where it draws from a pool of possibilities. to test the table thing i tried making a table that gives random weapon items that can be purchased by the players when i run the macro: &{template:default} {{?{What shop | None, Closed=You can't find any (open) shops}} | Small Weaponshop, Name=Local Blacksmith }} {{Weapon 1=[[1t[Weaponshop]]] }} {{Weapon 2=[[1t[Weaponshop]]] }} {{Weapon 3=[[1t[Weaponshop]]] }} {{Weapon 4=[[1t[Weaponshop]]] }} but i can't seem to make it work either, resulting in this: you got any tips on how to make tables work in a template?
1563318783
Kraynic
Pro
Sheet Author
I could be wrong, but are you missing one closing curly bracket at the end?  You have 2 that close the line, but not the one that closes the query.
1563355029
Ziechael
Forum Champion
Sheet Author
API Scripter
Kraynic said: I could be wrong, but are you missing one closing curly bracket at the end?  You have 2 that close the line, but not the one that closes the query. Yup, that ^^ :)