summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Change-Time-Based-Evolution-Times.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/Change-Time-Based-Evolution-Times.md b/Change-Time-Based-Evolution-Times.md
new file mode 100644
index 0000000..241dc03
--- /dev/null
+++ b/Change-Time-Based-Evolution-Times.md
@@ -0,0 +1,21 @@
+For whatever reason, Game Freak decided that day time in Ruby, Sapphire and Emerald should be from 12:00 p.m. to 11:59 p.m. (and night time should be 12:00 a.m. to 11:59 a.m.). As there's no day/night cycle in these games, this only really affected Eevee's evolution into Espeon or Umbreon.
+
+This tutorial will explain how to change these to more sensible values, as seen in most other Pokémon games.
+
+First, open up [include/pokemon.h](../blob/master/include/pokemon.h) and define two new constants:
+
+```
+#define DAY_START 4
+#define NIGHT_START 18
+```
+These values will be used to determine what time day and night start in your game; note that they're in 24 hour time. Feel free to customize them.
+
+Next, open up [src/pokemon.c](../blob/master/src/pokemon.c) and replace all instances of the following code:
+* Replace `gLocalTime.hours >= 12 && gLocalTime.hours < 24` with `gLocalTime.hours >= DAY_START && gLocalTime.hours < NIGHT_START`
+* Replace `gLocalTime.hours >= 0 && gLocalTime.hours < 12` with `(gLocalTime.hours >= NIGHT_START || gLocalTime.hours < DAY_START)`
+
+If you're using Dizzy Egg's repos in your project you may have a few instances of these, but otherwise there's only one of each.
+
+Lastly, if you've chosen different day/night start times, you should double check that the AND and OR conditions above still make sense.
+
+For example: if you did `#define DAY_START 12` and `#define NIGHT_START 0`, you'd have `gLocalTime.hours >= 12 && gLocalTime.hours < 0`, which won't work as `gLocalTime.hours` can't be greater than 12 and less than 0 at the same time. \ No newline at end of file