Scheduling

From Kemoverse
Revision as of 21:22, 16 May 2023 by Commando950 (talk | contribs) (Trivia heading changed to Caveats. Much more fitting of a title.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Scheduling is used combined with Scripting to switch to different scripts based on the time of day. This allows you to load and unload certain scripts dynamically, allowing your SPC(Scripted Playable Character) to have different tasks on different times of the day. By using different actions on different times of the day your SPC will feel more alive as a result.

Example

Schedules are actually pretty easy, but it is important to remember it follows a 24 hour time standard, not AM or PM. The following script shows a simple way to automate switching between fishing,lunch,fishing again, and going to sleep with this schedule.

# Start our fishing script at 6:00
>06.00
inter
life fishinglake
# Go to the lunch table at 12:00
>12.00
inter lunchinter
life lunchlife
# Start our fishing script at 13:00
>13.00
inter
life fishinglake
# Go to sleep at 19:00. Stay asleep until 6:00 again.
>19.00
inter
life sleepytime

inter <script> sets what interaction script you are running while life <script> sets what life script you are running.

Setting either inter or life with no parameters will make them unload any currently loaded script. Essentially setting there to be no script for this time of day.


An important thing to note about these scripts is how these time statements work. Each >time statement is essentially checking if the current time is greater than the time we are comparing to, if it is true it will load the scripts you have under it. Another thing of importance is how time activities actually wrap around. The scheduling system knows that 19:00 to 6:00 with this example script is still bedtime, waiting until bedtime is over. Since the script can't find any mention of >0.00 in your schedule it simply uses the >19.00 statement instead.

Caveats

  • In certain situations it will not load your script, especially if it has already been loaded.
  • If a certain time condition has been triggered and you changed the interaction/life script, it might not always change it back.
  • As previously stated, if the script can't find a time condition that matches the current time it will simply just continue off the last time condition.