Howdy, Stranger!

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

Image and variable help - need desperate help


I'm creating a twine for a university project and I'm way over my head. Firstly, I'm using twine 1.4. Secondly, I have no idea what I'm doing.

I want to make a poem generator in which the 'player' generates a poem based on photo choices. Each photo will have a line of poetry attached to it. Each passage will contain two photos to choose between. At the end of the generator, a poem will be revealed to the 'player' based on their choices. I hope that make sense.

I gather so far in my research that I need to make photos into links (eg. [img[fish][slide2]] ). I've got that down lol but how do i assign a hidden piece of text to that photo/choice that will be revealed at the end ? Somef thing with variables that I don't quite understand. If someone out there could walk me through the basics of how I would do this, or point me in the direction


  • You should always state the story format you're using and its full version, because advice will tend to vary based on that information. In Twine 1, look under the Story menu's Story Format item.

    Since you have no idea what you're doing, you're probably using one of the Twine 1.4 vanilla story formats unfortunately, which, IIRC, do not support setter components on the image markup. Thus, you'll probably need to use a unique passage for each image link to achieve the effect you want. For example, I'd probably recommend something like the following: (in Twee notation)
    :: slide2
    :: slide2fish
    <<set $slide2choice to "fish">><<display "slide3">>
    :: slide2bird
    <<set $slide2choice to "bird">><<display "slide3">>
    :: slide3
    :: slide3cat
    <<set $slide3choice to "cat">><<display "slide4">>
    :: slide3dog
    <<set $slide3choice to "dog">><<display "slide4">>

    At the end, you'd simply check the values of the variables to create your poem. For example:
    <<if $slide2choice is "fish">>…something poetic about fish…<<else>>…something poetic about birds…<<endif>>
    <<if $slide3choice is "cat">>…something poetic about cats…<<else>>…something poetic about dogs…<<endif>>

    Hopefully, you get the idea.
Sign In or Register to comment.