View Full Version : Real-Time Clock
Dameria
10-30-2009, 05:07 PM
I have been working on this the past few hours as I thought about how I would go about doing this. At first I thought it would be too hard for me, but as I started thinking I started to do things step by step, and eventually I found out how to make the clock work based on the real time!
Please x2495iiii and dubastot and Chris101b try my program and tell me what you think! This program actually taught me more about the math of using Alice, so I am glad I made it.
When you start the world, the hour, minute, and second hand go to the appropriate place on the clock, and then tick accordingly every second. The clock is very accurate, and just in case the timing of Alice is a little off, the clock resets itself to the correct time every 10 minutes (you can change this within the program, I have notes in it to explain how).
Also, the hour hand might be different for you. I had to subtract 4 hours from what it would originally display. I don't really know why, but I think it has to do with the GMT time and my timezone. It is set to U.S. Eastern Time Zone, so you might have to change it accordingly (see notes in program for how to change the hour hand), but run the program first just to see if it gives you the right hour, and if not than change the math so that it does.
I hope you like it! (Although I don't know how useful this program will be...)
xxledzeppelin2x3
10-30-2009, 11:17 PM
very nice, but i think the 2.0 version should include a way to change the hour and minute hands to the correct time!?
Dameria
10-30-2009, 11:18 PM
It should be the correct time, well at least the minute hand should be. There are directions within the script explaining how to change the hour hand. I think it might be different time zones that might be the problem.
x2495iiii
10-31-2009, 02:24 AM
Really, this is excellent work, and I could honestly see myself using this to animate clocks properly in Alice games. Great job!
I'm not sure why you had to subtract 4 hours from the time, but I live in the same time zone you do (GMT -5:00) and it was exactly four hours slow until I changed it back.
Still, wonderful work. I honestly get a kick out of accurate, yet simple projects like these because they're like gadgets in the sidebar (of Windows Vista): neat little programs that are fun to collect and fun to play with. Awesome job!
Dameria
10-31-2009, 01:35 PM
Ok, I have been working on this for a while now, and I made a better version of the Clock. The reason why I had the hour wrong is because I was using Alice 2.0 and there must be an error while using time on that version. I downloaded 2.2 today and I actually like it a lot better (although it will take a while to get used to). The time for me actually works correctly on 2.2 for me, so I fixed that.
New Additions:
I added a new clock design that will be noticeably different from the old one that I had in the first version. This one is a modern clock now, HOWEVER you can also click anywhere on the clock to change it back to the original Clock wooden design from the first version (if you like that one better).
Also, I think this is cool, I added a new Digital Clock in the regular Clock, so now not only will you see the ticking clock version, but a digital one as well. Thank you cardsfan527 for the post of your digital clock, you helped me to design the one that I used for my program!!! You really helped a lot.
If you do not like the look of the digital clock, you can click anywhere on the digital clock and it will disappear, and click again for it to reappear.
Oh and I also added an AM / PM on it so that it will tell you whether it is lets say 2:46 AM or 2:46 PM instead of just 2:46. The AM is to the top left of the clock, and PM is on the top right. I did not make any scripts to make these disappear.
Please try the program and tell me what you think, or if there are any errors, and what I should add for version 2.1 (and if there are a lot of changes, version 3.0!)
cardsfan527
10-31-2009, 01:50 PM
Hey, first, thanks for the recognition. Second, this clock looks really nice, and very accurate. I like the user input for what hour it is, but when i put in my input it only changes the regular clock, not the digital. Other than that, looks perfect--great job
Dameria
10-31-2009, 01:54 PM
Hey, first, thanks for the recognition. Second, this clock looks really nice, and very accurate. I like the user input for what hour it is, but when i put in my input it only changes the regular clock, not the digital. Other than that, looks perfect--great job
Hmm, the user input thing was supposed to be disabled, did you enable it? I think I should actually take it out completely if it is automatically enabling when you open the program.
x2495iiii
10-31-2009, 03:38 PM
Hang on a sec, I just got a nasty error in Alice and I'm trying to fix it. It might take up to an hour, unfortunately, but I'll definitely leave my feedback when it's fixed, alright?
Dameria
10-31-2009, 03:43 PM
Oh, do you mean with my program or Alice in general? I hope its not my program, because I am not getting any errors with it.
x2495iiii
10-31-2009, 03:54 PM
Alrighty, I got it fixed, and I have to say LOVE it! Seriously, this makes me wish I could run Alice rpograms in the background, just so I could keep this open! This is great!
Seriously, awesome job!
Dameria
10-31-2009, 05:34 PM
I have decided to write post #11 just so that people coming in to download will not have to go back a page, and here is the same post that was written for Clock 2.0:
Ok, I have been working on this for a while now, and I made a better version of the Clock. The reason why I had the hour wrong is because I was using Alice 2.0 and there must be an error while using time on that version. I downloaded 2.2 today and I actually like it a lot better (although it will take a while to get used to). The time for me actually works correctly on 2.2 for me, so I fixed that.
New Additions:
I added a new clock design that will be noticeably different from the old one that I had in the first version. This one is a modern clock now, HOWEVER you can also click anywhere on the clock to change it back to the original Clock wooden design from the first version (if you like that one better).
Also, I think this is cool, I added a new Digital Clock in the regular Clock, so now not only will you see the ticking clock version, but a digital one as well. Thank you cardsfan527 for the post of your digital clock, you helped me to design the one that I used for my program!!! You really helped a lot.
If you do not like the look of the digital clock, you can click anywhere on the digital clock and it will disappear, and click again for it to reappear.
Oh and I also added an AM / PM on it so that it will tell you whether it is lets say 2:46 AM or 2:46 PM instead of just 2:46. The AM is to the top left of the clock, and PM is on the top right. I did not make any scripts to make these disappear.
Please try the program and tell me what you think, or if there are any errors, and what I should add for version 2.1 (and if there are a lot of changes, version 3.0!)
x2495iiii
10-31-2009, 05:52 PM
This is still very good. My only question now is what next? Do you plan on making it more complex and functional, like a stopwatch or a world clock? Or do you plan on tying it into a game, like to change it from day to night?
Dameria
10-31-2009, 06:44 PM
Those are some pretty good ideas. I was thinking about like what you did in ResidentPenguin where you have that menu with the guns and stuff, I could have a menu that you could choose like Stopwatch, Timer, Alarm, Time Zones, etc. The only thing is I'm too lazy to do that stuff lol! And also I have a busy weekend and no time during the week right now, so I can't work on it anymore.
Everyone feel free though to use this program in any programs you want to put it in.
Dameria
10-31-2009, 10:36 PM
By the way here is the Clock2.0 version again just so you don't have to go back to page 1:
xxledzeppelin2x3
10-31-2009, 11:54 PM
wow! i love it!
shikhargo
08-17-2010, 04:31 PM
Thats cool, how did you do it
:D
Dameria
08-17-2010, 09:43 PM
Thats cool, how did you do it
:D
I spent a lot of time on it when I made it, but that was about 10 months ago. I used the functions for getting the exact time from the computer and just rotated the clocks hands from there according to what time it was. It was a cool little application that I made a long time ago.