Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

In-game World Time?


Ganjika
 Share

Recommended Posts

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

> 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

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 Then

Call HandleShutdown

End 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 Then

GameMinutes = Minute(Now)

GameHours = Hour(Now)

Else

' Nope, so let's use our own system..

' Change the game time.

GameMinutes = GameMinutes + GAME_MINUTES_PER_SECOND

If GameMinutes > 59 Then

GameMinutes = 0

GameHours = GameHours + 1

If GameHours > 23 Then

GameHours = 0

End If

End If

End If

' See if we need to switch to day or night.

If DayTime = True And GameHours > 19 Then

DayTime = False

SendGameTime

GlobalMsg "Nighttime has fallen upon this realm!", Yellow

ElseIf DayTime = False And GameHours > 7 And GameHours < 19 Then

DayTime = True

SendGameTime

GlobalMsg "Daytime has arrived in this realm!", Yellow

End If

' Update the label

If DayTime = True Then

frmServer.lblGameTime.Caption = "(Day) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))

Else

frmServer.lblGameTime.Caption = "(Night) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))

End If

End If

' Set the timer so we don't check it for about a second.

tmr1000 = GetTickCount + 1000

End 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...