Quantcast

Jump to content

» «
Photo

Real Time Clock

51 replies to this topic
spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003
  • None

#1

Posted 15 July 2005 - 04:41 AM Edited by spaceeinstein, 22 July 2005 - 11:42 PM.

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.

CODE
004F: create_thread ££TimeMod

...

:TimeMod
0004: $weather = 6;; integer values
0006: @33 = 0;; integer values  - Reset internal timer

:TimeLoop
0001: wait 500 ms
00BF: @1 = current_time_hours, @2 = current_time_minutes
00C0: set_current_time @1 @2
01B5: force_weather $weather
00D6: if 0
0019:   @33 > 59999;; integer values  - if internal timer >= 1 minute
004D: jump_if_false ££TimeLoop
0006: @33 = 0;; integer values  - reset the internal timer
000A: @2 += 1;; integer values
00D6: if 0
0019:   @2 > 59;; integer values
004D: jump_if_false ££TimeModL2
0006: @2 = 0;; integer values
000A: @1 += 1;; integer values
00D6: if 0
0038:   $ON_MISSION == 0;; integer values
004D: jump_if_false ££TimeModL3
0008: $weather += 1;; integer values
00D6: if 0
0018:   $weather > 19;; integer values
004D: jump_if_false ££TimeModL3
0004: $weather = 0;; integer values

:TimeModL3
00D6: if 0
0019:   @1 > 23;; integer values
004D: jump_if_false ££TimeModL2
0006: @1 = 0;; integer values

:TimeModL2
00C0: set_current_time @1 @2
0002: jump ££TimeLoop

Gltiches: May interfere with timers in the game.

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#2

Posted 15 July 2005 - 05:24 AM

QUOTE (spaceeinstein @ Jul 14 2005, 23:41)
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

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#3

Posted 15 July 2005 - 06:27 AM

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?

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#4

Posted 15 July 2005 - 09:12 AM

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.

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#5

Posted 15 July 2005 - 09:37 AM Edited by Dogmeat, 15 July 2005 - 09:40 AM.

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.

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003
  • None

#6

Posted 15 July 2005 - 09:31 PM

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.

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#7

Posted 16 July 2005 - 06:20 AM

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?

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#8

Posted 16 July 2005 - 06:38 AM

QUOTE (Dogmeat @ Jul 16 2005, 01:20)
"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
CODE
0008: $weather += 0;; integer values
00D6: if 0
0018:   $weather > 6;; integer values
004D: jump_if_false ££TimeModL3
0004: $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.

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#9

Posted 16 July 2005 - 10:42 AM

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

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003
  • None

#10

Posted 16 July 2005 - 04:12 PM

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.
CODE
0008: $weather += 1 ;; integer values
00D6: if 0
0018:   $weather > 19 ;; integer values
004D: jump_if_false ££TimeModL3
0004: $weather = 0 ;; integer values

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#11

Posted 16 July 2005 - 05:40 PM

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."

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#12

Posted 16 July 2005 - 09:41 PM

QUOTE (Dogmeat @ Jul 16 2005, 12:40)
"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

Un3462
  • Un3462

    Mack Pimp

  • Members
  • Joined: 27 Jun 2002

#13

Posted 16 July 2005 - 10:22 PM

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!

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#14

Posted 17 July 2005 - 07:43 AM Edited by Dogmeat, 17 July 2005 - 07:50 AM.

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

pekkapoika
  • pekkapoika

    Crackhead

  • Members
  • Joined: 29 Sep 2004

#15

Posted 17 July 2005 - 08:02 PM

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?

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#16

Posted 18 July 2005 - 06:34 AM

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.

NDG474
  • NDG474

    VaiN

  • Members
  • Joined: 15 Jun 2005

#17

Posted 18 July 2005 - 06:46 AM

QUOTE (CyQ @ Jul 16 2005, 17:22)
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?

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#18

Posted 18 July 2005 - 06:50 AM

I was using this one
http://www.hhdsoftwa...r-standard.html

Un3462
  • Un3462

    Mack Pimp

  • Members
  • Joined: 27 Jun 2002

#19

Posted 18 July 2005 - 10:52 AM

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.

Dogmeat
  • Dogmeat

    Snitch

  • Members
  • Joined: 12 May 2005

#20

Posted 18 July 2005 - 01:38 PM Edited by Dogmeat, 18 July 2005 - 02:11 PM.

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

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

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003
  • None

#21

Posted 18 July 2005 - 02:33 PM

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.

pekkapoika
  • pekkapoika

    Crackhead

  • Members
  • Joined: 29 Sep 2004

#22

Posted 18 July 2005 - 02:52 PM

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

ripple
  • ripple

    Rat

  • Members
  • Joined: 13 Jun 2005

#23

Posted 22 July 2005 - 10:11 PM Edited by ripple, 23 July 2005 - 12:15 AM.

Thanks CyQ.

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

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003
  • None

#24

Posted 22 July 2005 - 10:50 PM Edited by spaceeinstein, 22 July 2005 - 10:55 PM.

---

Bloodburn
  • Bloodburn

    Player Hater

  • Members
  • Joined: 07 Aug 2005

#25

Posted 12 August 2005 - 09:57 PM

QUOTE (CyQ @ Jul 16 2005, 22:22)
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..

KungFuJebus
  • KungFuJebus

    Punk-ass Bitch

  • Members
  • Joined: 01 Aug 2005

#26

Posted 12 August 2005 - 10:04 PM

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

Bloodburn
  • Bloodburn

    Player Hater

  • Members
  • Joined: 07 Aug 2005

#27

Posted 12 August 2005 - 10:08 PM

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.


ripple
  • ripple

    Rat

  • Members
  • Joined: 13 Jun 2005

#28

Posted 13 August 2005 - 09:31 PM

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.

Bloodburn
  • Bloodburn

    Player Hater

  • Members
  • Joined: 07 Aug 2005

#29

Posted 13 August 2005 - 11:33 PM

QUOTE (ripple @ Aug 13 2005, 21:31)
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.

Flav_cool
  • Flav_cool

    Player Hater

  • Members
  • Joined: 21 Jun 2005

#30

Posted 27 August 2005 - 12:20 AM Edited by Flav_cool, 27 August 2005 - 12:46 AM.

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!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users