Log in

View Full Version : Randomization in SH3 & hex offset?


LGN1
07-19-08, 05:08 AM
Hi,

I have recently started to use the malfunction feature of SH3 Commander and got confused about the rndmidpat parameter. In the 'Randomised events.cfg' file it is written

'Set RndMidPat to 1 if you want randomisation to occur mid-patrol, 0 if not'

Now I have found this old thread

http://www.subsim.com/radioroom/showthread.php?t=103262&highlight=random

where Hemisent writes

'The RndMidPat=1 means if you get a loaded file upon startup it is deemed "repairable" should you save/exit/relaunch. Commander will roll the dice again you may get nothing, you may get something else.
A RndMidPat=0 means that should you get a file, that "particular" malfunction is good for the duration of the patrol. NO matter when it is issued'

'A "0" file can be issued at any time commander launches, same as a "1" file.'

However, from my tests it seems that 'RndMidPat=0' malfunctions can only be obtained in port and will be repaired after the first save/restart. Then they will not show up again for the whole patrol. Thus, it seems that it is not possible to have damage that lasts the whole patrol (this makes sense because you would get the damage in all long patrols with many save/restarts). Can anyone with a deeper knowledge comment on that?

In addition, I have a practical problem. I am using a modified camera.dat file together with GWX2.1. It seems that the offset is different in this file from the GWX camera.dat and thus, the periscope malfunction does not work. In the 'Randomised events.cfg' file of GWX it is written

0_x2ECD=20 ;Attack Periscope Drops duration[4]
0_x2EE2=20 ;Attack Periscope Blur duration[3]
1_x2ECD=37
1_x2EE2=37
2_x2ECD=60
2_x2EE2=60
3_x2ECD=3600
3_x2EE2=3600

4_x2ECD=37
4_x2EE2=37
4_x2AFC=18 ;Obs Periscope Drops duration[4]
4_x2B11=18 ;Obs Periscope Blur durarion[3]

5_x2ECD=3600
5_x2EE2=3600
5_x2AFC=18
5_x2B11=18

6_x2ECD=20
6_x2EE2=20
6_x302F=1.5 ;Zoom
6_x304E=1.5 ;Zoom

7_x302F=1.5
7_x304E=1.5

8_x302F=6.0
8_x304E=6.0


How can I find out the red numbers for a modified file? I tried with S3D to locate the numbers in the orig. GWX file, but could not find them. I guess I need a hex editor. Any tips would be highly appreciated.

Thanks in advance,

cheers, LGN1

LGN1
07-19-08, 02:09 PM
I think I have solved the second problem :D . According to my present understanding people who use Sergbuto's free cam mod and malfunctions activated in SH3 Commander run the risk of getting a really severe malfunction, i.e., a CTD.

In order to fix this one has to make the following replacements at all places in the 'Randomised events.cfg' file (this can be found in the Cfg folder in the SH3 Commander folder)

0_x2ECD -----> 0_x35E7
0_x2EE2 -----> 0_x35FC
0_x2AFC -----> 0_x3216
0_x2B11 -----> 0_x322B
0_x302F -----> 0_x3749
0_x304E -----> 0_x3768

I would be happy if one of the Hex masters here could confirm this because my understanding of this is rather basic :oops: I have modified my 'Randomised events.cfg' file accordingly and everything seems to work now as expected.

Cheers, LGN1

Any comments on the Rndmidpat problem?

Edit: This problem is not GWX related. It is only related to Sergbuto's free cam mod and SH3 Commander's malfunction and sabotage.

Madox58
07-21-08, 07:37 PM
LGN1

I was gone all weekend so am just now seeing this.
Do you use Serg's mod as posted?
I could verify for you if so.
But you are correct in this.......
Any mod that changes Hex address can and will affect the SH3 Commander
files.
Depending on what the mod does?
The SH3 Commander files may be affected.
This is an area the modder himself should address, as so many use
SH3 Commander.

It's easy to modify things.
Just not so easy to see all possible combinations.

It's thanks to people like you that spot oversights,
and work towards a fix that we,
as a community,
keep moveing forwards!!

Regards Mate!!

LGN1
07-22-08, 01:40 PM
Hi privateer,

thanks for the kind words. Yes, I use Serg's camera.dat. I am pretty sure that the hex values are correct now, but a confirmation by a 'hex god' would be great.

I was really surprised that there were no earlier reports because I thought many people use the malfunctions and Serg's camera mod. On the other hands changes are not very high that you get the perisope malfunction and it is hard to reproduce without changing the Random...cfg file because of the random nature.

Anyway, it is amazing what one can learn from this game or better from modding. I started to learn how to use gimp in order to manipulate graphic files and now I have also started to use a hex editor to find things out.

Thanks again for your help,

cheers, LGN1

asanovic7
07-24-08, 07:23 AM
That might be a reason I don't use malfunctions, it annoys me to have a malfunction straight away from the harbour, it feels silly to me and for the second part maybe that is the reason I encoutered some wild periscope issues with malfunctions on.

Anyway, I don't and will not use it, but still.. Great to see all those little fixes to the game..
:up:
Cheers, lgn1!