[Solved] Time Cycle resets when changing maps

Gniani

The Lazyest Developer
Member
Joined
Apr 28, 2018
Messages
2
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
I created a common event that uses a variable called time, each 600 frames (10 seconds) it increases by 1 (240 seconds to make 24 hours in the game), then another common event using conditions to make time progress, but when i change the map, the cycle resets, time was 10, it will go back to 0, can someone help me fix this?day night cycle.PNG time.PNG
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
Hm, I never thought about it, but it seems like Common Events restart on maps. In other words, your 9:Time Common Event starts anew on a new map, so it becomes 0 again.

Anyway, Parallel Processing events loop, and both events can be written in one Common Event given they have the same switches, plus most variables usually start at 0.

For your Time Common Event, just write Wait 600 and Hour Variable += 1, no need for a Loop or multiples of that line. For your Day Night Cycle Common Event, get a conditional branch for Hour >= 24 and simply make Hour = 0 in there. That way, one handles the increment of hours and the other interprets those hours including the fact that 24:00 is 0:00.

Be prepared to hear some people say how the Day/Night cycle can be improved, though.
 

Gniani

The Lazyest Developer
Member
Joined
Apr 28, 2018
Messages
2
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
Hm, I never thought about it, but it seems like Common Events restart on maps. In other words, your 9:Time Common Event starts anew on a new map, so it becomes 0 again.

Anyway, Parallel Processing events loop, and both events can be written in one Common Event given they have the same switches, plus most variables usually start at 0.

For your Time Common Event, just write Wait 600 and Hour Variable += 1, no need for a Loop or multiples of that line. For your Day Night Cycle Common Event, get a conditional branch for Hour >= 24 and simply make Hour = 0 in there. That way, one handles the increment of hours and the other interprets those hours including the fact that 24:00 is 0:00.

Be prepared to hear some people say how the Day/Night cycle can be improved, though.
Thanks! With that i came up with a system that uses a condition, if time = 24, variable time goes back to 0, it doesn't reset that way!
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top