{"id":881,"date":"2024-10-28T14:28:31","date_gmt":"2024-10-28T14:28:31","guid":{"rendered":"https:\/\/x-change.life\/wiki\/?post_type=docs&#038;p=881"},"modified":"2024-10-28T14:28:31","modified_gmt":"2024-10-28T14:28:31","slug":"quick-guide-to-the-activities-system","status":"publish","type":"docs","link":"https:\/\/x-change.life\/wiki\/docs\/quick-guide-to-the-activities-system\/","title":{"rendered":"Quick Guide to the Activities System"},"content":{"rendered":"\n<p>The new activities system makes it super easy to add\/remove activities dynamically! Just call <code>(activities:)<\/code> with your conditions and let the system handle the rest.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Format<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(activities: boolean_condition, \"Activity Name\", \"time_slot\")<\/code><\/code><\/pre>\n\n\n\n<p>The system will automatically:<\/p>\n\n\n\n<ul>\n<li>Add the activity when condition is true<\/li>\n\n\n\n<li>Remove it when false<\/li>\n\n\n\n<li>Handle all the cleanup (remove from lists, reset current activity if needed)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Simple Example<\/h2>\n\n\n\n<p>Here&#8217;s how to add &#8220;Go to the library&#8221; on weekdays:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(activities: (a:\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\") contains $day_of_week, \"Go to the library\", \"daytime\" )<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Forcing Activities<\/h2>\n\n\n\n<p>You can force an activity by adding two more parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(activities: $needs_to_study is true, \"Go to the library\", \"daytime\", true, \"You have an important test coming up - better hit the books!\" )<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Time Slots<\/h2>\n\n\n\n<ul>\n<li>&#8220;morning&#8221;<\/li>\n\n\n\n<li>&#8220;daytime&#8221;<\/li>\n\n\n\n<li>&#8220;evening&#8221;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Pro Tips:<\/h2>\n\n\n\n<ol start=\"1\">\n<li>Call your activities code frequently enough (like in daily refresh passages) &#8211; the system handles cleanup automatically!<\/li>\n<\/ol>\n\n\n\n<ol start=\"2\">\n<li>No need to manually remove activities &#8211; just let the condition go false:<\/li>\n<\/ol>\n\n\n\n<p>Bad (old way):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(if:not condition)&#91;(set:$evening_activities to it - (a:\"My Activity\"))] (if:condition)&#91;(set:$evening_activities to it + (a:\"My Activity\"))] <\/code><\/code><\/pre>\n\n\n\n<p>Good (new way):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(activities: condition, \"My Activity\", \"evening\")<\/code><\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>For forced activities that override player choice:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><code>(activities: $doctor_appointment is true, \"Doctor Visit\", \"daytime\", true, \"Can't skip this appointment!\" )<\/code><\/code><\/pre>\n\n\n\n<p>Remember: The system handles all the complex stuff like:<\/p>\n\n\n\n<ul>\n<li>Deduplication<\/li>\n\n\n\n<li>Removing activities when conditions are false<\/li>\n\n\n\n<li>Managing forced activities<\/li>\n\n\n\n<li>Cleaning up activity lists<\/li>\n\n\n\n<li>Resetting to &#8220;Nothing&#8221; when needed<\/li>\n<\/ul>\n\n\n\n<p>BUT, the old method will still work. This will just work better! At the moment, you can&#8217;t add additional emojis to the activity list. I plan to add the ability for you to add those.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. Basic Format The system will automatically: Simple Example Here&#8217;s how to add &#8220;Go to the library&#8221; on weekdays: Forcing Activities You can force an activity by adding two more parameters: [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"doc_category":[16],"doc_tag":[21],"_links":{"self":[{"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/docs\/881"}],"collection":[{"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/comments?post=881"}],"version-history":[{"count":1,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/docs\/881\/revisions"}],"predecessor-version":[{"id":882,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/docs\/881\/revisions\/882"}],"wp:attachment":[{"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/media?parent=881"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/doc_category?post=881"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/x-change.life\/wiki\/wp-json\/wp\/v2\/doc_tag?post=881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}