Howdy, Stranger!

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

How to display one of three random passages

Hi, all. I'd like a passage in my game to take the player to one of three random passages (or, maybe more simply, to display one of three text blocks, which are long and contain dialogue and multiple links).

I tried it with "either" and got a long error message.

I also tried making the three text blocks into their own passages and <<display either($each of them)>>, but I get an error message that the passage names aren't defined yet. (Although... they're right there. Existing. So I'm not sure.)

I appreciate any pointers--it's possible there's a brilliant way to do this that I don't know yet. I'm very new to this but am impressed with the friendliness of the community. I appreciate your help in advance.

Comments

  • You need to state which Story Format you are using when you ask a question, as answers can be different for each one.

    You can use a variable to store the name of the randomly chosen passage title, and then display the contents of that passage.
    <<set $passage to either("Passage 1", "Passage 2", "Passage 3")>>
    <<display $passage>>
    
  • Ah, it worked! Thank you, helpful genius!
Sign In or Register to comment.