
The Problem I Face: I love using dropdown queries to automatically display relevant information about spells I cast at various levels/ranks. Since I play Pathfinder 2e, the heightened versions of spells don't always follow easy patterns that I can stuff into a single query, thus necessitating two. Take for instance the spell Safe Passage, which can be cast at 3rd, 5th, and 8th ranks. The 3rd-rank version creates a 60ft long tunnel with resistances of 5, the 5th-rank version creates a 120ft long tunnel with resistances of 10, and the 8th-rank version creates...a 500ft long tunnel with resistances of 15. This requires an entire polynomial to achieve different results for the length of the tunnel, which will be predictably messy to calculate, and trying to do it the other way around is even more frustrating. Wouldn't it be nice if you could just add more output values into your dropdown queries? Some Solutions: I can think of a couple ways to solve this issue, each with their own merits and drawbacks. If you have another solution yourself, please feel free to let me know. RC1/"The Index Method": When writing the first call of a dropdown query, include more than one set of outputs for each label. You can use this every time you call the dropdown query again in the same script with an index number to point to which set of outputs to use, even on the first call. Current Working Syntax: ?{Query:i|L1,L1v1,L1v2|L2,L2v1,L2v2|...} # i is the index number; if not specified, defaults to 1 (the first output value)
# i may be 0, which will attempt to use the label as the output Example: [[?{Level?:1|1,2,6|2,3,6|3,4,7|4,5,7}d4]] Fire Damage # First use sets the labels 1, 2, 3, and 4 as the options to present to
# the user, uses the first output as defined by the code
[[?{Level?:2|1|2|4|5|5,8}]] Persistent Fire Damage # Second use calls for the second value of the chosen option to be used;
# any attempts to make new labels or set new values are discarded as per usual
[[?{Level?:0}]] HP Healed On Caster # Third use takes advantage of the labels' numberiness
# and outputs the labels themselves
[[?{Cookie?:4|Yes,1,0,1,1|No,0,0,0,0}]] # First use of the "Cookie?" query sets values for the options for
# "Cookie?", and references the fourth value in each option Pros: Later calls with different output values are much shorter, as seen in Line 3 of the Example. Will not conflict with current uses in R20 making use of both the labels and a single value each, as the default index number is 1 and later definitions are ignored entirely. Only requires a slight bit of extra code to cover the cases where the labels themselves are the only output values, code which may already be written. Cons: The first dropdown query can become quite large depending on how many index numbers are required, as shown with only 4 options and 2 output values for each on Line 1 of the Example. You can't add a new output value in later calls. Memory may be an issue if things get large enough; I wouldn't recommend stuffing your entire spellbook into two queries. Calling with 0 as the index may result in trying to feed an incompatible data type to the surrounding code; should throw an exception as usual. RC2/"The Redefine Method": The dropdown query starts off much the same as any other dropdown query, but later calls can redefine the value outputted at the time of call. Current Working Syntax: ?{Query|L1,L1v1|L2,L2v1|L3,L3v1|...} # As usual, the first call defines the dropdown query
?{Query|L1v2|L2v2|!|...} # New values are put into the same places as the original
# call; These either redefine values for both this and later
# calls, or simply redefine for just this call
# "!"s are used for when the new value is the same as the old Example: [[?{Level?|1,2|2,3|3,4|4,5}d4]] Cold Damage # First call sets the options as 1, 2, 3, and 4, with the
# values 2, 3, 4, and 5 respectively
[[?{Level?|!|4|6|8|5,10}]] Persistent Cold Damage # Second call changes the values of labels 2, 3, and 4
# to 4, 6, and 8; leaving the value for label 1 as 2
# The 10 is not associated with any current options and
# is discarded; Similarly, any labels are discarded
[[?{Level?}]] HP Healed On Caster # What happens here is dependent on how this is implemented
# Please refer to the commentary in Current Working Syntax, Lines 2-4 Pros: Dropdown query calls are of reasonable length whether it's the first or not. Memory isn't much of a problem. Cons: Messy uses currently written may break or cause extra load rewriting redundant values, necessitating the user to rewrite their code in the former and potentially extra code to avoid redundant rewriting of values in the latter. I can add additional revision candidates as time goes on and they are suggested. Yes, I am aware that these two methods aren't mutually exclusive and could be combined together for "THE ULTIMATE DROPDOWN QUERY!" , but that's probably a bad idea, so I didn't bother writing it down.