SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 06-30-07, 04:43 PM   #1
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
[TUT] Converting Sh3 Tweaker Files Tut

TUTORIAL for Converting SH3 Tweak Files to SH4
Made By
CAPTAIN COX
ALL ORIGINAL WORK WAS DONE BY
TIMETRAVELLER!

Tools needed
- Hexeditor. Try XVI32. Get it here http://www.chmaas.handshake.de/
- Windows Notepad
- TIMETRAVELLER's SH3 TWEAKFILES. Get them here http://www.delraydepot.com/tt/TweakFiles.zip
- The Original SH3 FILE (TO COMPARE WITH)
- The Original SH4 FILE
- Patience and LOTS OF COFEE!



For this tutorial I am going to use the Tweakfile "$Splash_water.txt"
Made by TIMETRAVELLER for SH3

Also copy
C:\Program Files\Ubisoft\SilentHunterIII\data\Library\particles.dat
to your Desktop

And Copy
C:\Program Files\Ubisoft\Silent Hunter 4 Wolves of the Pacific\Data\Library\particles.dat to a NEW FOLDER ON THE DESKTOP! or you will overwrite the one from SH3

Now we got all the components to start.

Ok so lets start up that Hex-Editor.

If you are using "XVI32" go to "Tools" and tic "Data inspector"
Then go to "Tools/Options/Data inspector tick all the boxes there, short, integer...etc.

This is where the values are shown. The value of the address you are at that is. You will see later on

Also just to be sure go to "Tools/Options/Appearance
and tic "Show Grid Lines" and " Use Blank to Display Control Characters"

Ok now we are set i hope.

Go to "File/Open/particles.dat ( the SH3 one on your Desktop)
And you will see A LOT OF CODE...DON'T PANIC!
its all ok



