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 04-29-07, 11:50 AM   #1
kakemann
Samurai Navy
 
Join Date: Feb 2007
Location: Pretty close to the big german cruiser Blücher in Norway
Posts: 568
Downloads: 29
Uploads: 0
Default [TEC] How to make a tweak file

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:
kakemann is offline   Reply With Quote
Old 04-29-07, 12:46 PM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

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

Quote:
// 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)


Quote:
// 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...
__________________
CaptainCox is offline   Reply With Quote
Old 04-29-07, 01:10 PM   #3
kakemann
Samurai Navy
 
Join Date: Feb 2007
Location: Pretty close to the big german cruiser Blücher in Norway
Posts: 568
Downloads: 29
Uploads: 0
Default

Ok!

It seems quite complicated!

But I guess I'll give it a try!

Thanks a lot Captain Cox
kakemann is offline   Reply With Quote
Old 04-29-07, 01:25 PM   #4
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

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.
__________________
CaptainCox is offline   Reply With Quote
Old 04-29-07, 02:02 PM   #5
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

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 https://www.subsim.com/radioroom/showthread.php?t=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?
__________________


The HMS Shannon vs. USS Chesapeake outside Boston Harbor June 1, 1813

USS Chesapeake Captain James Lawrence lay mortally wounded...
Quote:
.."tell the men to fire faster, fight 'till she sinks,..boys don't give up the ship!"
CapnScurvy is offline   Reply With Quote
Old 04-29-07, 02:28 PM   #6
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

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.
__________________
CaptainCox is offline   Reply With Quote
Old 04-29-07, 03:35 PM   #7
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

Great , I think I can do this now!

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.
__________________


The HMS Shannon vs. USS Chesapeake outside Boston Harbor June 1, 1813

USS Chesapeake Captain James Lawrence lay mortally wounded...
Quote:
.."tell the men to fire faster, fight 'till she sinks,..boys don't give up the ship!"
CapnScurvy is offline   Reply With Quote
Old 04-29-07, 09:35 PM   #8
nvdrifter
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

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.
  Reply With Quote
Old 04-29-07, 11:09 PM   #9
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Now you spoiled all the fun MAN! :p but thats a winner if I ever saw one
__________________
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 04:38 AM.


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.