Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

spaceeinstein

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

Share this post


Link to post
Share on other sites
Demarest
Gltiches: May interfere with timers in the game.

I don't think it will. And shouldn't it say "rewritten for SAMB" instead? tounge.gif

Share this post


Link to post
Share on other sites
Dogmeat

Damn I would love to use this but I just started playing SA with the opened up mod :<

In VC there was only sunny weather when using this mod, same problem here?

Could you release the main.scm file?

Share this post


Link to post
Share on other sites
Demarest
This is a script mod whereas Opened Up is a SCM mod. So you'd have to add this to that. If you got a compiled SCM of this mod, it would be the regular game with just this added.

Share this post


Link to post
Share on other sites
Dogmeat

Thanks... I got it working now... a great mod but there is a problem. The weather does not change... and it isn't even the sunny weather like in the VC version.

Edited by Dogmeat

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Dogmeat

Well how can I make it to be sunny weather because the default one puts your drawdistance to 0 and everything looks just blue and white confused.gif

 

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

Could it be this?

Share this post


Link to post
Share on other sites
Demarest
"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.

Share this post


Link to post
Share on other sites
Dogmeat

My skills on modding scm are almost zero... I can't figure out how to make it sunny. Could somebody just paste the line?

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites
Dogmeat

Hmm i'm getting some sort of error when I try to compile it.

 

"Memory beyond the defined range has been accessed. Use DEFINE MEMORY 43805 or higher to allocate enough memory."

Share this post


Link to post
Share on other sites
Demarest
"Memory beyond the defined range has been accessed. Use DEFINE MEMORY 43805 or higher to allocate enough memory."

Actually, it says to set it to that and recompile. So... set it to that and recompile tounge.gif

Share this post


Link to post
Share on other sites
Un3462

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!

Share this post


Link to post
Share on other sites
Dogmeat

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

Share this post


Link to post
Share on other sites
pekkapoika

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?

Share this post


Link to post
Share on other sites
Dogmeat

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.

Share this post


Link to post
Share on other sites
V41N
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?

Share this post


Link to post
Share on other sites
Un3462

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.

Share this post


Link to post
Share on other sites
Dogmeat

Thanks man! biggrin.gif Now it seems to work just fine.

 

---Edit: Blah the weather is still kinda foggy...---

Edited by Dogmeat

Share this post


Link to post
Share on other sites
spaceeinstein
If you want to change the waether, try speeding up the game clock with a cheat. I didn't try it yet but try it.

Share this post


Link to post
Share on other sites
pekkapoika

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

Share this post


Link to post
Share on other sites
ripple

Thanks CyQ.

 

P.S. I am sure Space will figure out how to deal with the weather eventually smile.gif

Edited by ripple

Share this post


Link to post
Share on other sites
spaceeinstein

---

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Bloodburn
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..

Share this post


Link to post
Share on other sites
KungFuJebus

I use the timesync tool to play my game in real time isnt it the same thing?

Share this post


Link to post
Share on other sites
Bloodburn

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.

 

 

Share this post


Link to post
Share on other sites
ripple

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.

Share this post


Link to post
Share on other sites
Bloodburn
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.

Share this post


Link to post
Share on other sites
Flav_cool

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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