{
 "title": "Adding a dream",
 "slug": "adding-a-dream",
 "category": "Mods",
 "url": "https://x-change.life/wiki/adding-a-dream/",
 "summary": "So, you’ve seen dreams in the game and want to add your own. Awesome. So how do we do that?",
 "tags": [],
 "checked": null,
 "game_version": "0.27.0.9",
 "words": 199,
 "headings": [],
 "links": [],
 "watches": [],
 "markdown": "So, you’ve seen dreams in the game and want to add your own. Awesome. So how do we do that?\n\nThere 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.\n\n```\n:: some passage\n<!-- stuff happens to trigger a memory being stored -->\n<!-- 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-->\n($remember:\"name of memory\",100,\"npc name\",\"media file\",\"tag(s)\",\"dream\",\"name of dream passage\")\n\n<!-- Example: -->\n($remember:\"new thing dream\",100,\"bruce\",\"none\",\"cool thing to dream about\",\"dream\",\"new dream intro\")\n```\n\nIt 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.\n\nNext, 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.\n\n```\n:: night thought new thing dream trigger [night_thought]\n{\n    (if:($recall:\"new thing dream\") and not (checkdm:$memory,\"tags\",\"contains\",\"night thought\"))[(set:$night_thought to \"new thing dream\")]\n}\n```\n\nHere 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.\n\n```\n:: night thought new thing dream\n{\n    <!-- Here you put what you want to show up on the screen just before you go to bed and have the dream. -->\n    Man, that new thing was really cool...\n\n    <!-- 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. -->\n\n    (set:$tags to $memory's tags)\n    (if:$tags contains \"jealous\")[\n        Man that new thing was really cool, I'm so jealous that I don't have one.\n    ]\n    (else-if:$tags contains \"sad\")[\n        Man that new thing was really cool, I'm so sad that I don't have one.\n    ]\n\n    <!-- 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-->\n    ($remember_update:\"add\",\"new thing dream\",\"night thought\")\n}\n```\n\nNext 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!\n\n```\n:: new dream intro\n{\n    <!-- This is the launching off place for your dream. Set it up however you like, play a video, pick some choices, whatever you want.-->\n    (link:\"Next\")[($cs:\"new dream next\")]\n}\n```\n\n```\n:: new dream next\n{\n    <!-- 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-->\n    (link:\"Wake up\")[($cs:\"new dream wake up\")]\n}\n```\n\n```\n:: new dream wake up\n{\n    (display:\"location and time\")\n    ($pic:\"scenes/home/dreams/wake up.jpg\")(inc:'day')\n    (set:$character's status to $character's gender)(display:\"refresh portrait\")\n    ($play:\"ambience\",\"morning\")\n\n    The morning light shining through your window onto your face wakes you from your slumber... etc etc\n\n    <!-- Whatever else you want to happen when you wake up.-->\n\n    (set:$overnight_messages to it + (a:$dream's id))($forget:$dream's id)(dec:'day')\n    ($simple_option:\"advance day\",\"Start the day...\")\n}\n```\n\nWritten by chloe.\n",
 "meta": {
  "title": "Adding a dream",
  "category": "Mods",
  "imported": true,
  "old_modified": "2025-08-28",
  "old_urls": [
   "/wiki/docs/adding-a-dream/"
  ]
 }
}