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 50/50 chance of with passage an action will direct you to?

I am making a part of my story where you have to jump over a pressure plate. You have a 50/50 chance of making it. If you die you go to one passage, If you make it you go to another. How do I do this?

Comments

  • What you could do is use a simple variable for example called chance and then use something like this.

    <<set $chance to random(1)>>

    <<if $chance is 0>>
    <<goto Passage>>
    <<elseif $chance is 1>>
    <<goto Passage>>
    <</if>>

    Just be careful to make sure that you have some kind of trigger before this script runs. You could for example have something like
    PressurePlateRoll

    That way once someone clicks the Jump over link it will automatically direct them to the correct passage.
  • Sytze wrote: »
    What you could do is use a simple variable for example called chance and then use something like this.

    <<set $chance to random(1)>>

    <<if $chance is 0>>
    <<goto Passage>>
    <<elseif $chance is 1>>
    <<goto Passage>>
    <</if>>

    Just be careful to make sure that you have some kind of trigger before this script runs. You could for example have something like
    PressurePlateRoll

    That way once someone clicks the Jump over link it will automatically direct them to the correct passage.

    Really sorry, i am a complete noob. How would I add this to Twine? Thak you for answering so quickly,
  • This is for sugarcube, I'm not entirely sure how to do it for other headers. What version of twine do you use?
  • Harlowe :/
  • Most likely it would be something like.

    (set: $chance to (random 1,2))
    (if: $chance is 1)(goto Passage)
    (elseif: $chance is 2)(goto Passage)

    I've never used harlowe so you might have to play around with this a bit.
  • As mentioned by the previous commentators, you need to state which Story Format (name & version) you are using when you ask a question, as answers can be different for each one. Stating which version of the Twine application you may be using can also help but that is not as important as the Story Format.

    The following one liner will also do what you want in Harlowe:
    (go-to: (either: "Passage 1", "Passage 2"))
    
Sign In or Register to comment.