Howdy, Stranger!

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

How to use either: to display a set of choices.(Harlowe)

edited October 2015 in Help! with 2.0
I'm trying to get a passage that gets revisited to offer the player a randomized set of options that lead to the same destination. This seems right, but it throws an ILLEGAL error when I run it. Anyone know what I'm doing wrong?
Ex:
You see two choices.
(either:("Choose Red or Blue"[[Red pill->SceneX]][[Blue pill->SceneY]]),("Choose Green or Purple"[[Green pill->SceneY]][[Purple pill->SceneX]])

I'm still getting my head wrapped around the logic of (x) vs [x] vs x in Harlowe as it compares to javascript, actionscript etc:
myFunction
{
   if()
   {
     then...
   }
   elseIf()
   {
     then...
   }
   else
   {
      otherwise...
   }
}

Comments

  • UPDATE: Managed to get rid of the ILLEGAL error but now the compiler simply gives an unexpected token ] error.
    (either:("Choose Red or Blue"[Red pill->SceneX][Blue pill->SceneY]),("Choose Green or Purple"[Green pill->SceneY][Purple pill->SceneX]))
    

    Unexpected token ]►
    This error message was reported by your browser's Javascript engine. I don't understand it either, but it usually means that an expression was badly written.
  • edited October 2015
    Try the following:
    {
    (if: (random: 1,2) is 1)[
    Choose Red or Blue [[Red pill->SceneX]][[Blue pill->SceneY]]
    ](else:)[
    Choose Green or Purple [[Green pill->SceneY]][[Purple pill->SceneX]]
    ]}
    

    Markup links start with a and end with a like the following:
    [[Link Text->Target Passage Name]]
    [[Target Passage Name<-Link Text]]
    
    Hooks start with a [ and end with a ] and come in two general types:
    a. Named
    |hookname>[contents of named hook]
    [contents of named hook]<hookname|
    
    b. Associated: A hook that is associated with something like a macro
    (if: $var is "value)[contents of the associated hook]
    
Sign In or Register to comment.