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-24-11, 03:27 PM   #1
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Well I thought I had a good idea

While playing a patrol in my current career I suddenly got the idea to see if I could expand the tooltip that comes up when you put the cursor over the sub image on the crew management screen, torpedo screen, etc. My idea was to add info on the sub so you could have it ingame. Like this:

USS Narwhal (SS-167)
Class: Narwhal
Commissioned: May 15th, 1930
Displacement: 2730 tons surfaced, 3960 tons submerged
Length: 371 feet
Beam: 33 feet 3.25 inches
Draft: 16 feet 11.25 inches
Maximum Speed: 17.4 knots surfaced, 8 knots submerged
Range: 9380 nm at 10 knots
Underwater Endurance: 10 hours at 5 knots
Test Depth: 300 feet

I found the files I needed to edit, and this morning I was trying to actually create a mod to add it, hence the Narwhal info above. But I ran into a few problems.

The first was that the entire info above types out in the message when you start a career. This wasn't a biggie as it's a simple matter of editing the relevant entry in the menu.txt (which I intended to include in the readme). I realized it would also do this when you got a medal, but again it's a simple editing fix for that too.

My real problem is that everything types out when you get your Operational Orders when starting a patrol, when you send a message, or get a message specifically for your boat. And I can't find the part in the menu.txt to turn off the sub name in these. The career start message and the medals use #SUBMARINENAME# for the sub, but those are the only instances when it appears. I assume it's one of the dozens of uses of %s or %(letter) scattered throughout the menu.txt, but which one where, I have no clue. And I'm assuming it's in menu.txt cause I looked through every other file it could've possibly been in.

So I'm hoping maybe someone with a bit more knowledge can help me out? Otherwise this is gonna end up being one those great ideas that just doesn't work.

Like the magnetic exploder.
fred8615 is offline   Reply With Quote
Old 06-25-11, 08:43 AM   #2
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

Fred, I'm not sure about just what your doing? But I applaud your efforts!

As a possible help, you may need to look in the "Menu_1024_768.ini" file, and see if there is a specific entry for the screens you are trying to change (the sub image for the "options" or "torpedo" screens). Drill down through the menu_1024_768.ini file to see if you can find the correct category, then go over the category to see if you can find the same reference of the "menu.txt" that relates to the text number you changed.

