Howdy, Stranger!

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

Changing passage description depending on conditions

edited November 2016 in Help! with 2.0
Sugarcube 1.0.34

If I have a passage called 'shack' with the description, "A small shack. Winter approaching. Room is freezing."

How would I change that description so that it reads, "A small shack. Winter approaching. Room temperature slowly rising." if the player has lit a fire?

The option to light a fire doesn't show up until the player has been outside to gather firewood, but once he has done this and lit a fire, I need the description to change to the warm one on subsequent visits.

Comments

  • Based on the suggestions in your Simple 'conditional' game thread you could do something like the following:
    A small shack. Winter approaching. <<if $isFireLit>>Room temperature slowly rising.<<else>>Room is freezing.<</if>>
    
  • Oh, great! Didn't realise it would be quite so straight forward. Thank you.
  • edited November 2016
    Ha, I spoke too soon.
    A small shack. Another winter approaching. <<if $isFireLit>>The warmth from the fire is taking the chill out of the air. <<else>Room is freezing.<</if>>
    Gives me an error about not finding a closing <<if>> and the child tag <<else>> being outside it's parent macro of <<if>>

    I stared and stared at this for about 20 minutes, until I suddenly saw my 'else' was missing a >

    It works now. Thanks again.
Sign In or Register to comment.