Adding a dream

So, you’ve seen dreams in the game and want to add your own. Awesome. So how do we do that?

There are some creative ways to add a dream, but the least invasive way is to utilize the memory system. Normally you’d have the character encounter something that they could remember.

:: some passage
<!-- stuff happens to trigger a memory being stored -->
<!-- So here you name the memory, how many days to remember it for, the NPC involved, media for the memory, any tags for the memory-->
($remember:"name of memory",100,"npc name","media file","tag(s)","dream","name of dream passage")

<!-- Example: -->
($remember:"new thing dream",100,"bruce","none","cool thing to dream about","dream","new dream intro")

It is super important to have “dream” and then the name of the passage that start the dream as the LAST two arguments in the $remember macro.

Next, you set up the night thought. This is the piece of text that appears on the screen right as you are going to bed, just before the dream.

:: night thought new thing dream trigger [night_thought]
{
    (if:($recall:"new thing dream") and not (checkdm:$memory,"tags","contains","night thought"))[(set:$night_thought to "new thing dream")]
}

Here you are saying if you can recall the memory, and “night thought” isn’t one of the tags of the memory, then trigger the night thought. The syntax is important, $night_thought must match the name of the passage. "night thought " + $night_thought, for the passage name.

:: night thought new thing dream
{
    <!-- Here you put what you want to show up on the screen just before you go to bed and have the dream. -->
    Man, that new thing was really cool...

    <!-- If you included tags in your memory, like if you had choices to make and you saved those choices as tags, then you could do conditional responses here too. -->

    (set:$tags to $memory's tags)
    (if:$tags contains "jealous")[
        Man that new thing was really cool, I'm so jealous that I don't have one.
    ]
    (else-if:$tags contains "sad")[
        Man that new thing was really cool, I'm so sad that I don't have one.
    ]

    <!-- Then you update the memory to add night thought, you're telling the other night thought passage that you've already had this night thought, so it won't trigger again-->
    ($remember_update:"add","new thing dream","night thought")
}

Next is the actual fun stuff. It’s the dream itself. I won’t even attempt to put everything that you can do because the possibilities vary way too much. You’ll have to use that modder’s intuition and come up with something neat!

:: new dream intro
{
    <!-- This is the launching off place for your dream. Set it up however you like, play a video, pick some choices, whatever you want.-->
    (link:"Next")[($cs:"new dream next")]
}
:: new dream next
{
    <!-- An example of how you'd move to another passage, or whatever. Then at the end of the dream, send the player to the wakeup passage-->
    (link:"Wake up")[($cs:"new dream wake up")]
}
:: new dream wake up
{
    (display:"location and time")
    ($pic:"scenes/home/dreams/wake up.jpg")(inc:'day')
    (set:$character's status to $character's gender)(display:"refresh portrait")
    ($play:"ambience","morning")

    The morning light shining through your window onto your face wakes you from your slumber... etc etc

    <!-- Whatever else you want to happen when you wake up.-->

    (set:$overnight_messages to it + (a:$dream's id))($forget:$dream's id)(dec:'day')
    ($simple_option:"advance day","Start the day...")
}