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

Nested Query not working even with HTML substitutes

1587824541

Edited 1587824757
Hi all, I've been trying hard to get a nested query to work. Essentially, you should be able to pick a body location which will then based on a damage and penetration imputed will return a final wounds value. The reason the queries are nested is to allow custom text to point to the body part being hit to be displayed. Below is the nested query, trying my best to format it for viewability: ?{Hit Location?|     Head, [[ {[[-@{selected|HArmour}+[[floor(@{selected|Toughness}/10]] ]] + [[?{Penetration?}]], [[0]]}kl1 + ?{Damage?;}]] wounds to the head!|     Body, [[ {[[-@{selected|BArmour}+[[floor(@{selected|Toughness}/10]] ]] + [[?{Penetration?}]], [[0]]}kl1 + ?{Damage?;}]] wounds to the body! } Even though the nested queries do appear, it's with completely strange behaviour Any help on this? To help out, below is the basic equation I want to be solved within the larger query (the thing that changes is BArmor and 'wounds to the body' between options) [[{[[-@{selected|BArmour}+-floor(@{selected|Toughness}/10)]] + [[?{Penetration?|0}]], [[0]]}kl1 + ?{Damage?|0}]] wounds to the Body!
1587836248

Edited 1587836512
Ziechael
Forum Champion
Sheet Author
API Scripter
You also need to escape the offending characters in your kl syntax. ?{Hit Location?|     Head, [[ {[[-@{selected|HArmour}+[[floor(@{selected|Toughness}/10]] ]] + [[?{Penetration?}]], [[0]]}kl1 + ?{Damage?;}]] wounds to the head!|     Body, [[ {[[-@{selected|BArmour}+[[floor(@{selected|Toughness}/10]] ]] + [[?{Penetration?}]], [[0]]}kl1 + ?{Damage?;}]] wounds to the body! }
Hey thanks for the response! I had suspected as much - I have tried what you've posted and while I get to correct input options, it doesn't seem to resolve anything? (i.e Nothing is posted after putting the numbers in) If anyone else has anything to fix this that would be great! 
For some further info, when using Ziechael's solution, I get the following in the inspect console:
1587892776
Ziechael
Forum Champion
Sheet Author
API Scripter
I took a look again in the cold light of day and there was a lot of mismatched and confusing syntax in there. This works as best as I can understand the system requirements: ?{Hit Location?|Head,[[ { [[ 0 - @{selected|HArmour} - floor(@{selected|Toughness}/10) ]] + ?{Penetration?} , 0}kl1 + ?{Damage?} ]] wounds to the head!|Body, [[ { [[ 0 - @{selected|BArmour} - floor(@{selected|Toughness}/10) ]] + ?{Penetration?} , 0}kl1 + ?{Damage?} ]] wounds to the body!} I'm assuming this damage calculation follows the idea of armour and toughness reduce damage but this can be mitigated by penetration?
Hey thanks for your help it works perfectly now!