Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Excluding multiple selections from choices? (http://forums.wolflair.com/showthread.php?t=59458)

TCArknight November 2nd, 2017 12:47 PM

Excluding multiple selections from choices?
Howdy all!

Just wondering if anyone has come up with a good script/procedure to exclude previously chosen selections from subsequent choosers?

For ex. - I have three choosers expressions: usrCandid1, usrCandid2, usrCandid3. All three give the choice of component.X.

If usrChosen1 = A, then usrCandid2 and usrCandid3 should include !thingid.A
If usrChosen2 then = D, usrCandid3 should then include !thingid.D as well.

Does that make sense?

Mathias November 2nd, 2017 02:14 PM

Our normal handling for this is to use an eval rule to complain if the user selects the same thing more than once, but excluding them is possible, too;

field[usrCandid1].text = "a tag expression"

field[usrCandid2].text = "a different tag expression"
if (field[usrChosen1].ischosen <> 0) then
    field[usrCandid2].text &= " & !(" & field[usrChosen1].chosen.tagids[thingid.?,"|"] & ")"

I'd just be worried about what kind of weird situations the user might run into if they changed their mind about what selections were made on these selectors, and tried to change them, and ran into situations where there's things missing because of the way it's trying to control the selections. That's the main reason we generally use eval rules to verify these, instead of controlling the list of what can be chosen from - to avoid having to worry about that.

All times are GMT -8. The time now is 09:19 PM.

Powered by vBulletin® - Copyright ©2000 - 2019, vBulletin Solutions, Inc.
wolflair.com copyright 1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.