Twine 1.4.2: combining <<if>> and <<trace>>


I’m experimenting with creating a skyscraper in Twine 1, with descriptions generated using Twinecery. I’d like the descriptions of the view out the window to change (e.g., parking lot, skyline, horizon, seraphim, curvature of the planet), depending on what (random) floor the player ends up on. I’m setting the floor like this:

The elevator opens on floor <<set $floor to random(1,30)>><<print $floor>>.

And then in a subsequent passage, I have

<<if $floor <= 10>><<trace “sea_low”>>
<<else if $floor > 10 and $floor <= 20>><<trace “sea_med”>>
<<else if $floor < 20>><<trace “sea_high”>><>

It works for floors 20 and below, but if the player ends up on floor 21-30, nothing is displayed. Is this an issue with how I’ve written out the expression? (I don’t have a programming background.) Thank you very much!

The third line says “… if $floor < 20”, meaning “floor is less than 20”. I’m sure you meant “… if $floor > 20”.

Omg, I’m so embarrassed :blush: . Yes, that was the problem. Thank you so much!