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-08-07, 02:05 AM   #1
Go4It
Engineer
 
Join Date: Apr 2007
Location: South of Buffalo N.Y. USA
Posts: 209
Downloads: 0
Uploads: 0
Default [REQ] SH4 Map Tools size

A mod was made to change the map tools back to SH3 look, but I like the SH4 tool but there too big! Has anyone thought of making the SH4 map tools 75% or 60% of there current size an moving the Map Tool Helper a little down? I'd try it but can't seem to figure out how they scale things.
Changed compass to map tool helper, My Mistake!

Last edited by Go4It; 04-08-07 at 01:36 PM.
Go4It is offline   Reply With Quote
Old 04-08-07, 02:43 AM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Look in the "menu_1024_768" and look at the actual graphics in
Menu/Gui/Laout "NavigationTools.dds"

to simply resize will not work as you will "displace" the graphics, you also have to work out the new "position" in the "menu_1024_768"

its similar to what some guys already have done to the "Clock"


Example of what you are looking for.


[G31 I18]
Name=Compass
Type=1032;Button
ItemID=0x31010004
ParentID=0x31010000
Pos=110,-90,90,210 (This for sure you will have to tweak "110,-90" are the position on the screen "90,210" are the size measured on the actual bump-map or .DDS, all in PIXELS of course)
Zone= 110 230 90 210 0 1 0x31010000 0.5 -1 0x31010004 -1 1 0 0 (This one is still a mystery to me, trying a lot with this one to make that movable pacific map, but so far nada)
Materials=4
Display=0;No stretch
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.726563,0,0.015625,0.015625
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.726563,0,0.015625,0.015625
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.726563,0.432617,0.015625,0.015625
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.726563,0,0.015625,0.015625
MatFlags=0x9
TexFmt=0x0
Font=1
Text=0
TextFlags=0x0
StatesColors=0xB0B0B0FF, 0xFF, 0xFFFFFFFF, 0xFFFFFFFF
ToolTipText=2250
__________________

Last edited by CaptainCox; 04-08-07 at 03:04 AM.
CaptainCox is offline   Reply With Quote
Old 04-08-07, 01:52 PM   #3
Go4It
Engineer
 
Join Date: Apr 2007
Location: South of Buffalo N.Y. USA
Posts: 209
Downloads: 0
Uploads: 0
Default

Thanks 4 the reply
Looking at it I see these need changing in menu_1024_768.ini
All have referance to the NavigationTools.tga ?

[G31 I16]
Name=Tool Helper

[G31 I17]
Name=Pen-Marker

[G31 I18]
Name=Compass

[G31 I19]
Name=Zoom

[G31 I20]
Name=Eraser

[G31 I21]
Name=Protractor

[G31 I22]
Name=Ruler
Wonder WHY? they use tga intead of dds? an if changing the extention to dds would make a difference? or even work?
Go4It is offline   Reply With Quote
Old 04-08-07, 02:22 PM   #4
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Yea, its like that in a lot of instances...don't matter if its dds or tga Ive noticed. The trick really is the scale here...I might give it a go...but after trying to add the "CrashDive" to that black box that shows up in case of a threat... I am pretty tired of looking at code at the mo...but never say never Need a coffee and a couple of fags and off we go.
__________________
CaptainCox is offline   Reply With Quote
Old 04-08-07, 04:47 PM   #5
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

I haven't fired up SH4 in a week or so, But I do think I have a decent understanding on the "Zone" line, and I could take a look at modding the newer tools (moving them around, resizing them)....I'll let ya know what I find out.
  Reply With Quote
Old 04-08-07, 04:53 PM   #6
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Cheers man, if you get it right would you mind posting what exactly each bit does in the "Zone" please.
I am not 100% but is this
"Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.726563,0,0.015625,0.0156252"
related to the area or the actual size of the bitmap or DDS?
__________________
CaptainCox is offline   Reply With Quote
Old 04-08-07, 06:03 PM   #7
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by CaptainCox
Cheers man, if you get it right would you mind posting what exactly each bit does in the "Zone" please.
I am not 100% but is this
"Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.726563,0,0.015625,0.0156252"
related to the area or the actual size of the bitmap or DDS?
I think the Crop line is the same as it was in SH3.

it is related to the actual size of the bitmap/DDS dimensions.
The dimensions of the navigationtools.tga/dds = 1024x1024
The way I read that Crop 0 line is this:

initial x position = .726563x1024 = 744
initial y position = 0x1024 = 0

OK im confused, I have no clue what the 0.015625,0.015625 is for. I have a feeling that the width and height for the element is taken from either the Pos or Zone line.

Speculation:
size of the element is taken from the Pos line
scaling of the element can be tweaked using the third and forth lines of the Zone line

I will test this to find out in a second
  Reply With Quote
Old 04-08-07, 06:13 PM   #8
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Just finished a quick test...
The dimensions of the element (compass) is taken from the third and fourth numbers from the zone line. I think the Pos line does absolutely nothing and is just a holdover from SH3.
  Reply With Quote
Old 04-08-07, 08:00 PM   #9
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

OK....I think I have figured it out something at least

The meaning of the Zone line seems to be dependent on the value of the Display= line

