PDA

View Full Version : [REQ] SH4 Map Tools size


Go4It
04-08-07, 02:05 AM
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!

CaptainCox
04-08-07, 02:43 AM
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

Go4It
04-08-07, 01:52 PM
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?

CaptainCox
04-08-07, 02:22 PM
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.

zAmboni
04-08-07, 04:47 PM
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.

CaptainCox
04-08-07, 04:53 PM
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?

zAmboni
04-08-07, 06:03 PM
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 :)

zAmboni
04-08-07, 06:13 PM
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.

zAmboni
04-08-07, 08:00 PM
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.

CaptainCox
04-09-07, 12:41 AM
Thanks man, you did some hard work here. Will do some more work on this and try out your findings after some breakfast ;)

CaptainCox
04-09-07, 02:08 AM
Could you take this part again 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 0.087890625,0.205078125 to 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

zAmboni
04-09-07, 03:20 AM
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.

CaptainCox
04-09-07, 05:03 AM
Cheers...:hmm: at least i have some more to go on here. Thanks!

CaptainCox
04-09-07, 08:22 AM
OK been at this now for 2h or so...:stare:

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
http://i10.photobucket.com/albums/a138/CaptainCox/1212121.jpg

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

??? :o

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

zAmboni
04-09-07, 03:38 PM
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= ???

CaptainCox
04-09-07, 03:45 PM
AAHHHHHH! cheers man! I think i got it...but off to bed :( But I will give this good thrashing in the morn after work.

Its not that this is an important mod, its that it helps me to understand what I am looking at here.

Used to do a lot of hacking/training for BF long ago and had similar situations looking at code for days at end, and finally getting it...that's a good feeling I tell ya ;)

zAmboni
04-09-07, 03:51 PM
I can understand. It is tough explaining exactly what I mean without visuals to go along with it. I'm not sure if I want to do that much with this mod either mainly because I am not sure would like my layout and arrangement of the tools.

I am thinking of trying to write a tutorial on how to decipher and use the Zone= lines for someone else who would like to do their own mods. I dont fully understand everything in the Zone= line, but I do know enough about it that if I go through with the tutorial I will have a better (and maybe complete) understanding of the Zone= line.

CaptainCox
04-10-07, 12:56 AM
If you have the time please do write that tut...I think the Mod's should set up a tut section as this stuff will crop up more and more. I tell you what, I will make a thread with a new poll ;).

CaptainCox
04-10-07, 06:13 AM
Ok some new findings.

Tried on the "Helper" tool

Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.0683594,0.0390625

0.673828= the X position on the bitmap (in this case 0.673828 x 1024[being the size of the bitmap in X]= 689,999872 or you could say "690"

Now look
http://i10.photobucket.com/albums/a138/CaptainCox/x.jpg



Next is Y
0.774414=the Y position on the bitmap (in this case 0.774414 x 1024[being the size of the bitmap in X]= 792,999936 or one could say "793"

Look

http://i10.photobucket.com/albums/a138/CaptainCox/Y.jpg

At least one mystery less...or did you mention this before :p...its getting a lot now with codes here and there. Still have not been able to move it around on the game screen...working on it.

CaptainCox
04-10-07, 12:36 PM
Ok got it...after where you left of the only prob was the placement. Its almost to easy....

Its all in the zone line:

X and Y
Zone= 0 768 1024 768 2 1 0x31000000 0.5 -0.5 0x31000005 -0.5 0.5 0 0

There is also a posibillity that the last numbers can move stuff
Zone= 0 768 1024 768 2 1 0x31000000 0.5 -0.5 0x31000005 -0.5 0.5 0 0

But as it worked with the ones I posted first in this post I went with that.

I did a mod based on our findings and will post in another thread. Of course i will include you in the mod as co creator as you did 60% or more of the thinking.

Hope you don't mind ;)