Howdy, Stranger!

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

displaying a passage constantly

Is there a way to have a passage display constantly at the start of every other passage without writing <<display ...>> on every page?
I am using a fairly complicated method to display multiple layers of variable images, and I assemble all the images in a passage called "scene". I want to display "scene" in every single passage, and I could just add the <<scene>> to each one, but I thought maybe there was a more elegant solution...?

Comments

  • It might be better to set those images to the background. You wouldn't need to use <<display>> for you images at all, freeing up your passages. You could then use something liked L's toggletag to conditionally change what images are displayed. Seems like it's the simplest method, to me.

    I also have a module, made for me by TheMadExile, which creates sort of a duplicate #passages div in Sugarcane. You could use it to hold your images, freeing the default Twine passages for separate use. (When I was doing something similar - displaying images conditionally, based on user input - this is the method I used. In my case, it was very simple, because all I was doing was displaying images based on a variable that tracked player progress - <<if $progress is 5>>this image<<else if $progress 6>>other image<<endif>>, etc. It could easily accommodate a much more complex system, however. As I said, though, this method isn't as easy as my previous suggestion; I only used it myself because I was doing something very particular with CSS styling.)
  • Actually, a duplicate #passages div in sugarcane sounds ideal! I was trying to figure out how to do just that by messing with the Sugarcane html file with no success.

    my game currently layers animated gifs, and uses different pictures depending in the state of variables:

    regular story passage: <<set $dog to "sleep"; $roomnumber to 2>>
    scene passage: [img[$dog + "dog]] [img["background " + $roomnumber]], etc.
    images: sleepdog, wakedog, walkdog, background1, background2, ...

    Do you think that the module you used would be suitable in this context?
  • I think it would work just fine. Here's the script https://www.dropbox.com/s/i9xdhmxzgwp1tps/menu panes module.tws?dl=0

    I added some documentation. I think I covered everything, but let me know if you have any questions.
Sign In or Register to comment.