Real Time Clock

From GTAMods Wiki
Jump to navigation Jump to search

This code snippet is a modification that attempts to make one game minute equal to one real minute.

Installation

This installation guide uses the latest version of the Sanny Builder.

Find:

004F: create_thread @MS_BIKE_MISSIONS

and add below:

004F: create_thread @RTMOD

Find:

//-------------Mission 0---------------

and add above:

:RTMOD
03A4: name_thread 'RTMOD' // This is the name of the thread.
 
:RTMOD_11
0001: wait 0 ms // The code is in loop so you need a wait here to prevent a crash.
00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes // This stores the game's current time in hours as [email protected] and in minutes as [email protected]
00C0: set_current_time_hours_to [email protected] minutes_to [email protected] // This forces the time to stay still.
01B6: set_weather 0 // Because of the manipulation of time in loop, the weather would change constantly. This prevents the weather from doing that.
00D6: if
0019:   [email protected] > 59999 // Checks if 59999 milliseconds has passed (1 minute).
004D: jump_if_false @RTMOD_11 // If not, loop back up. If yes, continue.
0006: [email protected] = 0 // Internal timer [email protected] is reset so it can check if one minute has passed again later on.
000A: [email protected] += 1 // One game minute is added.
00D6: if
0019:   [email protected] > 59 // Checks if time in minutes passed 59 minutes.
004D: jump_if_false @RTMOD_128 // If not, jump to next label. If yes, continue.
0006: [email protected] = 0 // Resets the minute.
000A: [email protected] += 1 // One game hour is added because 59 minutes has passed.
00D6: if
0019:   [email protected] > 23 // Checks if time in hours passed 23 hours.
004D: jump_if_false @RTMOD_128 // If not, jump to next label. If yes, continue.
0006: [email protected] = 0 // Resets the hour.

:RTMOD_128
00C0: set_current_time_hours_to [email protected] minutes_to [email protected] // Game time is forced to set at those values.
0002: jump @RTMOD_11 // Loops back up.

Information

Author: Barton Waterduck
Games: GTA 3, GTA VC, GTA SA