{
 "title": "Quick Guide to the Activities System",
 "slug": "quick-guide-to-the-activities-system",
 "category": "Mods",
 "url": "https://x-change.life/wiki/quick-guide-to-the-activities-system/",
 "summary": "The new activities system makes it super easy to add/remove activities dynamically! Just call (activities:) with your conditions and let the system handle the rest.",
 "tags": [],
 "checked": null,
 "game_version": "0.27.0.9",
 "words": 205,
 "headings": [
  {
   "level": 2,
   "text": "Basic Format",
   "id": "basic-format"
  },
  {
   "level": 2,
   "text": "Simple Example",
   "id": "simple-example"
  },
  {
   "level": 2,
   "text": "Forcing Activities",
   "id": "forcing-activities"
  },
  {
   "level": 2,
   "text": "Time Slots",
   "id": "time-slots"
  },
  {
   "level": 2,
   "text": "Pro Tips:",
   "id": "pro-tips"
  }
 ],
 "links": [],
 "watches": [],
 "markdown": "The new activities system makes it super easy to add/remove activities dynamically! Just call `(activities:)` with your conditions and let the system handle the rest.\n\n## Basic Format\n\n```\n(activities: boolean_condition, \"Activity Name\", \"time_slot\")\n```\n\nThe system will automatically:\n\n- Add the activity when condition is true\n- Remove it when false\n- Handle all the cleanup (remove from lists, reset current activity if needed)\n\n## Simple Example\n\nHere’s how to add “Go to the library” on weekdays:\n\n```\n(activities: (a:\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\") contains $day_of_week, \"Go to the library\", \"daytime\" )\n```\n\n## Forcing Activities\n\nYou can force an activity by adding two more parameters:\n\n```\n(activities: $needs_to_study is true, \"Go to the library\", \"daytime\", true, \"You have an important test coming up - better hit the books!\" )\n```\n\n## Time Slots\n\n- “morning”\n- “daytime”\n- “evening”\n\n## Pro Tips:\n\n1. Call your activities code frequently enough (like in daily refresh passages) – the system handles cleanup automatically!\n\n2. No need to manually remove activities – just let the condition go false:\n\nBad (old way):\n\n```\n(if:not condition)[(set:$evening_activities to it - (a:\"My Activity\"))] (if:condition)[(set:$evening_activities to it + (a:\"My Activity\"))]\n```\n\nGood (new way):\n\n```\n(activities: condition, \"My Activity\", \"evening\")\n```\n\n3. For forced activities that override player choice:\n\n```\n(activities: $doctor_appointment is true, \"Doctor Visit\", \"daytime\", true, \"Can't skip this appointment!\" )\n```\n\nRemember: The system handles all the complex stuff like:\n\n- Deduplication\n- Removing activities when conditions are false\n- Managing forced activities\n- Cleaning up activity lists\n- Resetting to “Nothing” when needed\n\nBUT, the old method will still work. This will just work better! At the moment, you can’t add additional emojis to the activity list. I plan to add the ability for you to add those.\n",
 "meta": {
  "title": "Quick Guide to the Activities System",
  "category": "Mods",
  "imported": true,
  "old_modified": "2024-10-28",
  "old_urls": [
   "/wiki/docs/quick-guide-to-the-activities-system/"
  ]
 }
}