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-02-07, 01:59 AM   #1
LZBTD
Seaman
 
Join Date: Mar 2007
Location: NORFOLK UK
Posts: 42
Downloads: 33
Uploads: 0
Default Creating Tweaker Files

Does anybody out there know where I can get information on CREATING Tweaker files. I found a post That enabled me to use existing files but not how to Create one. All relevant info greatfully recieved.
LZBTD is offline   Reply With Quote
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
Old 06-02-07, 06:22 AM   #3
LZBTD
Seaman
 
Join Date: Mar 2007
Location: NORFOLK UK
Posts: 42
Downloads: 33
Uploads: 0
Default Many Thanks !!

Vielen Dank Herr Kapitan Cox, this will get me started, will probably require some serious brain lubricant as I have'nt messed with MC for over 20 years. Again many thanks for your prompt reply.
LZBTD is offline   Reply With Quote
Old 06-02-07, 06:57 AM   #4
kaeldragor
Nub
 
Join Date: May 2007
Posts: 2
Downloads: 0
Uploads: 0
Maybe I'm missing something important here, but help an amateur modder out... if we have to do all the work of finding the value in a hex editor anyway... why not just edit the hex THEN? Is it simply so it can be found later for subsequent modding?

(ie. Why use the tweaker at all, if we have to do the searching and guessing ourselves?)
kaeldragor is offline   Reply With Quote
Old 06-02-07, 07:00 AM   #5
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Well not all ppl know how or have the time to learn to look for this stuff, but with the tweaker file anybody can change the values etc. And if you start changing the hex directly it will be alot of searching if and when one would like to undo stuff. But in theory, yes, one can change the hex directly.

To your 2nd comment. There is no program in the world that do anything by it self (maybe ufo technology :p) but there always some sad guy that have to program the software to maybe look like its doing it by it self
__________________
CaptainCox is offline   Reply With Quote
Old 06-02-07, 08:11 AM   #6
ReallyDedPoet
Canadian Wolf
 
ReallyDedPoet's Avatar
 
Join Date: Jul 2006
Location: The one and only East Coast
Posts: 10,776
Downloads: 946
Uploads: 5


Default

Interesting stuff lads

RDP
__________________

Back in the Day



ReallyDedPoet is offline   Reply With Quote
Old 06-02-07, 10:18 AM   #7
Canonicus
XO
 
Join Date: Mar 2007
Location: In your baffles...
Posts: 434
Downloads: 623
Uploads: 7
Default

Yes!...very interesting , indeed.
Really makes me appreciate all the effort that goes in to making a tweak file.

I say , Thanks!... to all who have the gray matter to do it!
Canonicus is offline   Reply With Quote
Old 06-10-07, 12:56 AM   #8
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by kaeldragor
Maybe I'm missing something important here, but help an amateur modder out... if we have to do all the work of finding the value in a hex editor anyway... why not just edit the hex THEN? Is it simply so it can be found later for subsequent modding?

(ie. Why use the tweaker at all, if we have to do the searching and guessing ourselves?)
like captain cox mentioned, yes it is a lot of work to do but look at how many tweak files are needed and you will understand how important sharing a solution can be. if one person did one tweak file then soon 50 people would have 50 tweak files for all to use.

thats how timetraveler ended up with his tweak files, many contributers added their hard work to his and it became the best tool a modder could ever have.

i will pm the moderator and ask this to be a sticky, it is a wonderfull guide to willing people who want to try making the tweak files we all need.

not that i wish to discourage anything but if captain cox is right about the file being version specific then any tweak file made now might need minor fix to work with the next update patch from ubi.
  Reply With Quote
Old 06-10-07, 05:58 AM   #9
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

EDIT:Fixed the missing pics.
We sometimes need to do this again as values might have changed due to tweaks in the patch, or the location of the code moved due to code added etc etc.
__________________

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


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 01:45 AM.


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