View Single Post
Old 06-02-07, 04:13 AM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

1.You need a hexeditor to look at the stuff
2.Windows/XP/VISTA Notepad
3.You need a lot of patience and coffee!

There is a small tut in the top of the tweak files from timetraveller.

Quote:
Examples of search lines, used when searching for a variable:
// search,WindCoef,4,single,>2,Wind Coefficient
// Description: Look for 4th occurrence of the term WindCoef.
// The floating point single variable starts at 2 bytes past the end of the
// search term. Name the list item Wind Coefficient.
// search,WindCoef,2,single,+9,Wind Coefficient
// Description: Look for 2nd occurrence of the term WindCoef.
// The floating point single variable starts at 9 bytes past the first byte
// of the search term (the same as using >2 above).
// Name the list item Wind Coefficient.
// search,WindCoef,1,single,-4,Wind Coefficient
// Description: Look for 1st occurrence of the term WindCoef.
// The floating point single variable starts at 4 bytes before the first byte
// of the search term. Name the list item Wind Coefficient.

Lets say i want to tweak the crash depth of a sub.

Where could this data be?, this is where you have to use a bit of imagination and logic (logic sometimes don't work, but its good to have )

It should be something with subs so lets look in the sub files for it.
C:\Program Files\Ubisoft\Silent Hunter 4 Wolves of the Pacific\Data\Submarine\NSS_Gato

Ok there are a lot of stuff there, but normally it should be in the .sim .dat .zon etc, we have to look plain and simple (here also the tweak files already made by various ppl will give you clues as to where these are)

Lets check the NSS_Gato.zon using a hex editor. I am using the search function in the hexeditor and do a search for "crash"


WOW! we found it directly :p

Ok what does this tell us


Well it tells us that we a have a "SINGLE FLOAT VALUE of 190 AT THE 2ND BYTE PAST!!!! the SEARCH TERM, in this case "CrashDepth" ( I think the high value here is due to a mod I am using, no matter)

Ok so how does one put this info in to a tweak file.


1. You have to specify the version of the game
In this case 1.2
Quote:
Version=1.2
2. You have to specify the "PATH" in the document
in this Case it would be
Quote:
Path=data\Submarine\NSS_Gato\NSS_Gato.zon
If you check existing tweak files you will see similar paths (just for reference) this path tells the MiniTweaker what .dat .sim etc etc to modify. In this case "Gato.zon"

3. We have to specify in the tweak file what line of code we want to change (elementary) So we wanted to change the "Crush Depth".
So lets start.

3.1 We will have to put in a drop down name, this is the name of the group or part that will appear when we start the Minitweaker, this can contain as many groups as you like but as we only have one "Crush depth" we will settle with that for now.

So in this case we put
Quote:
[1]
DropDownName=CRASH DEAPTH
The [1] is the 1st group, again elementary.

3.2 Lets put in the search string to get the " Crash depth"
Quote:
search,CrashDepth,1,single,>2,CRASH DEAPTH
Now what is all this. Well again pretty elementary if you start to understand each element. Lets look at each one.

Quote:
search
tells the code to search for xxxx
Quote:
CrashDepth
Specifying the search to CrashDeapth
Quote:
1
This means the FIRST instance of the search word in the file
If there are more instances we make another search line and put 2 in that case etc etc
Quote:
single
floating point single variable ( if its a byte or a integer we put that, this you can see in the hexeditor, this is also where the imagination bit comes in to play. Sometimes you have to really strain your eyes to find the right one, trial and error is sometimes needed )
Quote:
>2
Past 2 bytes past the end of the search word
Quote:
CRASH DEAPTH
This will be shown in the minitweaker as an identifier as to what we are tweaking

So the code looks like this (including all of above)
Quote:
Version=1.2
Path=data\Submarine\NSS_Gato\NSS_Gato.zon
[1]
DropDownName=CRASH DEAPTH
search,CrashDepth,1,single,>2,CRASH DEAPTH
Ok lets save this and check it out. (save as "NSS_Gato_zon.txt")



Now look at that its 190!!!!! we are ready to set it to 1000 if we want

Hope this will help you a bit.
__________________

Last edited by CaptainCox; 06-10-07 at 06:19 AM.
CaptainCox is offline   Reply With Quote