View Single Post
 
Reply
Posted 2006-05-22, 05:47 AM in reply to Lenny's post starting "For the first question, BC will have to..."
VARIABLES > SWITCHES

You'd do the timing in a single event that just loops around, for the most part. This is for a 24 hour system and not a pure "morning/noon/night" system.

Add one to the variable [xxxx:CurrentTime].
If CurrentTime is 24, change it to zero instead.
Wait 60 seconds (or whatever you want between the hours, maybe 15.)


If the event is activated via a switch, you can turn off the advancement of time (for being inside of a building, etc). The biggest problem, though, is that depending on the placement of the Wait command within the event, either the hour will still advance once after you stop time, or it will advance immediately after time is restarted.

From there, you can check the time as a range, like

Code:
<>Branch if CurrentTime >= 6
     <>Branch if CurrentTime <= 10
          <>Message: "Cube:  It is waffle time!"
          <>Message: "The President: I do not believe it!"
          <>
     :End
     <>
:End
<>
Also, you can check to see if CurrentTime = 18, to change the screen tone to dark, or CurrentTime = 8 to change it back to light (or any number of settings) but if you're just doing morning-noon-night, then stick with the basics.
-----------------

You can always just use a varirable that goes between 0-1-2 for morning-noon-night and track the time via one of the Timers built into RM2k3. This has the advantage of being easier and directly applicable to whatever event is happening without checking the hours (if the variable is 0, it's morning, no other things are necessary to check it.) You can also stop and start time in the 'middle' of the whole thing without any problems. I'll go more into it if needed, but I have to head to work in a half hour.
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube