Post by Ethan Hawkeye on May 11, 2005 22:43:03 GMT -5
Alright so we'll open up our Common Events area in the database and make a new common event call it Time or Day/Night whatever floats your boat. Next set it to parallel process. You don't need to have it have a starting swittch unless you want your game set at a specific hour when you start it. Now for this system to work you need to understand Variables and Fork Conditions, that's it that's all. So we need 3 variables, I called mine TimeSec,TimeMin and TimeHour. I used variables numbers 1, 2 and 3, but the names and numbers you use dont have to be these and can vary to whatever you want them to be.
If you look at the coding below that's what your result should be, I have it so that every 20 seconds a minute goes up and every 30 minutes is an hour. If you want you can change those numbers to be a faster or slower game time or set it to real time if you want. After 24 hours, the hours reset and start back at zero again. At the very bottom of the coding, this is the only thing you have to focus on really:
"<>If Var(0003:TimeHour) 1
<>Set Screen Tone: RGB(030,030,040),C(030),1.0sec
<>
:End Case"
This means that when the hour is set to 1 the screen tone changes a certain color, to have the screen tone change every hour you would have 24 of these fork conditions one after another up to 24, not with any else cases. This day night system is cool because you can have your screen change color ever so slightly every hour which gives off a really cool effect, so there's the coding below, and remember you have to repeat that last section and set it to whichever hours you want to have a screen tone change effect. Good luck.
<>Wait: 1.0sec
<>Change Variable: Var[0001:TimeSec] + 1
<>If Var(0001:TimeSec)20
<>Change Variable: Var[0001:TimeSec] = 0
<>Change Variable: Var[0002:TimeMin] + 1
<>If Var(0002:TimeMin)30
<>Change Variable: Var[0002:TimeMin] = 0
<>Change Variable: Var[0003:TimeHour] + 1
<>If Var(0003:TimeHour)24
<>Change Variable: Var[0003:TimeHour] = 0
<>
:End Case
<>
:End Case
<>
:End Case
<>If Var(0003:TimeHour) 1
<>Set Screen Tone: RGB(030,030,040),C(030),1.0sec
<>
:End Case
If you look at the coding below that's what your result should be, I have it so that every 20 seconds a minute goes up and every 30 minutes is an hour. If you want you can change those numbers to be a faster or slower game time or set it to real time if you want. After 24 hours, the hours reset and start back at zero again. At the very bottom of the coding, this is the only thing you have to focus on really:
"<>If Var(0003:TimeHour) 1
<>Set Screen Tone: RGB(030,030,040),C(030),1.0sec
<>
:End Case"
This means that when the hour is set to 1 the screen tone changes a certain color, to have the screen tone change every hour you would have 24 of these fork conditions one after another up to 24, not with any else cases. This day night system is cool because you can have your screen change color ever so slightly every hour which gives off a really cool effect, so there's the coding below, and remember you have to repeat that last section and set it to whichever hours you want to have a screen tone change effect. Good luck.
<>Wait: 1.0sec
<>Change Variable: Var[0001:TimeSec] + 1
<>If Var(0001:TimeSec)20
<>Change Variable: Var[0001:TimeSec] = 0
<>Change Variable: Var[0002:TimeMin] + 1
<>If Var(0002:TimeMin)30
<>Change Variable: Var[0002:TimeMin] = 0
<>Change Variable: Var[0003:TimeHour] + 1
<>If Var(0003:TimeHour)24
<>Change Variable: Var[0003:TimeHour] = 0
<>
:End Case
<>
:End Case
<>
:End Case
<>If Var(0003:TimeHour) 1
<>Set Screen Tone: RGB(030,030,040),C(030),1.0sec
<>
:End Case