View Full Version : 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.
CaptainCox
06-02-07, 04:13 AM
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.
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"
http://img185.imageshack.us/img185/2347/crashqb7.jpg
WOW! we found it directly :p
Ok what does this tell us
http://img295.imageshack.us/img295/5938/crashdepthgg4.jpg
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
Version=1.2
2. You have to specify the "PATH" in the document
in this Case it would be
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
[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"
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.
searchtells the code to search for xxxx
CrashDepthSpecifying the search to CrashDeapth
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
singlefloating 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 ;) )
>2 Past 2 bytes past the end of the search word
CRASH DEAPTHThis 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)
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")
http://img177.imageshack.us/img177/5171/tweakpiczc6.jpg
Now look at that its 190!!!!! we are ready to set it to 1000 if we want :)
Hope this will help you a bit.
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.
kaeldragor
06-02-07, 06:57 AM
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?)
CaptainCox
06-02-07, 07:00 AM
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 ;)
ReallyDedPoet
06-02-07, 08:11 AM
Interesting stuff lads :roll:
RDP
Canonicus
06-02-07, 10:18 AM
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! :up:
Webster
06-10-07, 12:56 AM
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.
CaptainCox
06-10-07, 05:58 AM
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.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.