In the example that CaptainCox gives (for the compass on the nav menu), it has Display=0;No Stretch. This means that the height and with that is included in the Zone line gives the width, height of the compass element, and it renders the third and fourth numbers of the Crop 0= line meaningless (i.e. 0.015625,0.0156252).

Now if you change the Display line to something like Display=2;Linear then things change. The third and fourth numbers of the Crop 0= line now becomes active. For it to display right you need to change those two numbers to 0.087890625,0.205078125....i.e. 90/1024,210/1024. (You would also need to change these two numbers in the other Crop x= lines).

But now the two numbers for the "height and width" in the Zone line can be used to scale this compass element. If you keep the 90 210 the same in the Zone line, then there would be no visible difference in the compass because it is a 1:1 ratio, but if you change the numbers in the Zone line to 45 105, then the compass will be half size (or you can double the size or whatever you want it to be. Basically the change now makes the dimensions of the element (defined in the Crop line) either stretch or shrink to fit the width/height determined in the Zone line.

BTW CaptianCox got your PM, I am going to mess around with the map stuff you are trying to implement to see if I can come up with something.
  Reply With Quote
Old 04-09-07, 12:41 AM   #10
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Thanks man, you did some hard work here. Will do some more work on this and try out your findings after some breakfast
__________________
CaptainCox is offline   Reply With Quote
Old 04-09-07, 02:08 AM   #11
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Could you take this part again
Quote:
For it to display right you need to change those two numbers to 0.087890625,0.205078125....i.e. 90/1024,210/1024. (You would also need to change these two numbers in the other Crop x= lines).
you change
Quote:
0.087890625,0.205078125
to
Quote:
90/1024,210/1024
? how would that line look?


Crop 0=90/1024,210/1024 ?

and what do they stand for 90/1024 = ?

Sorry for being thick here...but...

EDIT: OK i think i misread what you wrote, i will rephrase

Where do you get these values from
0.087890625,0.205078125
__________________
CaptainCox is offline   Reply With Quote
Old 04-09-07, 03:20 AM   #12
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

sorry for the confusion

If you change the display line to Display=2;Linear you would need to change the Crop line to:

Crop 0=0.726563,0,0.087890625,0.205078125

I got the numbers from just dividing the numbers...
0.087890625 = 90/1024
0.205078125 = 210/1024

It is kinda confusing to begin with....my explanation was not probably the greatest. It is hard to explain it without a graphical example to show.
  Reply With Quote
Old 04-09-07, 05:03 AM   #13
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

Cheers...:hmm: at least i have some more to go on here. Thanks!
__________________
CaptainCox is offline   Reply With Quote
Old 04-09-07, 08:22 AM   #14
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

OK been at this now for 2h or so...

I tried to simply work with 100%-50% as its fast and easy to calculate.
Worked with the "Eraser"

[G31 I20]
Name=Eraser
Type=1032;Button
ItemID=0x31010006
ParentID=0x31010000
Pos=8,20,28,50 (half size 56=28 and 100=50)
Zone= 8 340 28 50 0 1 0x31010000 0 -0.5 0x31010006 0.15 1.7 0 0
Materials=4
Display=2;Linear
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.9375,0,0.02734375,0.048828125 (divided 28/1024=0.02734375 and 50/1024=0,048828125)
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.9375,0,0.02734375,0.048828125
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.9375,0.432617,0.02734375,0.048828125
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.9375,0,0.02734375,0.048828125
MatFlags=0x9
TexFmt=0x0
Font=1
Text=0
TextFlags=0x0
StatesColors=0xB0B0B0FF, 0xFF, 0xFFFFFFFF, 0xFFFFFFFF
ToolTipText=2257

Looks like this


I also tried to half the size of the .dds and adjusted the calculation accordingly,

28/512 etc etc, with the same wierd result.

I also wonder what these are

Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.9375,0.432617,0.02734375,0.048828125

???

@zAmboni, did you actually get this to work or?
__________________

Last edited by CaptainCox; 04-09-07 at 08:35 AM.
CaptainCox is offline   Reply With Quote
Old 04-09-07, 03:38 PM   #15
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

CaptainCox,

OK....maybe more of an explanation is needed
The Cropx= line determines where and what portion of the associated navigationtools.tga file is used. What you need to do is use the FULL SIZE in pixels to correctly pick out the eraser from the navigationtools.tga file. That correct line (I believe) should read:

Crop 0=0.9375,0,0.0546875,0.09765625

Now you have the full sized eraser picked out, you need to squeeze it into the area defined....and that is what it looks like you did in the Zone= line. I think if you plug the numbers that I changed above you will get what you expected.

As for the other Cropx lines (Crop 1, Crop 2...), I am not sure exactly what all of them are for....Some lines have 4 of these lines, some have 8. This is what I think they stand for:


Crop 0= what is displayed without a mouseover
Crop 1= ???
Crop 2= what is displayed on a mouseover
Crop 3= ???
Crop 4 = what is displayed with a toggle active without a mouseover (i.e. the open map tool)
Crop 5= ???
Crop 6= what is displayed with a toggle button active on a mouseover
Crop 7= ???


  Reply With Quote
Reply


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 01:00 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.