|
|
|
 |
Posted 2004-01-25, 12:44 PM
in reply to 05thouldm's post starting "I have go tthe time thing to work and..."
|
 |
 |
 |
You don't want the inside of houses to be dark as well? Okay then..
Change the parts where you set the screen tone to setting a "xxxx:TimeOfDay" variable (set it to 1 for morning, 2 for mid-day, 3 for afternoon, 4 for night)
(Changes are in red)
<>Branch: TimeInEffect is ON
...<>Add 1 to "0024:Hour" variable
...<>Branch: Hour = 6
......<>Branch: Hour = 11
.........<>Branch: Hour = 15
............<>Branch: Hour = 20
...............<>Branch: Hour = 24
..................<>Set Hour to 0
..................<>
...............:End
...............<>Set TimeOfDay = 4
...............<>
............:End
............<>Set TimeOfDay = 3
............<>
.........:End
.........<>Set TimeOfDay = 2
.........<>
......:End
......<>Set TimeOfDay = 1
......<>
...:End
...<>Branch: TimeOfDay = 1
......<>Set screen to morning
......<>
....:End
...<>Branch: TimeOfDay = 2
......<>Set screen to mid-day
......<>
....:End
...<>Branch: TimeOfDay = 3
......<>Set screen to afternoon
......<>
....:End
...<>Branch: TimeOfDay = 4
......<>Set screen to night
......<>
....:End
...<>Wait x seconds
...<>
:End
--------------------
The logic is this:
Check if time is active
...Add 1 to hour
...Check if new hour changes the time of day - if so, set the TimeOfDay variable
...Set screen to whatever time of day it is
...Wait x seconds for hour to pass
-----------------
Reactivating time will automatically set the screen to whatever time of day it is, after incrementing it one hour. Thus, a house effect is this:
------------------
(timer common event) -> Hour is 23, TimeOfDay = 4
(timer common event) -> Set screen to night (even if it's already night)
(timer common event) -> Wait x seconds for hour to finish
Deactivate time
Teleport inside house
(timer common event) -> Hour wait finishes, waiting to reactivate time for next hour
In house, do whatever
Telport outside
Activate time
(timer common event) -> Hour increases, 24
(timer common event) -> Hour set to 0
(timer common event) -> Screen change to night
(timer common event) -> Wait x seconds for next hour
--------------------
Basically, going inside and spending more than an hour inside, will make you "lose" an hour when going outside. (If it's 4, and you spend 5 hours in there, the time when you leave will be 5, not 9 - since time's stopped based on the logic above.) However, the TimeOfDay will automatically reset the screen color when time is reactivated, if you spend more than an "hour" there. It actually resets the screen color every hour, even if the screen is correct, but you won't see the effect transitioning from dark to dark since they're the same color.
If you want, I can give you the code for having the time be constantly going and only changing the screen:
1) Every hour
2) On a direct command to update the screen
If you want THAT, that's no problem.
|
 |
 |
 |
|
|
|
|
|
|
|