Jump to content

Real Time Clock


Recommended Posts

spaceeinstein

CONVERTED FOR SAN ANDREAS!

 

Created by Barton Waterduck for Vice City. Converted by spaceeinstein for San Andreas. This is a script mod that controls the in-game clock to imitate real life ones.

 

Installation for intermediate scripters only. Please download Barton's mission builder using Craig's link. The weather will stay the same but will be modified later on.

 

 

004F: create_thread ££TimeMod...:TimeMod0004: $weather = 6;; integer values0006: @33 = 0;; integer values  - Reset internal timer:TimeLoop0001: wait 500 ms 00BF: @1 = current_time_hours, @2 = current_time_minutes00C0: set_current_time @1 @201B5: force_weather $weather00D6: if 00019:   @33 > 59999;; integer values  - if internal timer >= 1 minute004D: jump_if_false ££TimeLoop0006: @33 = 0;; integer values  - reset the internal timer000A: @2 += 1;; integer values00D6: if 00019:   @2 > 59;; integer values004D: jump_if_false ££TimeModL20006: @2 = 0;; integer values000A: @1 += 1;; integer values00D6: if 00038:   $ON_MISSION == 0;; integer values004D: jump_if_false ££TimeModL30008: $weather += 1;; integer values00D6: if 00018:   $weather > 19;; integer values004D: jump_if_false ££TimeModL30004: $weather = 0;; integer values:TimeModL300D6: if 00019:   @1 > 23;; integer values004D: jump_if_false ££TimeModL20006: @1 = 0;; integer values:TimeModL200C0: set_current_time @1 @20002: jump ££TimeLoop 

 

Gltiches: May interfere with timers in the game.

Edited by spaceeinstein
Link to comment
https://gtaforums.com/topic/203446-real-time-clock/
Share on other sites

spaceeinstein
Why should I say "rewritten for SA MB"? And the weather, I made it so it stays the same. There are a whole lot more weather types in San An but that's was late at night when I converted it.
Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2992295
Share on other sites

"0004: $weather = 6;; integer values"

Could it be this?

Nah. That's just the setting of a variable. Until that variable gets used for something, it wouldn't effect your game at all.

 

For that matter, this code is totally useless

0008: $weather += 0;; integer values00D6: if 00018:   $weather > 6;; integer values004D: jump_if_false ££TimeModL30004: $weather = 6;; integer values

...which begins to reveal what I meant by it being translated for SAMB. As CyQ pointed out earlier in the week, it's not really converting mods because with the exception of using @33 instead of @17, nothing about this is platform specific. It's just reworked so that a different interpreter can use it. If it was converted, code like I quoted would've been eliminated because it does nothing. $WEATHER is set to 6 to start, incremented, and constantly put through an if >6 then 6 check. It's ALWAYS going to be 6. So instead of using another global var, just always say force weather 6 and be done with it.

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2993479
Share on other sites

spaceeinstein

O, yes, about that weather part, it was for my All In One Mod which uses the real time clock mod to make my permanent sunny weather in Vice City. I converted straight from that. Barton didn't do that, I did that, for my dead mod. If you want to fix that, here it is.

 

0008: $weather += 1 ;; integer values00D6: if 00018:   $weather > 19 ;; integer values004D: jump_if_false ££TimeModL30004: $weather = 0 ;; integer values

 

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2994389
Share on other sites

durrr locals

 

but, here's the proper way to make your game 'real time' (ie without screwing up the weather or having to start a new game, etc):

 

1. open up your savegame in a hex editor.

2. at offset 81h change the two bytes "E8 03" to "60 EA". this changes the length of an in-game minute from 1000 milliseconds to 60000 ms.

3. then, at the very end of the savegame (offset 317FCh), add 5Fh to the dword there. this adjusts the savegame's checksum so that sa won't detect your tampering with it.

4. load it up!

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2995222
Share on other sites

Lol I didn't even notice the "define memory" at the start biggrin.gif

I now compiled it but the weather is still the same...

And for that hex editor stuff... I managed to change the first part but I didn't get it the last part of it (dword)... forget this thing... I had enough confused.gif

Edited by Dogmeat
Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2996156
Share on other sites

Hello! I put this code to opened up mod and it works fine (Sky looks little foggy). I was doing some missions and savings, weather was same until i was driving to desert stormy weather starts and i drive fast to los santos to saving my game several times (hoping that stormy go away). Now my game had only weather: storm and it wont stop (i try to save many times and even cheat to get littlefoggy/sunny weather back). How i can get better weather (cloudy or sunny) Please help me?

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2997471
Share on other sites

My game was very foggy too and the weather cheats are not working so I don't think that there is much you can do. confused.gif

 

I think that you have to mofidy your save game like CyQ said but I don't understand the

"then, at the very end of the savegame (offset 317FCh), add 5Fh to the dword there" part.

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2998636
Share on other sites

durrr locals

 

but, here's the proper way to make your game 'real time' (ie without screwing up the weather or having to start a new game, etc):

 

1. open up your savegame in a hex editor.

2. at offset 81h change the two bytes "E8 03" to "60 EA". this changes the length of an in-game minute from 1000 milliseconds to 60000 ms.

