View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 6th, 2022, 01:02 PM
The pseudocode for this:


if (tagis[Target1.?] <> 0) then
~use a foreach to find a thing/pick with that Reference1 tag that isn't the pick running this script (whether to run a foreach thing or a foreach pick is handled by checking the tags about whether this drop-down is thing or pick based)
else
~handle the user's choice in the drop-down normally

endif


The Target1 tag group is created in tags.1st - you have to also formally define Reference1 in the same file, and it has to be earlier in the file (usually just the next item up, so they're easy to find together). Then, Reference1 is also an identity tag on anything that might need it, and when building the foreaches, you use replace(the string you built using tagids[],"Target1","Reference1",0) - this way, Reference1 only ever exists on the picks that are being referenced, and Target1 only exists on picks making references to those other picks.


Oh, and leaving out the "1" at the end of the tag group's Id was a mistake - we found that out when we needed to create Target2 and Reference2 so that a second drop-down could also receive the same mechanics.
Mathias is offline   #2 Reply With Quote