Howdy, Stranger!

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

How do i make a randomizer?

Hi how do i make it so my game will randomly pick a passage to say something (example: you are attacked by a zombie-or-you find a gun)

By the way i use harlowe 1.2.2

Comments

  • You can use the (either: ) macro to do what you want, it's documentation includes an example of how to use the macro to randomly insert words into part of a sentence.

    If the text you want to randomly display is large then you can use the same macro to randomly select a passage to display using the (display: ) macro. You code would end up looking something like the following.
    (set: $passage to (either: "passage name A", "passage name B"))
    (display: $passage)
    
  • greyelf wrote: »
    You can use the (either: ) macro to do what you want, it's documentation includes an example of how to use the macro to randomly insert words into part of a sentence.

    If the text you want to randomly display is large then you can use the same macro to randomly select a passage to display using the (display: ) macro. You code would end up looking something like the following.
    (set: $passage to (either: "passage name A", "passage name B"))
    (display: $passage)
    

    Hey thank you for the awnser! But i must ask can you do this with 3 passages for example:

    (set: $passage to (either: "passage name A", "passage name B", "passage name C"))
  • But i must ask can you do this with 3 passages..
    Try it and see. *smile*
  • greyelf wrote: »
    But i must ask can you do this with 3 passages..
    Try it and see. *smile*

    Ok thank you!
Sign In or Register to comment.