Howdy, Stranger!

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

How to move from one passage to another inside an (if: statement).

Simple question really. If a specific event occurs e.g.
(if: $cutters is 1)[(if: $diffused is 0)[//goto passage for cutting wire]]
I want to jump to another passage and i've looked through the forum and the documentation and i cant seem to find an answer. i'm using harlowe for the scripting. hope someone can give me a simple answer as the obvious command (goto: ) only seems to jump to another section in a passage.

thanks

workshopcraft

Comments

  • The Harlowe documentation lists a (goto:) macro.

    The following example consists of two passages (First Passage and Second Passage):
    a. First Passage
    This is the first passage
    
    (set: $cutters to 1)
    (set: $diffused to 0)
    (if: $cutters is 1 and $diffused is 0)[(goto: "Second Passage")]
    
    b. Second Passage
    This is the second passage
    
    You can test the above by changeing the value of the $cutters variable to something else in First Passage.

    If the above $cutters and $diffused variables represent yes/no (boolean) states then it would make more sense to use true/false instead of 1/0.
    This is the first passage
    
    (set: $cutters to true)
    (set: $diffused to false)
    
    (if: $cutters and not $diffused)[(goto: "Second Passage")]
    
  • Thank you for clearing up the confusion. I didnt realise i needed the inverted commas to specify the passage name. lesson learnt :>
Sign In or Register to comment.