Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

As far as I should tell this should be working

I have it set up where you can pick a class 1-6 and a location 1-9. I am trying to have locations unlocked based on home location and chosen class. No matter what home and class are set to this code makes all three locations appear.

{(if: $Home is "Location 1" or "Location 2" or "Location 3" or $Class is "Class 1" or "Class 2")[[[Kingdom 1|Kingdom1]]]}
{(if: $Home is "Location 4" or "Location 5" or "Location 6" or $Class is "Class 3" or "Class 4")[[[Kingdom 2|Kingdom2]]]}
{(if: $Home is "Location 7" or "Location 8" or "Location 9" or $Class is "Class 5" or "Class 6")[[[Kingdom 3|Kingdom3]]]}

I can not tell what I am doing wrong. As I understand it, if someone has home set to location 1 and class 3 kingdom 1 and 2 should show up or if someone has home set to 8 and class set to 5 only kingdom 3 should show up. Can any one tell me what I am doing wrong?

Comments

  • The "or" keyword can't be used inside a comparison, so you'll get [[Kingdom 1|Kingdom1]] if "Location 2".

    You want to do something more like this:

    (if: $Home is "Location 1" or $Home is "Location 2" or $Home is "Location 3" or $Class is "Class 1" or $Class is "Class 2")[...]
  • I see thank you.  ;D
  • oakandsage wrote:

    The "or" keyword can't be used inside a comparison, so you'll get [[Kingdom 1|Kingdom1]] if "Location 2".

    You want to do something more like this:

    (if: $Home is "Location 1" or $Home is "Location 2" or $Home is "Location 3" or $Class is "Class 1" or $Class is "Class 2")[...]
    Technically, you can just write

    (if: $Home is "Location 1" or it is "Location 2" or it is "Location 3" or $Class is "Class 1" or it is "Class 2")[...]
    or (using "implicit it", where the "it" keyword is inferred in certain circumstances)

    (if: $Home is "Location 1" or is "Location 2" or is "Location 3" or $Class is "Class 1" or is "Class 2")[...]
    or

    (if: $Home is in (array:"Location 1","Location 2","Location 3") or $Class is in (array:"Class 1","Class 2"))[...]
    or

    (if: $Home is in (a:"Location 1","Location 2","Location 3") or $Class is in (a:"Class 1","Class 2"))[...]
  • Oh yes! Thanks, L. "or is" basically implies "it" ?

    (...I just tried to look up 'it' on the Neocities page. I got what I deserved.)
Sign In or Register to comment.