![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
Hey gents, I've recently posted about promotions and how to unlock higher ranks. I've manged to get that figured out (as well as promotions for myself). The big question I now have is the basics of a dds file, more importantly how the game actually calls for certain files.
The dds file that generates the crew management screen (sh4/data/menu/gui/layout/crewsystemsmanagement.dds) contains everything that can be displayed on that screen. How does the game actually come to display a certain set of pixels from that dds file for say a LT, both his picture in the compartment (seaman, PO, CPO, or officer) and the picture of his rank symbol next to his name? Are there commands or a controlling file somewhere else buried in the folders that tells the game the exact location of the desired art on the picture? The crux of the issue is when I promote a LT his picture changes to that of a seaman, and the symbol of his rank is blank altogether. Anything over the rank of LT. produces the same result. Thanks in advance. I'll try to post a picture of the file converted to bitmap. http://www.subsim.com/radioroom/showthread.php?t=155007 This thread shows the upper left of the image contained in th dds file. Last edited by bigepilot; 09-08-09 at 05:44 PM. Reason: Link added |
![]() |
![]() |
![]() |
#2 | |
Admiral
![]() Join Date: Jan 2008
Location: New York State, USA
Posts: 2,390
Downloads: 126
Uploads: 7
|
![]() Quote:
The .dds file has an alpha channel (selection layer) and parts are "cut out" using coordinates on that .dds. For example the small medals, if the .dds file didn't have an alpha channel they would be squares not shaped like the medal. It also uses the Crewleft.dds and Crew page background.dds. for that same screen. Peabody
__________________
System Spec: Gigabyte GA-965P-DS3, PentiumD Dual Core Presler 945 3.4Ghz, Gigabyte Geforce 7600GS, 2-1GB Corsair XMS2 800Mhz in Dual Channel, 2-WD 250 SATA 3Gb/s, Onboard Realtek HD 7.1 Audio, DVD ROM, DVD burner, Hiper 580 Watt Power supply, WinXP SP2. |
|
![]() |
![]() |
![]() |
#3 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
Awesome answer peabody. Thanks. Now, any idea how to make it all work?
![]() |
![]() |
![]() |
![]() |
#4 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
I think I may be getting the jist of it all. From what I gather the "crop" value for something called "rank indicator" would be the file sizing the image around the desired bitmap. So if I placed an icon in there for a LT. Cmdr all i would have to do is space the cropping over the same distance as the previous ones in the horizontal axis and it would be go time? I just have to figure out the specific "call" for the ranks. Also, the files call for a crewsystemsmanagement.tga and not a dds. Does a dds convert at some point during gameplay?
UPDATE: Tried to insert a crop at the suspected location and it was a no go. Not sure what to do now. Last edited by bigepilot; 09-08-09 at 07:09 PM. |
![]() |
![]() |
![]() |
#5 |
The Old Man
![]() |
![]() ![]() Stop and think for a second. You have dragable items (the crew), that dynamically change depending on their rank and your actions (draging them from station to station). Now look around the menu_1024_768.ini file and search for any type of condition. Found any? Nope... Take a well known item such as the Fire and Lock buttons. I have yet to find any instances of those items id's in any file in the game. How do they work you ask? Through hard-coding locked in dll and act files which are out of your reach. With the exception of dials (only in the periscope, attack map and bottom bar), you can't make any item in SH4 that does anything but sit there and look preety. All of the items that do something are actually controlled by the game's engine code (unmoddable). There are also hundreds of invisible and unused items there, left over from sh3 (such as the entire old orders buttons, complete with image files). I suggest you PM lurker or someone in the RFB team. They have done amazing work within the crew page and they might explain better how to reuse existing crew compartments through the menu_1024_768.ini file. There are so few differences between the menu.ini file in SH4 and the one in SH3 that they didn't even bother to write "dds" as the extension for graphic files.For the game, either crewsystemsmanagement.dds or crewsystemsmanagement.tga are the same thing. The dds files are simple tga files, with absolutely no smart resolution scaling. Scaling is done by the Zone line of the items but I won't go into that here. The important thing is that you don't need to bother with the weird dds features, you can use tga files with any compression, with or without alpha channels. And now to answer your main problem. Unlike in SH3, the portraits in SH4 are generic, not specific. You can't have 2 officers of the same rank with different faces (as you did in sh3). You can photoshop the crewsystemsmanagement.dds file as much as you want, but do so in the current layout of the items inside it. You don't have ANY other choice. You can make them moustaches and weird hats, but not much else. The reason why the icons act weird on promotions is the game code. The RFB manual explains well the ranks and why some ranks are skipped (or simply put the "if" statements in the code only accept certain rank numbers when deciding which portrait to show). You also can't go beyond the maximum nuber of officers or petty officers. That's why you have that bug. And, at least through the menu_1024_768.ini file, you can't solve it in any way. |
![]() |
![]() |
![]() |
#6 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
I've gotten it to display the "doctored" picture (that I created from the dds and then converted back) of what a Lt. Cmdr's sleeve would look like (next to his name at the bottom of the crew management screen). I added an image that did not exist before. As long as you stay within the confines of the image it works. I could keep adding instances and go all the way to ADM if desired. It also displays when a LT. is promoted. So that part of the "bug" was just taking the time to find the coordinates.
As far as the draggable items go, they are still calling for specific instances on this dds image, which also change size when they go from inactive to on your ship, or from lead in the compartment to secondary, all of which are dynamic actions. I have found the x/y's for the images in the menu code. The only real problem now may be that "if" statement you speak of. Why the Lt. CMDR rank calls for image 1 i don't know. If you could offer help as to where to find that statement I would tend to think it would indeed be moddable. I just need to know where that "if" statement is located. Ideas? |
![]() |
![]() |
![]() |
#7 |
The Old Man
![]() |
![]()
Of course you can add new images, but they don't do anything. For example, try the simple task to create a working Fire Torpedo button in the Nav Map... The method for creating the image object is piss easy... But specific hardcoding prevents adding commands to items outside the layout order page (page G3F, and i think even that doesn't work anymore in sh4
![]() ![]() My simple point in this and previous post is that the menu_1024_768.ini file only specifies item positions and look. How they behave when clicked and what they do then is taken from other files (some of which are "locked"). So I repeat my advice of not messing with that file, but instead contacting the authors of mods that have already modded the crew page, such as RFB or OM. ![]() ![]() |
![]() |
![]() |
![]() |
#8 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
There is a crewrrank (not sure of the exact heading at the moment) section that started with 12 mat/crop elements which I changed to 15. I then added 3 images (Lt. Cmdr, Cmdr, and Capt.) to the right of the original rank images on the bottom of the crewsystemsmanagement.dds at the same spacing intervals and then added their values horizonatally to the added crop numbers. In-game the new sleeve images show on both the "unused" or "availible" crew side of the crew management page as well as when they are moved to your sub. Also, if i change the current experience of say a Lt. Cmdr to 25,000, and then promote him to Cmdr on the boat, the sleeve image will change upon promotion (I've set the promotion values for ranks over Lt. to "base"). I did, however, manage to crash the game last night with repeated promotions
![]() I have also found 4 instances for "samplecrew" in the menu file that I believe tie to the four rows of crew images (4 images per row) that have 4 mat/crops each. So, like you said the images are there and tie to specic calls...but changing those calls is the issue. Unless I've completely missed the boat ![]() |
![]() |
![]() |
![]() |
#9 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
Well, the game is failing to start at all now with the modded menu file. It all started when I promoted a CMDR to Captain. The instant I hit the button the game exited and poof, won't start back up. The odd thing is that it worked for quite some time before that happened. Guess it's back to using the backup for now...
|
![]() |
![]() |
![]() |
#10 |
Swabbie
![]() Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
|
![]()
Bit of an update. Got the game to run again, as well as run a while without crashing during promotions. I think they were calling for global abilities and the higher ranks over LT. were set to NULL. Seems to be working well now. So it's back to the original square one of the game not recognizing the higher ranks as officers.
|
![]() |
![]() |
![]() |
|
|