Hi all. I'm working on implementing a day/night cycle in my game, with specific functionality: I want the day/night cycle to only run on the world map, and pause on whatever phase of the cycle it's on when you enter towns/dungeons/etc.
I've found several helpful threads here to get me pretty far toward this goal. I've managed to get the day night cycle to only run on the world map and pause when you enter a town/dungeon. The problem, however, is that when I return to the world map, the day/night cycle starts over (I have it set to begin at the "Daytime" setting) rather than continuing from whichever day/night phase you were on while you were in the town/dungeon.
In other words, every time I return to the world map, it's daytime, even if the town I just left was on the "Night" phase.
See below for a look at how I have things currently set up. I'd love any advice from the RPGMakers here who are smarter than me and can help me figure out how to solve this last little problem!
(Or if this is already addressed by an existing plugin, happy to go that route, too.)
Thank you!
1. I have four Common Events to cycle through the four day/night phases and handle the screen tinting:
Dawn Common Event
Tint Screen: (34, -34, -68, 170)
Wait: 300 frames
Control Switches: #0002 ItIsDawn = OFF
Control Switches: #0003 ItIsDaytime = ON
Daytime Common Event
Tint Screen: (0, 0, 0, 0)
Wait: 999 frames
Control Switches: #0003 ItIsDaytime = OFF
Control Switches: #0004 ItIsDusk = ON
Dusk Common Event
Tint Screen: (68, -34, -34, 0)
Wait: 300 frames
Control Switches: #0004 ItIsDusk = OFF
Control Switches: #0005 ItIsNight = ON
Night Common Event
Tint Screen: (-68, -68, 0, 68)
Wait: 999 frames
Control Switches: #0005 ItIsNight = OFF
Control Switches: #0002 ItIsDawn = ON
2. On the world map, I have a Parallel Event to start the Common Event cycle (starting with "Daytime"):
Control Switches: #0003 ItIsDaytime = ON
Erase Event
3. On the town/dungeon maps, I have a Parallel Event to pause the Common Event cycle on whichever part of the cycle it was on when you exited the world map:
If: ItIsDawn is ON
Control Switches: #0002 ItIsDawn is OFF
Else
If: ItIsDaytime is ON
Control Switches: #0003 ItIsDaytime is OFF
Else
If: ItIsDusk is ON
Control Switches: #0004 ItIsDusk is OFF
Else
If: ItIsNight is ON
Control Switches: #0005 ItIsNight is OFF
End
I've found several helpful threads here to get me pretty far toward this goal. I've managed to get the day night cycle to only run on the world map and pause when you enter a town/dungeon. The problem, however, is that when I return to the world map, the day/night cycle starts over (I have it set to begin at the "Daytime" setting) rather than continuing from whichever day/night phase you were on while you were in the town/dungeon.
In other words, every time I return to the world map, it's daytime, even if the town I just left was on the "Night" phase.
See below for a look at how I have things currently set up. I'd love any advice from the RPGMakers here who are smarter than me and can help me figure out how to solve this last little problem!
(Or if this is already addressed by an existing plugin, happy to go that route, too.)
Thank you!
1. I have four Common Events to cycle through the four day/night phases and handle the screen tinting:
Dawn Common Event
Tint Screen: (34, -34, -68, 170)
Wait: 300 frames
Control Switches: #0002 ItIsDawn = OFF
Control Switches: #0003 ItIsDaytime = ON
Daytime Common Event
Tint Screen: (0, 0, 0, 0)
Wait: 999 frames
Control Switches: #0003 ItIsDaytime = OFF
Control Switches: #0004 ItIsDusk = ON
Dusk Common Event
Tint Screen: (68, -34, -34, 0)
Wait: 300 frames
Control Switches: #0004 ItIsDusk = OFF
Control Switches: #0005 ItIsNight = ON
Night Common Event
Tint Screen: (-68, -68, 0, 68)
Wait: 999 frames
Control Switches: #0005 ItIsNight = OFF
Control Switches: #0002 ItIsDawn = ON
2. On the world map, I have a Parallel Event to start the Common Event cycle (starting with "Daytime"):
Control Switches: #0003 ItIsDaytime = ON
Erase Event
3. On the town/dungeon maps, I have a Parallel Event to pause the Common Event cycle on whichever part of the cycle it was on when you exited the world map:
If: ItIsDawn is ON
Control Switches: #0002 ItIsDawn is OFF
Else
If: ItIsDaytime is ON
Control Switches: #0003 ItIsDaytime is OFF
Else
If: ItIsDusk is ON
Control Switches: #0004 ItIsDusk is OFF
Else
If: ItIsNight is ON
Control Switches: #0005 ItIsNight is OFF
End