Real Time Clock SytemTutorial for TGF2 MMF2 and MMFD
Author: | Otter
|
Submitted: | 1st July, 2008
|
Views: | 6681
| Rated: |
|
|
Sorry, I accidently deleted the original article when trying to delete another one. I liked it so I decided to repost it.
Wiiman's Realtime Tutorial
Ever played that Animal Crossing game? You may not have. When I first played the game I was mesmorized by its style of gameplay and how it addicted you and drew you in. If you don't know what I mean by all of this, I'll explain it. The incredibly unique thing called real time is where it uses the time of your computer to change the time of your game. So your game has the exact time as real life. If played out right, you can get really into the game and it begins to feel very much alive. Real Time is one of the most complex things on TGF2, and one of the easiest to program. So are you ready for your games to come to life in world's of their own?
Okay, so first you'll need to make an object,stretch it to fill up the entire screen, make it the different color shades for the time of day. The animations should be stopped, morning, morning2, morning3, midday,afternoon, afternoon2, night, night2. Now create a counter and a date time object. Put Date and Time as a clock instead of date. Go to actions screen, insert a new action, right click on the computer and click always. Now go to the counter, set counter, retreive data from object, right click on date and time, click on get hours.
Now, to get started, started adding actions, compare counter to value, lower that 3, active change animation to night2. This means that if it's 3 or earlier in the morning, it'll be dark out. Do the same again, counter is equal to 4, active change animation to morning. Repeat for counter is equal to 5. Now for counter is equal to 6, active should change animation to morning2. Repeat for counter equal to 7 and 8. For Counter equal to 9, morning 3. Repeat for 10 and 11.
Now for counter is equal to 12, change animation to Midday. Keep this up for 13, 14, and 15. You'll have to use military time when doing real time games. This means anything past noon is added to 12, so 15 o'clock is really 3 o'clock. Get it? AMs are normal and PMs are all past 12. Counter is equal to 16 and 17 should change active's animation to Afternoon.
18 and 19 should change animation to afternoon2. 20, 21, and 22; change active's animation to night. 22 and 24 change animation to night2.
Gongratulations! You've just made real time! Now your games can be connected to the real world! This is most commonly used in Simulation games, but why not use it on an action game to make people get more into it? Real Time makes you feel connected to a game, which is why it is a great addition.
It doesn't end with day and night effects. You can create a date and time object, only now make it a date instead of a clock. Create another counter, set it months, and do all kinds of stuff. You could make the ground change. Like in fall it's orange, in winter it's white with snow and etc. If you have MMF2 and MMF2D, you can change the background color so won't take up as much space and cause so much lagging. You could even make the real time effects go faster in winter. You could make a game that has real holidays like christmas by setting another counter to days of month and days of week!
You can also create another object for weather, then have random weather in your games. You can make the probability of rain dependent on the month and season.
On final note, if you make a counter equal to week days, 1 will not be sunday, 1 will be monday, sunday will be 0, and saturday will be 6.
Hope you learned something with this!
|
|
OtterRating Registered 29/06/2008
Points 464
|