Howdy, Stranger!

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

Random number sequence (Harlowe)

edited February 2016 in Help! with 2.0
I am trying to do an alternative easier way for my boss fight, so I am thinking of something like '(if: random: 0, 2, 4, 6, 8)' and '(else: random: 1, 3, 5, 7, 9)' and then the corresponding passage I want shows up.

For example, the number comes out as an even number, it would say:
You decide to lunge at the Dragon's neck whilst it was vulnerable.

You strike for 20% of it's health. Round 2

If the number is an odd number, it would say: [Your lunge failed, you have died Boss Fight: Oksorök

If anyone knows how, please help, I have tried the other boss fight suggestion but its too hard to complete, and I want an easier option.

Comments

  • You can use the modulus % operator to check is a number is divisible by two, which lets you know if it is even or odd.
    (if: (random: 0, 9) % 2 is 0)[The random number is Even]
    (else:)[The random number is Odd]
    
  • edited February 2016
    Ok, so how do I get the right passage to show?

    I have to make a $var, right?
  • Ok, so how do I get the right passage to show?
    By using either the (display: ) macro or the (go-to: ) macro.
  • I have managed to get it to work like this:

    (align: "=><==")[(if: (random: 0, 9) % 2 is 0)[You decide to lunge at the Dragon's neck whilst it was vulnerable.

    You strike for 20% of it's health.
    Round 2](else:)[Your lunge failed, you have died
    Boss Fight: Oksorök ] ]

    No display macro needed
    Thanks
    =)
Sign In or Register to comment.