Now what are we looking at here, well we have a sort of split screen, one window to the left (full of hex code, A4, 0D, 6D, etc etc) and another to the right (mq e 0 ') etc etc.

Left=HEXCODE
RIGHT=TEXT

Ok, we are ready to rock.

If you look at that "$Splash_water.txt" in your Notepad
you will see that the first line of code is
Quote:
[1]
DropDownName=ParticleGenerator
this is what will be a drop down menu in the Minitweaker.
The actual CODE starts at
Quote:
absolute,byte,110CB,IsDensityModifierActive


Now lets look for that using the Hexeditor.

In the Hexeditor you have a "SEARCH TOOL"
Looks like a MAGNIFYING GLASS
As we are searching for "Splash_water" we put that in as "Text string" and hit ok.

You should now be at "1103D"



If you look at that "Splash_Water.txt Tweak file( Tweak File)" the first code should be at "absolute,byte,110CB,IsDensityModifierActive"



lets look for that "ADRESS" "110CB"




As you can see its TWO BYTES AFTER THE WORD "IsDensityModifierActive" (count the BOXES or GRID)


So that is what we will do in the SH4 file as well. Count 2 BYTES (2 BOXES) and we will have our address.

Lets check it out shall we.

Load the SH4 Particle.dat (the one in the New Folder on your desktop...remember) in to the Hex_editor.File/Open/New folder/particles.dat

Do a search (Looks like a MAGNIFYING GLASS) for "Splash_water"
and you will end up at 1185A.




Now look for "IsDensityModifierActive" and count 2 bytes (two boxes) and you will end up at 118E8.




Now that is what we have to change the address to in the "$Splash_water.txt" tweak file
like this



Now do the rest as we did with the "IsDensityModifierActive"
Next is "EmissionArea" at address "110DD"

Load the SH3 Tweak File in to the HexEditor
and do a search for "Splash_water"

Look in the Right Window for "EmissionArea"
It's at 110DD (2 bytes after the word "EmissionArea"



So what do we do...?

We go to our SH4 file in the new folder and look where that is at...



look at that...its at 118FA. So we put that in our Tweakfile...etc etc.


I hope you get the drift here. Basically all SH3 tweaker files can be converted like this.


CREDITS TO TIMETRAVELLER!!!! for all the HARD WORK DOING THE
MINITWEAKER+ALL THE TWEAKER FILES!
__________________

Last edited by CaptainCox; 07-02-07 at 03:18 AM.
CaptainCox is offline   Reply With Quote
Old 06-30-07, 04:49 PM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

ADITIONAL!
As I did not cover the "DATA INSPECTOR" in the first post I will shortly do that now


As you can see we see a lot of values. If you compare to the "TWEAKFILE" you will see for example this
Quote:
absolute,byte,110CB,IsDensityModifierActive
Now that tells us that we are looking for the value in "BYTE" at "110CB"

So look at in the "DATA INSPECTOR" it tells us that the value of "110CB" is "1" In BYTE

That is the value that will show up in the MINITWEAKER later when you finish and run your newly ported TWEAKER FILE!
__________________

Last edited by CaptainCox; 06-30-07 at 05:05 PM.
CaptainCox is offline   Reply With Quote
Old 06-30-07, 05:40 PM   #3
ReallyDedPoet
Canadian Wolf
 
ReallyDedPoet's Avatar
 
Join Date: Jul 2006
Location: Canada. The one and only, East Coast
Posts: 10,886
Downloads: 946
Uploads: 5


Default

Nice information CC, thanks for taking the time to do this

RDP
__________________

Back in the Day



ReallyDedPoet is online   Reply With Quote
Old 07-01-07, 08:11 PM   #4
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

the numbers you say to use, dont match the file numbers i see in the pictures.
  Reply With Quote
Old 07-01-07, 11:44 PM   #5
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

???? Which one. They stack up to me. The addresses are shown in the LOWER LEFT CORNER in the Hex Editor. For Example the last picture in the first post is
Adr.hex:118FA
__________________
CaptainCox is offline   Reply With Quote
Old 07-02-07, 03:21 AM   #6
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Updated the graphics in the tut a to make it MORE CLEAR! I hope that helps you a bit.
__________________
CaptainCox is offline   Reply With Quote
Old 07-02-07, 11:04 AM   #7
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by CaptainCox
???? Which one. They stack up to me. The addresses are shown in the LOWER LEFT CORNER in the Hex Editor. For Example the last picture in the first post is
Adr.hex:118FA

ok, you originally left out the part where you have to click on the highlight hex box so it shows you the address at the bottom. i was only looking at the address in the left column so i was lost. thanks for fixing it.

i see said the blind man, i have been properly educated now and will begin converting files.

Last edited by Webster; 07-02-07 at 10:07 PM.
  Reply With Quote
Old 07-02-07, 11:38 AM   #8
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

No worries. i know from experience that this stuff can be like Greek when you start off. Once you get the hang of it but, its not that complicated...well it is, but less so...somehow :p
__________________
CaptainCox is offline   Reply With Quote
Old 07-02-07, 10:31 PM   #9
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

i would like to add a foot note about finding the text lines.

most files are easy to find because they are listing in order from top to bottom close together, but a few of the text lines you come accross will not, so searching by the hex address found in the left column and also the box at the bottom left of screen would be another way to find it in those cases.

when you do locate the right text line address for the sh3 tweak value then make sure you have the exact same sh4 text line by counting spaces and compare numbers in the data inspector before using those numbers in the new tweak file for sh4. it is easy to make a mistake when you don't have an accurate text line name to go by.

Last edited by Webster; 07-04-07 at 10:16 AM.
  Reply With Quote
Old 07-04-07, 10:17 AM   #10
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

bump
  Reply With Quote
Old 07-04-07, 11:31 AM   #11
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

A good way to be sure that you have the right address in the Tweakfile is actually not to use the address at all...he?

It is connected to what WEBSTER is saying in above post. If you have a word appear more then one time in a .dat we can use "SEARCH" instead of putting the exact address in the Tweakfile.

For example, lets say we have the word "Displacement" appear...lets say 2 times in a .dat/sim/zon.

We know all of them are 2 BYTES after the search word (In this case the word "Displacement")

Could look like in this example


So lets do the 1st "Displacement" for our Tweakfile code

Quote:
search,displacement,1,single,>2,displacementSurfaced
Notice the 1, its means, THE FIRST INSTANCE of the word "displacement"
>2 means, TWO BYTES AFTER THE SEARCH WORD!

Ok, lets put in out second "Displacement" search...I think you figured this already, but here goes

Quote:
search,displacement,2,single,>2,displacementSubmerged
Notice the 2, its means, THE SECOND INSTANCE of the word "displacement"

No address and this method might also work after a patch, as it will not search for a specific address location, but rather find the value specified by the search word...

Easy peasy


Most of this stuff I think should be Credited to Timetraveller, I am not 100% if more people contributed to this, I guess there was, but I only know of Time traveller and of course Nvdrifter doing some outstanding work on Tweakfiles.
__________________
CaptainCox is offline   Reply With Quote
Old 07-05-07, 06:00 AM   #12
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by CaptainCox
A good way to be sure that you have the right address in the Tweakfile is actually not to use the address at all...he?

It is connected to what WEBSTER is saying in above post. If you have a word appear more then one time in a .dat we can use "SEARCH" instead of putting the exact address in the Tweakfile.

For example, lets say we have the word "Displacement" appear...lets say 2 times in a .dat/sim/zon.

We know all of them are 2 BYTES after the search word (In this case the word "Displacement")

Could look like in this example


So lets do the 1st "Displacement" for our Tweakfile code

Quote:
search,displacement,1,single,>2,displacementSurfaced
Notice the 1, its means, THE FIRST INSTANCE of the word "displacement"
>2 means, TWO BYTES AFTER THE SEARCH WORD!

Ok, lets put in out second "Displacement" search...I think you figured this already, but here goes

Quote:
search,displacement,2,single,>2,displacementSubmerged
Notice the 2, its means, THE SECOND INSTANCE of the word "displacement"

No address and this method might also work after a patch, as it will not search for a specific address location, but rather find the value specified by the search word...

Easy peasy


Most of this stuff I think should be Credited to Timetraveller, I am not 100% if more people contributed to this, I guess there was, but I only know of Time traveller and of course Nvdrifter doing some outstanding work on Tweakfiles.
how do you do this when the location is in the middle of the word.

using the word displacement as your example, i found a few of my hex locations were found in the second m inside the word displacement when i was working on #burning_oil_smoke.

do you just list it so many bytes after whatever word it is after , even if it is inside of another word?

Last edited by Webster; 07-05-07 at 06:16 AM.
  Reply With Quote
Old 07-05-07, 07:06 AM   #13
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

That can not be. A value is never in a word. As that value would only show the HEX value for that letter. I think you have to look again to find the right one.
__________________
CaptainCox is offline   Reply With Quote
Old 07-05-07, 08:30 AM   #14
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by CaptainCox
That can not be. A value is never in a word. As that value would only show the HEX value for that letter. I think you have to look again to find the right one.
the data inspector showed simular number values like it was showing for the other tweak values, so i assumed it was ok. it is very strange since it appeared to be finding a value that was tweakable.

when i have more time i will go back through the files, mark the strange addys and pm them 2 u.

Last edited by Webster; 07-05-07 at 12:22 PM.
  Reply With Quote
Old 07-05-07, 01:19 PM   #15
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

No problem man. But I think I will not have time untill this weekend.
__________________
CaptainCox is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.