Ganjika Posted August 29, 2012 Author Share Posted August 29, 2012 Is there a relatively easy way i could implement world time in game which could be retrieved with like /time or something and/or possibly even have multiple time zones? Link to comment Share on other sites More sharing options...
Joyce Posted August 30, 2012 Share Posted August 30, 2012 Well, if you write a base time system you can always have a setting on your maps with a +/- timezone option. ;]As for writing a time system, use GetTickCount on the server to update your minutes/hours on a specified interval, and act accordingly from there. :] Link to comment Share on other sites More sharing options...
Ganjika Posted August 31, 2012 Author Share Posted August 31, 2012 > Well, if you write a base time system you can always have a setting on your maps with a +/- timezone option. ;]> > As for writing a time system, use GetTickCount on the server to update your minutes/hours on a specified interval, and act accordingly from there. :]I'm pretty new to vb still but learning a bunch every day, Where exactly would I start in making such a change? - it doesn't sound to big, but where and how would i implement the steps you indicated? Thanks again for your feedback and input. =] Link to comment Share on other sites More sharing options...
Joyce Posted August 31, 2012 Share Posted August 31, 2012 Here's how Eclipse Dawn handled it, it has a bunch of useless stuff included in it, and would require you to define stuff yourself and whatnot.. But it might serve as an example:```If Tick > tmr1000 Then' Are we shutting down?If isShuttingDown ThenCall HandleShutdownEnd If' Are we using the time system?If Options.DayNight = 1 Then' Check if we are using real time or not.If Options.RealTime = 1 ThenGameMinutes = Minute(Now)GameHours = Hour(Now)Else' Nope, so let's use our own system..' Change the game time.GameMinutes = GameMinutes + GAME_MINUTES_PER_SECONDIf GameMinutes > 59 ThenGameMinutes = 0GameHours = GameHours + 1If GameHours > 23 ThenGameHours = 0End IfEnd IfEnd If' See if we need to switch to day or night.If DayTime = True And GameHours > 19 ThenDayTime = FalseSendGameTimeGlobalMsg "Nighttime has fallen upon this realm!", YellowElseIf DayTime = False And GameHours > 7 And GameHours < 19 ThenDayTime = TrueSendGameTimeGlobalMsg "Daytime has arrived in this realm!", YellowEnd If' Update the labelIf DayTime = True ThenfrmServer.lblGameTime.Caption = "(Day) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))ElsefrmServer.lblGameTime.Caption = "(Night) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))End IfEnd If' Set the timer so we don't check it for about a second.tmr1000 = GetTickCount + 1000End If```Can't really give any better examples at the moment, don't have VB6 installed nor will I have until at least Monday.. Have to fix up some issues in my Windows 8 installation first, but left the disc at work xD Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now