PDA

View Full Version : [TEC] How to make a tweak file


kakemann
04-29-07, 11:50 AM
I would like to make a tweakfile of the searchlight files in library directory.
It doesn't look like these files are in nvdrifter's great tweakfile package.

Anyone know how to make a tweakfile from a sim file? :hmm:

CaptainCox
04-29-07, 12:46 PM
Start by looking at the existing TweakFiles. I was doing this a lot yesterday as i tried to get the Zoom for the Scope thingy.

Example

// Game version for these changes.
Version=SH4 v1.2
// Path to the file we are changing.
Path=data\Library\USSubParts\Sensors_sub_US.sim

The Orange bit is important at the top of the document, this is so the program knows where to plug it in (as its an example you have to change to what ever you are doing...pretty clear sorry)


// Examples of search line, used when searching for a variable:
search,WindCoef,4,single,>2,Wind Coefficient
Description: Look for 4th occurrance 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 occurrance 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 occurrance 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.

This can be found in some of the tweak files as a sort of small tut and is pretty self explanatory.

As you see in the MiniTweaker there is different things you can search for

-Single
-Double
-Long
-Integer
-Byte

So depending what you see in in the hex editor (use the INSPECTOR! so much easier, its a function that you can activate from the menu, there you can see what type of value each address holds, what it is in Single, byte etc etc).


For example
search,draught,1,single,>2,draughtSurfaced

or
search,draught,1,byte,>2,draughtSurfaced

or
search,draught,1,integer,>2,draughtSurfaced

etc etc.

You have to look for the stuff in a hex editor, i use the one that comes with the pack from Nvdrifter
Once you start looking i think you will slowly understand what I am talking about. Took me a good 2-3h yesterday to sort a get the hang of it...still did not fix that zoom but :p

Look at the stuff from Nvdrifter, try to understand what each code line does, read the tut that comes with the MiniTweaker from timetraveler...

kakemann
04-29-07, 01:10 PM
Ok!

It seems quite complicated!

But I guess I'll give it a try!

Thanks a lot Captain Cox

CaptainCox
04-29-07, 01:25 PM
Looks like that the first 1-2 hours sort of.

The trick is really to look in the Hex Editor and actually finding the stuff. To write the script is not that tricky as you simply write what you found, or rather point the script to the location that holds the value you found.

What I found tedious is to try this stuff out as there can be many different locations that holds the value you are looking for, or at least look like it, untill you find it.

CapnScurvy
04-29-07, 02:02 PM
CaptainCox, I am new to modding and eventually planing to add a file mod to our list. The mod will change some .cfg files. I'm following a thread 110889 and it offers a sh4_ship.sim_tweak file that I gathered would need to be loaded. When I look to the SH4 root directories and bring up the .cfg files I want to change, and load the tweak file, I get an error for wrong path. Is it because I'm trying to access a .cfg file with a .sim file tweaker? How do I use the mini-tweaker? Do I need to at all, since the changes are to be made in .cfg files. Couldn't I just make my changes in notepad, save them to a rar file and have them on the internet for down load? Or am I not even close?

Another thing, if I am successful with producing a file, how do I go about having it user friendly with a mod enabler like JSGME?

CaptainCox
04-29-07, 02:28 PM
To edit .cgf you only need to look and modify stuff in the notepad, correct.
Do the stuff you want to modify and save the stuff in JSGME format, that way most ppl here will be able to just plug your mod in to the game with out the hassle of doing it manually.

CapnScurvy
04-29-07, 03:35 PM
Great , I think I can do this now! :rock:

One more question, how do I save it in the JSGME format? Is that in his down load somewhere or must I get it from somewhere else. I've been to his website and I don't see a file converter.

nvdrifter
04-29-07, 09:35 PM
Kakeman, the original SH3 Mini Tweaker searchlight.sim tweak file also works with the SH4 searchlight.sim game file. This file seems to be unchanged from SH3. So you don't have to create a new tweak file. :lol:

CaptainCox
04-29-07, 11:09 PM
Now you spoiled all the fun MAN! :p but thats a winner if I ever saw one ;)