Howdy, Stranger!

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

Force user to go to a passage? [SOLVED]

edited July 2014 in Help! with 1.x
I'm making a resource management type system and I want it so that if one of the variables gets to 0 it forces you to go to say a game over screen. Is that possible? If not is there anyway I could make it remove all the text on screen to show the game over bit so they can't continue?

Thanks

Comments

  • <<if $whatever is 0>>
    <<display "Game Over Passage">>
    <<else>>
    Whatever happens when you carry on.
    <<endif>>
  • AntonMuerte wrote:
    <<if $whatever is 0>>
    <<display "Game Over Passage">>
    <<else>>
    Whatever happens when you carry on.
    <<endif>>


    But that only displays the passage, the rest of the passage is still visible, I have the <<else>> bit before the bit I want removed and <<endif>> at the end of it all but it is still visible.
  • Also if there are more than 1 variable that activate the passage then they too activate making 2 or more passages appear :P.
  • You could use the Timed goto macro. You'll have to get it here and paste it into a passage tagged script.
    <<if $resources lte 0>>
    <<timedgoto "Game Over" 2s>>
    <<else>>
    You still have resources left.
    [[Continue Game]]
    <<endif>>
    Something like that.

    If you are using Sugarcube, then you'll have to get a different version of the code here if you want to try that method.

    I don't know when you put your check for the player having no resources, but you could also do something like this.
    You have built a house! You have used 50 resources!
    <<set $resources = $resources - 50>>

    <<if $resources gt 0>>
    [[Continue Game]]
    <<else>>
    [[Unfortunately, you are out of resources|Game Over]]
    That method doesn't require any other scripts and is simpler. The first one came into my head because I use the Timed Goto macro all the time.
    I hope this helps.
  • SpatkplusTwelve wrote:

    You could use the Timed goto macro. You'll have to get it here and paste it into a passage tagged script.

    <<if $resources lte 0>>
    <<timedgoto "Game Over" 2s>>
    <<else>>
    You still have resources left.
    [[Continue Game]]
    <<endif>>
    Something like that.

    If you are using Sugarcube, then you'll have to get a different version of the code here if you want to try that method.

    I don't know when you put your check for the player having no resources, but you could also do something like this.
    You have built a house! You have used 50 resources!
    <<set $resources = $resources - 50>>

    <<if $resources gt 0>>
    [[Continue Game]]
    <<else>>
    [[Unfortunately, you are out of resources|Game Over]]
    That method doesn't require any other scripts and is simpler. The first one came into my head because I use the Timed Goto macro all the time.
    I hope this helps.


    I tried the top and bottom one but I always get this error <<timedgoto "Game Over" 1s>> bad argument: 1s,(I did also try as 2s but I got the same error just with 2s) I did paste both bits of code exactly like they were in the .tws file but I still get the error, I even changed the tag to script but it still says the same thing? Also I need this for multiple resources and such so I need to basically read the first bit and if nothing is wrong with $food it checks $medicine and so on and if nothing is 0 then it continues the story. I did actually need something for timed choices aswell so thankyou for that awesome script :D.
  • Never mind i'm an idiot. I copied the code wrong *Facepalm* Thank-you so much for this! :D
  • Glad I could help!
Sign In or Register to comment.