I'm thinking there is a reference to this same tooltip for the other screens you mentioned. What I'm thinking is you could change the reference number to something else (just make up a number that isn't being used by any other text) and use that number for the specific text you want, in the specific screen(s) you want it to appear.

Sorry, not to be any more help, I'm away from the game computer. But, I'm thinking this could be the angle you need to change just the screen you want, leaving the others alone. If your wanting to get into modding the "1024_768.ini" file is something you need to have some knowledge about. Here's a good starting place "The deconstruction of the Menu_1024_768.ini file", this tutorial by zAmboni will help with a lot of what the menu_1024_768.ini file does and how it does it. It won't help in finding just the section your looking for, but I'm guessing it's there. You just need to find it in the correct section.
__________________


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 06-27-11, 03:12 PM   #3
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

Okay, let me try to be a little clearer.

This is what I'm trying to do:



But it also does this:



And this:



And this:



I've actually figured out how to fix the last two. For the Status Report, it's this line in the menu.txt:

4171=%s. Position %s

As you can see, it uses the same variable for two different pieces of information. The way it uses them is sequential. If you delete just the first %s then all the sub info will print after "Position." But if I blank the line entirely, the other info will print just fine cause it uses a different variable.

The reply you receive is a bit trickier. It's this line:

4192=From: %s|To: %s|%s

Again, same variable, multiple uses. In this case, the last %s is the message body. So if I blank that line, while you will get the white message card pop up, there WON'T be a copy in the messages clipboard in case you want/need to review it again later. While it's not a problem for me personally, it might be for everyone else.

The real problem is the Operational Orders message. I've been through the menu.txt so many times I can practically recite it from memory! But I can't figure out yet which line to edit to stop it printing out all that info. If it would just print the orders, that would be fine. But as it is now, I wouldn't even use this mod for my strictly personal use, let alone release it.

So, that's where things stand. I'll probably keep playing at it to see if I can eventually get it to work. Maybe since I've illustrated exactly what I'm trying to do, someone out there can help or advise. Even if it's "Forget it. It can't be done." At least then I wouldn't waste any more time.
fred8615 is offline   Reply With Quote
Old 06-27-11, 11:02 PM   #4
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

I see where the tooltip your trying to use makes several unwanted entries. Yep, not good.

I can also see by the image of the sub you're using at the top of the Crew Management screen, that it isn't stock. I'm assuming you created it. Have you thought of creating the image with the text (as you list it) both together in a .dds image? This way the game only needs to find the specific image of the sub that's being used, with the subs characteristics listed along with the image. It may not be as sophisticated as having the tooltip appear and disappear when you mouse over the image but it would still give you the information your looking for along with the subs image.

On another note, I created a tooltip for the deck gun station (really its below the ammunition along the right hand side of the screen) for the Optical Targeting Correction mod. I don't have time to go over how I added the tooltip tonight but let me work on it tomorrow. I can show you what entries I made/changed in the menu_1024_768.ini file that makes it work. I'm still thinking there is a way of either changing the tooltip reference for the Crew Management screen in both the menu_1024 file and the menu.txt file, or at least create a new tooltip giving the information you want. The only problem I can see with creating a different/new tooltip is how would the game choose the correct information to be displayed with the different subs that could be used in the game. If you know how this works (in the menu.txt file?) then we may have something.
__________________


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 06-28-11, 08:10 AM   #5
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

Quote:
Originally Posted by CapnScurvy View Post
I see where the tooltip your trying to use makes several unwanted entries. Yep, not good.

I can also see by the image of the sub you're using at the top of the Crew Management screen, that it isn't stock. I'm assuming you created it.
It's from the Subsim Narwhal mod. This was the first version I was trying to create.

Quote:
Have you thought of creating the image with the text (as you list it) both together in a .dds image? This way the game only needs to find the specific image of the sub that's being used, with the subs characteristics listed along with the image. It may not be as sophisticated as having the tooltip appear and disappear when you mouse over the image but it would still give you the information your looking for along with the subs image.
Hadn't thought of that, but I don't think it would work anyway for several reasons. First and foremost is that I don't have a dds editor to create a proper image the game can use. The other issue is positioning so it doesn't cover something you need to access on another screen. Because the same image would be used on them, unless say just the sub systems screen could be set to use just that image. That might work, and would make some sense for that type of info.

Quote:
On another note, I created a tooltip for the deck gun station (really its below the ammunition along the right hand side of the screen) for the Optical Targeting Correction mod. I don't have time to go over how I added the tooltip tonight but let me work on it tomorrow. I can show you what entries I made/changed in the menu_1024_768.ini file that makes it work. I'm still thinking there is a way of either changing the tooltip reference for the Crew Management screen in both the menu_1024 file and the menu.txt file, or at least create a new tooltip giving the information you want. The only problem I can see with creating a different/new tooltip is how would the game choose the correct information to be displayed with the different subs that could be used in the game. If you know how this works (in the menu.txt file?) then we may have something.
The image is in the "Data\Menu\Data\SubmarineClasses" folder, and is called in the NSS_(subname).upc file, not the menu_1024_768.ini. That's how it does it for each class. So I don't think that editing the menu_1024_768.ini will work in this case.

But if I can just add the text over the sub image already in use, without changing any of the dimensions, I think that might work. It's just a question of saving the image in the proper format so the game can use it. I'll see what I can do with the programs I have now, to see if they'll work, or I need something special.

Thanks for the idea.
fred8615 is offline   Reply With Quote
Old 06-28-11, 03:24 PM   #6
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

I got it!!! I got it!!! I got it!!




I had to end up downloading GIMP and the DDS plugin for it, and it wouldn't save except as a single layer file, but that doesn't seem to be hurting anything. I even found a freeware version of the font the game uses so the text would match.

The only problem now is that if you use a screen height below 960 the message box writes over the sub info, which will make the message box text hard to read. So if I make a mod out of this, I'll have to make a note about that in the readme.

It isn't exactly what I wanted, because the info is visible all the time. But it's better than nothing, and doesn't require any additional editing beyond the image file.

So what say you all? Want this as a mod, or am I just doing this for myself?

fred8615 is offline   Reply With Quote
Old 06-28-11, 06:02 PM   #7
TorpX
Silent Hunter
 
Join Date: Sep 2010
Posts: 3,975
Downloads: 153
Uploads: 11
Default

I like it.

But wouldn't it be better if the text was in the upper right corner?

Also please put back the commisioning date, that was a nice touch.


TorpX is offline   Reply With Quote
Old 06-29-11, 08:14 AM   #8
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

Quote:
Originally Posted by TorpX View Post
I like it.

But wouldn't it be better if the text was in the upper right corner?

Also please put back the commisioning date, that was a nice touch.


It cuts off the text if you put it too close to the edge of the image. That's why it's not all the way to the edge of the stern. I figured the stern was better than the front, and definitely better than centered, where it would cover up the conning tower.

As for the commission date, because the same image is used for all the subs in a class, I can't put the commission date for any individual sub. Only the class info.

Now I could put the commission date back in the tooltip. That's for each individual sub. But that would have the same problem as before, printing out in the messages too. It wouldn't be as bad as writing out ALL the info like before, but some might find it annoying.

What do ya'll think?

EDIT: It occurred to me after posting my reply, you might think the text is a separate image superimposed on the sub image. It's actually the sub image with the text added to it. An image or maybe even a box with the info in it probably could be made and positioned in that area of the subsystems screen. But it would require editing of the menu_1024_768.ini file beyond my capabilities. And of course would also conflict with any other mod that changes the menu_1024_768.ini file. If anyone else wants to try it that way though, be my guest.

Last edited by fred8615; 06-29-11 at 08:34 AM.
fred8615 is offline   Reply With Quote
Old 06-29-11, 12:42 PM   #9
TorpX
Silent Hunter
 
Join Date: Sep 2010
Posts: 3,975
Downloads: 153
Uploads: 11
Default

Quote:
As for the commission date, because the same image is used for all the subs in a class, I can't put the commission date for any individual sub. Only the class info.

Right, I should have realised that.
TorpX is offline   Reply With Quote
Old 06-29-11, 02:11 PM   #10
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

Well, it looks like using the sub image method isn't going to work either.

The problem now is the game uses the same image for two different classes, and it does this twice.

The S-18 and S-42 both use one of the five S-class images, apparently depending upon the paint scheme and conning tower configuration. The Sargo uses the same three images as the Salmon class.

I tried putting the S-42 info in one of the images, then edited the NSS_S42.upc file here:

MenuSilhouetteTextureName= S_Class_02b.tga

...to open it instead of the image listed. I used the 02b image for the S-42 info, the 01b image (the default) for the S-18 info. But when I tested it, it used the S-18 image for the S-42. Obviously this isn't the file that needs editing.

So I have no idea what to do next. While it works fine for the other classes, I don't want to have some with info and some without. And since there were some significant differences, I don't want to use one class and not the other. If it can't be done right, there's no point in doing it.
fred8615 is offline   Reply With Quote
Old 06-29-11, 03:39 PM   #11
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
One of these days, I'm going to learn not to get p.o.ed and post until I thoroughly check things out. In other words...

I found it!!!

It's the UnitParts4SClass.upc in UPCData\UPCUnitsData. Specifically this line:

MenuSilhouetteTextureNameOverride= S_Class_01b.tga

The file changes further down when the conning tower changes. Only problem is, both S classes use the same
UnitParts file. I think I can solve that problem by copying the original UnitParts, renaming it to S42Class, copying and renaming the images, then changing the calls for them in the new file and the NSS_.upc file. My only question is, how to make sure the game uses the new UnitParts file? Will it read it automatically, or is there another file I need to edit?

EDIT: I found out. It reads the new file automatically.

It'll be a bit easier for the Sargo because it already has its own UnitParts file. I'll just need to copy and rename the images, then change the calls.

This project is turning out to be a lot more work, and aggravation, than I thought it would be. But I'm going to finish it now, even if it kills me!!

And if I run into one more snag, it just might!


Last edited by fred8615; 06-29-11 at 04:33 PM.
fred8615 is offline   Reply With Quote
Old 06-29-11, 04:55 PM   #12
magic452
Sea Lord
 
Join Date: Sep 2007
Location: Reno Nevada USA
Posts: 1,860
Downloads: 85
Uploads: 0
Default

Quote:
Originally Posted by fred8615 View Post
This project is turning out to be a lot more work, and aggravation, than I thought it would be.
Don't they all

Hope you get it working, looks good to me. Some handy info there.

Magic
__________________

Reported lost 11 Feb. 1942
Signature by depthtok33l
magic452 is offline   Reply With Quote
Old 06-30-11, 09:11 AM   #13
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

Hi Fred, been gone for longer than I expected (you "make hay when it sunshines", lately its wheat and making straw!).

Looks like you're doing OK with the project. I do have a couple of other ideas.

The menu_1024_768.ini file creates the 2D screens within the game. Some screens like the Sonar or Radar stations are made from the 3D models found in the correct .dat files, but the crew management screen is made up through the menu_1024_768.ini file. Some screens have a mixture of both 3D elements and 2D images that require different processes. I pointed out that I put a tooltip on the Deck Gun screens and the following is what it looks like.




Just a small tooltip that explains what the figures at the ammunition selection area mean. For this to appear you need to "link" the information to an existing item in the menu_1024 file. The menu_1024 file has three categories for the deck guns used in the game. Main gun found in the section G38, The 37mm found in the G39, and the 20mm found in the G3A section.

Since the picture above is of the 20mm station the following is the first 3 entries in that section.

[G3A I1]
Name=Page 20mm gun
Type=1027;Menu page
ItemID=0x3A000000
ParentID=0x0
Pos=0,0,1024,768
Zone= 0 768 1024 768 2 1 0x0 0.5 -0.5 0x3A000000 -0.5 0.5 0 0
LoadingMode=2

[G3A I2]
Name=Shells
Type=1026;Menu group
ItemID=0x3A010000
ParentID=0x3A000000
Pos=814,-284,120,200
Zone= 814 484 120 200 0 1 0x3A000000 1 -0.5 0x3A010000 -1.75 0.5 0 0
Color=0xFFFFFFFF

[G3A I3]
Name=GunText
Type=1031;Static bmp
ItemID=0x3A010007
ParentID=0x3A010000
Pos=2,-149,120,16
Zone= 882 335 120 16 0 1 0x3A010002 0.5 -1 0x3A010007 -0.5 0 0 -20
BmpState=1
ToolTipText=2215


This colored "Item3" entry was added to the section to create the tooltip. The actual wording of the tooltip is done in the menu.txt file at the #2215 entry.

A couple of things that you should do when you make an entry like this. First, you need to know what ItemID number is available for you to use. The entry needs to have an ID that is different from any others. I found that the 0x3A010006 was the last ID used so, 0x3A010007 became the ID for this item entry.

When you make an item ID I found you'll get a CTD when you place it out of sequence when compared to the lower numbered items. It seems the file is read from the bottom up, not the top down, so the higher numbered ID's need to appear "above" the lower ones. From a modding point of view this creates a bit of a problem in that the new entry needs to be placed towards the top of the section and the remaining section item numbers (G3A I4, to the end) need to be changed to keep everything in sequence. Luckily these sections don't have too many entries (some have several hundred).

The ParentID is critical, it's what the entry is linked or related to. In this case the Parent is the "Shells" entry just above in the I2 entry. You need the tooltip to be linked to an item that forms a "Menu Group", the item 0x3A010000 does this.

The Position and Zone lines tell the tooltip where to be positioned on the page (follow the tutorial by zAmboni).

The BmpState=1 sets-up the tooltip to have the ability to have the mouse "captured" when you move over the particular area that the zone line defines. This allows the tooltip to be "seen" when you mouse over the spot. So does the reference of the "Type=1031;Static bmp". This Type=1031 tells the game that the image can trap the mouse, where a Type=1030 does not. Stuff that mean the difference between getting things to work or not.

I spent some time trying different things with the Crew Management screen found in the menu_1024_768.ini file in the [G61] section. Unlike the Deck Gun sections, there wasn't much to work with. I found the entry for placement of the sub image found below. Notice the reference to the Gato image. Apparently the game code changes the image to the correct sub picture found in this folder.

[G61 I15]
Name=Submarine
Type=1030;Static bmp
ItemID=0x61000001
ParentID=0x61000000
Pos=276,-36,694,120
Zone= 276 732 694 120 1 1 0x6100000E 0.5 -0.125 0x61000001 -0.5 0.5 0 0
Materials=1
Display=2;Linear
Mat 0=data/menu/data/submarineclasses/gato_class_01.tga
Crop 0=0.0976563,0.195313,0.847656,0.585938
MatFlags=0x9
TexFmt=0x0

This same entry appears in the other sections of the Weapons & Sensors, Sub Systems, and the Torpedo sections as well. Differently placed through the Zone Line parameters.

Since the image already has a static text of the subs name appear when you mouse over it (as you know) but this ability does not exist in the menu_1024 file!?! It's apparently hard coded as well. So I couldn't change anything since there was nothing to change!!

I did however find the entry for the top left area of the Crew Management screen that names the sub and it's sub class.

[G61 I75]
Name=Left Top Panel
Type=1031;Stat bmp array
ItemID=0x6100001A
ParentID=0x61000000
Pos=0,1,232,84
Zone= 0 769 232 84 2 1 0x6100000F 0.5 0 0x6100001A -0.5 1 0 -10
Materials=1
Display=2;Linear
Mat 0=data/menu/skins/american/gui/layout/crewleft.dds
Crop 0=0,0.699219,0.90625,0.0820313
MatFlags=0x9
TexFmt=0x0
Drag=false
BmpState=1
NeedFocus=true
SelOne=false
IdGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
ToolTipText=7635

By adding the Tooltip with the referenced text in the menu.txt file for the added 7635 item, this is what you get.....





The tooltip appears when you mouse over the top left area. Pay no attention to the rest of the screen, I simply just used one of my Optical Targeting Corrections mods to try a couple of things.

It seems by adding the tooltip entry to this item you can have what you're looking for on the Crew Management screen without messing up other screens in the process.

As I said, it looks like your trying some other things. So, here's something else to look at.
__________________


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 06-30-11, 01:04 PM   #14
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,320
Downloads: 265
Uploads: 127
Default

Thanks for the info. But how would you do something like that for the different sub classes? Seems like it would be a LOT more work than changing the image. And while I can edit the heck out of the menu.txt, my menu_1024_768.ini skills leave a lot to be desired.

Finally, I'm not too crazy about this way of doing it because there are already so many other mods out there that change the menu_1024_768.ini. My way may not be the best, but you won't have to jump through hoops to install it.

Thanks again though.
fred8615 is offline   Reply With Quote
Old 07-01-11, 08:22 AM   #15
CapnScurvy
Admiral
 
CapnScurvy's Avatar
 
Join Date: Apr 2005
Location: Dayton, Ohio
Posts: 2,292
Downloads: 474
Uploads: 64


Default

Quote:
how would you do something like that for the different sub classes?
I thought that's what the menu.txt entries did for you?

Quote:
4171=%s. Position %s
or the

Quote:
#SUBMARINENAME#
Just curious?
__________________


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
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 05:07 PM.


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.