3. then, at the very end of the savegame (offset 317FCh), add 5Fh to the dword there. this adjusts the savegame's checksum so that sa won't detect your tampering with it.

4. load it up!

thanks for the help CyQ, but could you maybe give us some more details for installation? Which hex editor would you recommend?

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2998655
Share on other sites

pretty much any hex editor will do. i generally use one called hex workshop.

 

i'll elaborate on how to do step 3:

- at the very end of the savegame you will find 4 bytes which make up a value. in my savegame these are "B0 27 24 01", but they can be pretty much anything.

- if you reverse them you will get what is called a dword. in my case: 012427B0.

- open up the windows calculator in scientific mode. set it to "hex". enter the dword, and add 5F to it. in my case: 012427B0 + 5F = 0124280F.

- reverse the result again (0F 28 24 01), and overwrite the last 4 bytes in the savegame with that.

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2999030
Share on other sites

Hello! I started new game and i changed all weather values 6 to 1(i didnt know what i was doing, but i have tested it: saving, driving all over sa and weather doesnt change anymore). Does this code have weather value (i like to chance weather more sunny)

0004: $weather = 6;; integer values(this?) Please help me

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-2999433
Share on other sites

  • 3 weeks later...
durrr locals

 

but, here's the proper way to make your game 'real time' (ie without screwing up the weather or having to start a new game, etc):

 

1. open up your savegame in a hex editor.

2. at offset 81h change the two bytes "E8 03" to "60 EA". this changes the length of an in-game minute from 1000 milliseconds to 60000 ms.

3. then, at the very end of the savegame (offset 317FCh), add 5Fh to the dword there. this adjusts the savegame's checksum so that sa won't detect your tampering with it.

4. load it up!

I looked in my save game and I dont have an offset 81h...

 

I searched for the byes and there are TONS of E8 03 instances..

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-3088100
Share on other sites

No, the timecyc tool plays the game according to the time in real life. If its 5pm in real life, its 5pm in the game.

 

What im trying to do is have the game time RUN at a normal rate, but NOT reflect the actual time in reality..

 

so 1 minute = 60 seconds of time, in the game, but time stops when the game isnt on.

 

 

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-3088135
Share on other sites

Bloodburn: it's there. Look for it on line 78. In my savegames it was always the first instance of 8E 03.

 

It's odd that some people reported problem with the weather using Cy Q's method. I've had no problems with the weather, that is to say, a particular weather pattern usually lasts several hours real time, but always changes eventually, which actually makes it more realistic. The reason I opted to use Cy Q's method instead of adding the script to my .scm was because I was not sure the script does the same thing. I would not want my weather to change every 15 real time minutes.

 

I am also wondering if editing the savegame would have any kind of impact on the missions. I am having problems triggering the Catalina missions using Craig's SA Opened Up mod. I've added other scripts to the .scm, which may be the culprit, but I am not sure if changing the game to progress in real time might cause the Catalina mission triggers to "break." Has anyone here had problems with that? This might turn out to be a rather ignorant question but I am just trying to narrow in on the cause of the problem I am experiencing.

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-3091408
Share on other sites

Bloodburn: it's there. Look for it on line 78. In my savegames it was always the first instance of 8E 03.

 

It's odd that some people reported problem with the weather using Cy Q's method. I've had no problems with the weather, that is to say, a particular weather pattern usually lasts several hours real time, but always changes eventually, which actually makes it more realistic. The reason I opted to use Cy Q's method instead of adding the script to my .scm was because I was not sure the script does the same thing. I would not want my weather to change every 15 real time minutes.

 

I am also wondering if editing the savegame would have any kind of impact on the missions. I am having problems triggering the Catalina missions using Craig's SA Opened Up mod. I've added other scripts to the .scm, which may be the culprit, but I am not sure if changing the game to progress in real time might cause the Catalina mission triggers to "break." Has anyone here had problems with that? This might turn out to be a rather ignorant question but I am just trying to narrow in on the cause of the problem I am experiencing.

The hex workshop I have doesnt have "line numbers"

 

and the first instance of "8E 03" is halfway though the savegame code.

 

I guess Ill just backup my copy of it, and spend all night testing different "8E 03's" cause I have about 20 of them in the savegame hex.

Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-3091714
Share on other sites

  • 2 weeks later...

I can't find offset 81h either! That is I'm not even sure what an offset is. I just realized that the first instance of "E8 03" which is across two groups hence the space between them, says in hex workshop: "offset: 129 [0x00000081]" <- I just noticed the 81!

 

This can't be a coincidence...I'll try changing it.

 

EDIT: I did it and the whole process at the end. I'm getting a "corrupt saved game" error in SA. I've tried twice... What could I be doing wrong, I have the calculator on scientific and on hex mode, w/ dword selected on the right.

 

EDIT 2: IT WORKED! I was reversing it wrong, ur just supposed to reverse the order of the bytes as groups so 01 i would make 10, but really you just have to put the groups backwords so 01 50 would have to be 50 01...as I noticed from his well given example. Thanks a lot cyq!

Edited by Flav_cool
Link to comment
https://gtaforums.com/topic/203446-real-time-clock/#findComment-3137825
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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.