|
One of the best ways to introduce realisim is to have a day system or a clock, while I'm posting this at work most of this tutorial will be in part 2 with the RGSS2 portion of it, well just the drawing of the clock/day/and location.
For now, let's just setup our fab. lil system.
Variables needed. variable[001]Day equal to 1 variable[002]Hour equal to 0 variable[003]Minute equal to 0 variable[004]Second equal to 0
Now for the actual coding.
//seconds variable[004]Seconds [004] + 1 if condition branch [004] >=60 variable[003]Minute [003] + 1 variable[004]Second equal 0 end case //minutes if condition branch [003] >=60 variable[002]Hour [002] + 1 variable[003]Minute equal 0 end case //hour if condition branch [002] >=24 variable[001]Day [001] + 1 variable[002]Hour equal 0 end case //day if condition branch [001] >=7 variable[001]Day equal 1 end case
This takes care of all time in the game, and if you wanted you can even add months to the game and create a realistic weather system, the timer or clock system doesn't time itself like a real clock because 60/60 seconds is really 1 second so really 1 second=1 minute and 1 minute=1 hour and so on. so 24 minutes = 1 day, so 24X30 is 720 and you can figure out how many hrs that is ok it's 12 hours, so 36 hours is 1 year.
Later on I'll add the RGSS2 stuff which will draw the data onto the screen, and this is a great system for menus, you don't need to use rgss/2 for everything.
Most of this will work for XP but all the rgss/2 stuff won't because I use VX, not XP^^
__________________________
Xeilsoft - Follow your dreams to the very end..
Kits that I'm working on. [Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.
Main PC Core i7 3820 overclocked @ 4.8GHZ Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB Asrock X79 Extreme9 w' creative sound 64GB corsair platinum @ 1600MHZ Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD. Rosewill Lightning 1000W PSU OS: Funtoo Linux, Windows 8 (Virtual Machine)
iMac (March 2013) 3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz 16GB 1600MHz DDR3 SDRAM - 2X8GB 1TB Serial ATA Drive @ 7200 rpm NVIDIA GeForce GTX 680MX 2GB GDDR5
|