SUBSIM Radio Room Forums


SUBSIM: The Web's #1 BBS for all submarine and naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Fleet Boat Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-14-2007, 07:32 AM   #1
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default [TEC] Tutorial: Deconstructing the menu_1024_768.ini file items

Part I - How layout items are placed and how to interpret the Zone= line

This tutorial is by no means complete, but I wanted to pass along what I have learned to other potential modders on how to decipher lines within the items. Hopefully this will make things easier for future modding efforts. The SH4 menu_1024_768.ini items are similar to the items in the SH3 menu_1024_768.ini except that the SH4 items now contain a Zone= line. This Zone= line is a bit more flexible in allowing the developer/modder to place graphical items within a page. For this tutorial I will be using items found on the Navigation Map pages since this is the page that I did my Retro Nav Map tools mod and I am a bit familiar with how things are place on this page. There are a bunch of things that need to be explained because several of the numbers in the Zone= line are active or inactive depending on the value of other lines within the item. So lets get going.

The Nav Map tools layout is defined in the G31 section of the menu_1024_768.ini file. Many of the items within the G31 section are holdover items from SH3 and are not active in SH4. items I2 through I14 are the holdovers from SH3 and can be completely ignored. I am going to start off with the G31 I1 item. This is the item that sets up the navigation map page. This is shown below:

[G31 I1]
Name=Page navigation map
Type=1027;Menu page
ItemID=0x31000000
ParentID=0x0
Pos=0,0,1024,768
Zone= 0 768 1024 768 2 1 0x0 0.5 -0.5 0x31000000 -0.5 0.5 0 0
LoadingMode=2

In SH4, the Zone= line basically replaces the Pos= line. In the above item, the first notable difference between the Pos= and Zone= is their initial point of reference. The Pos= line basically says "This item starts at the position x=0, y=0 (top left of the screen) and this item is 1024 pixels wide and 768 pixels deep." In other words The navigation map covers the entire screen at a 1024x768 resolution. The first four numbers in the Zone= line is really the same as the Pos= line, except that the 0,0 position is defined as being the bottom left corner instead of top left corner. (0 768), and again the dimensions of the item is 1024x768) Currently, I have no idea what the 5th and 6th numbers are for (2 1). The next element of the Zone= line refers to the ParentID (0x0). I have found out the next two numbers (0.5 -0.5) are involved in the placement of the item and is linked to the Parent ID. I will call this the ParentID placement. The next element refers to the ItemID (0x31000000) and the two numbers after that (-0.5 0.5) are linked to the ItemID and are also involved in the Item placement. The final two numbers are what I call the "offset" (0 0).

If you arent already confused, you may be asking....if the first two numbers of the Zone= line tells you where to place the item, why are the other numbers related to the ParentID and ItemID necessary? Well depending on other lines in an item, either one of the two sets of numbers are "active", they do not appear to be active at the same time. I'll come to this later....but for now I'll show you how the ParentID and ItemID defines where the item starts within a page.

1)The ultimate start point is 0,0 (top right corner of the screen). Now we are ready to move.

2) The element 0x0 0.5 -0.5 in the zone line says "go right half of the 0x0 item width and down half of the 0x0 item height". The width and height of the 0x0 item is the default screen resolution of 1024 (width)x 768 (height). So doing the calcuations this means "go right 512 pixels and down 384 pixels" This places us at the position 512,-384.

3) We aren't done yet....now we need to apply the next element 0x31000000 -0.5 0.5. This says "go left half of the 0x31000000 item width and then up half of the 0x31000000 height." From the Zone= line above the width and height of the 0x31000000 item is...again...1024x768. After calculation we go "left 512 pixels and up 384 pixels".....that places us at the position 0,0....um right where we started!

4) still not done though....then we apply the "offset" (0,0). Ok this is easy. we don't go anywhere. To finish this portion with the setup of the navigation page....the item starts at the position 0,0 and stretches 1024 pixels right and 768 down (the entire screen).

Now let's go on to something that isnt circular. This is the next relevant item on the nav page layout:

[G31 I15]
Name=Geometric tools
Type=1026;Menu group
ItemID=0x31010000
ParentID=0x31000000
Pos=0,-448,400,300
Zone= 0 320 400 300 0 1 0x31000000 0 -1 0x31010000 0 1 0 20

Why is this so called "menu group" necessary? Grouping keeps related items together...all nice and neat. In this case, each of the nav map tools (ok almost all of them) are given the ParentID of the Geometric tools. This has the advantage of keeping them together and also making it easy to change the placement of all the tools. This is because the placement of the tools are all relative to the placement of the geometric tools item. If you move the geometric tools item, all items within the group are moved the same amount. This saves time going in and figuring out how to change the zone= line in each and every map tool item. You just have to change the zone= line in the geometric tools item.

OK now...just where is this Geometric tools item placed on the page? Actually, it isnt *really* placed on the page, it is invisible. But I have ways of showing you just where it is!. Lets start out like we did above and walk through this item.

1) We start out with the ParentID position of the geometric tools. The ParentID of the geometric tools refers to the Navigation Page that we set up above....We determined that the navigation page start position is 0,0. This is where we start here also.

2) we skip over the first few numbers and go straight fo0,r the element 0x31000000 0 -1. Now say along with me "go right 0 of the 0x31000000 item width and go down all of the 0x31000000 item height". the width and height of the 0x31000000 item is...again...1024x760. Starting at 0,0 we "go right 0 pixels, and down 768 pixels". This places us at 0,-768.....i.e. the bottom left of the screen.

3) now we apply the second element: 0x31010000 0 1 "go right 0, and now go up all the 0x31010000 item height". From the zone line of item 0x31010000, the width is 400 pixels and height is 300 pixels. OK now we start at the position 0,768 (from #3 above) and then move right 0 pixels and up 300 pixels. This places us at the position 0,-468.

4) again we are not done yet. We still have to apply the "offset": 0 20. From position 0,-468 we go right 0 pixels and up 20 pixels, that places us at the final position 0,-448.

How do we check we did things right? Just compare the final number from #4 with the first two numbers in the Pos= line. YUP THEY MATCH! YAY! We're cooking with fire now!






Now we have determined where the Geometric tools group is located, we are ready to place one of the tools on the navigation map page. I decided to use the Ruler for the example here, mainly because it is needed to show something afterwards. Lets now take a look at the Ruler item:

[G31 I22]
Name=Ruler
Type=1032;Button
ItemID=0x31010001
ParentID=0x31010000
Pos=-60,106,200,406
Zone= -60 426 200 406 0 1 0x31010000 0 -1 0x31010001 -0.3 1 0 0

1) I am only going to focus on the positioning of the ruler for now....and that means focusing on the Zone= line. But first we have to look at what the ruler's parent is....ParentID=0x31010000. The ParentID is the ID number of the Geometric Tools group. To place the ruler on the nav map, we need to place it relative to the start position of the Geometric Tools item that we determined above (0,-448)

2) 0x31010000 0 -1 -- right 0, down all the 0x31010000 item height. Starting at 0,-448, go right 0 pixels and down 300 pixels. This places us at 0,-748.

3) 0x31010001 -0.3 1 -- go left 3 tenths the width of the Ruler item and go up all of the Ruler height......3 tenths of the ruler width = 0.3x200 = 60 pixels. Full height of the ruler = 406 pixels. Now starting at 0,-748 we move left 60 pixels and move up 406 pixels. This leaves us at position -60,-342.

4) Apply offset (0,0) -- OK there is no offset...so final number = -60,-342. We check this with what the Pos= line says above and.....what??? they don't match! This is because the Pos= line actually gives the position relative to the parentID element....but trust me...it is right!.

One last thing about positioning. The seventh element in the Zone= line DOES NOT ALWAYS have to refer to the ParentID item. It can be any item on the page that the developer/modder wants to place it relative to. We can see this happening in the Tool Helper. The tool helper is place relative to the start position of the Ruler instead of the start position of the Geometric tools group



[G31 I16]
Name=Tool Helper
Type=1033;Check box
ItemID=0x3101000A
ParentID=0x31010000
Pos=20,186,160,80
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0

I'll let you work out the math on this one (hopefully you followed me through the above examples to a T!). But to break it down, the start position here is the where we ended off with the Ruler (-60, -342). In this case we go right 80 pixels and up 80 pixels to find the Tool Helper starting point = 20,-262



I just want to remind you all that the numbers that I have calculated for the starting points for the items are using the top left of the screen as the 0,0 reference point. The first two numbers of the Zone= line uses the BOTTOM LEFT as the 0,0 reference point. You can actually verify the calculations I have done by adding 768 to the second number of the two. In the Tool Helper this means --- -262 + 768 = 506....the 20, 506 matches the first two numbers of the Zone= line.

Something that I want to note that I may have not mentioned earlier. The Pos= line IS NOT ACTIVE in this menu. I think it is just a holdover from SH3. It does play an informational purpose in pointing out relative spacing to the parent item. Also IN THE ABOVE EXAMPLES, the first two numbers of the Zone= line ARE NOT ACTIVE. In other words, if you change the first two numbers in this example, it does not do anything with the layout. THIS IS NOT ALWAYS SO! and I will explain under what conditions in the next part of the tutorial.

I think I will let this be the end of the first part of this tutorial. The next part of the tutorial will deal with conditional interpretations of the Zone= line along with some of the things I have learned about the other lines in individual items.
zAmboni is offline   Reply With Quote
Old 04-14-2007, 07:56 AM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 0
Uploads: 0
Default


Talk about good timing man!!!! I am trying to do this clock and I can't find where to set the center for the big hands (min/h) I will read this through a couple of times and maybe I will find a solution. Bloody SUPER TUT man! Thanks!
__________________
CaptainCox is offline   Reply With Quote
Old 04-14-2007, 08:48 AM   #3
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 0
Uploads: 0
Default

@zAmboni if you are around man...what would you suspect holds the "center" point of stuff (asking cause of this darn clock) I basically had to use the whole spectrum of the "Zone" line in order for this to work...only thing left is the darn "Rotation Centers" of the hands Or if some one else have a clue...please
__________________
CaptainCox is offline   Reply With Quote
Old 04-14-2007, 09:32 AM   #4
McBob
Seaman
 
Join Date: Apr 2007
Posts: 31
Downloads: 92
Uploads: 0
Default

Thanks zAmboni this is just what I need.

@CaptainCox - this is my understanding on how the centre point of the hands works:

You do not change the centre point in the entry relating to the hand. The hands automaticaly rotate about the centre point of the parentID that they are associated to.

Taking the stock SH4 clock: the Hr/Min hands rotate about the centre point of 'Big Dial' and the torpedo hands rotate about the centre point of 'small dial'

Thus if you want to move the hands you need to change the position of the dial that they are related to -by changing the 0.5 -0.5 entry in the zone line of the dial. Or you may need to create a new dial item (if you want to have the hands in more than 2 positions)

Hope this helps
McBob is offline   Reply With Quote
Old 04-14-2007, 09:37 AM   #5
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 0
Uploads: 0
Default

Bloody brilliant McBob thanks a bunch
__________________
CaptainCox is offline   Reply With Quote
Old 04-15-2007, 01:52 AM   #6
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default

Deciphering menu_1024_768.ini items

Tutorial Part 2.

In the first part of the tutorial, I explained (or tried to) several of the elements of Zone= line and how they should be interpreted. The thing is with modding, the modder will want to change what the developer has done and I think it would be helpful to move a tool item around and show what kind of changes are necessary to do so. In the first example, I will move the tool helper item to a specific place and show different ways to modify the zone= file to accomplish this.

The spot I am going to move the tool helper to is at the grid cross above the zoom tool and to the right of the ruler. I fired up photoshop and determined that the coordinates that are needed to place the tool helper at the cross are (168,-463). From the above tutorial, we determined that the stock position of the tool helper is at the position (20,-262), but that is not the number we are going to use as our starting point. Because the tool helper is positioned relative to the ruler position, we will use the ruler position as our starting point…which is (-60,-342). Doing simple coordinate math it is determined that we need to move 228 pixels to the right and 121 pixels down. To accomplish this, how do we change the original zone= line?

Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0

Can we just change the first two numbers in the Zone= line to 168 305? No. As I mentioned before, the first two numbers of the Zone= line is not active with this item, so we have to manipulate other elements in the line. For this example I will only manipulate the 0x3101000A 0.5 1 elements.

1)to determine the x element, we need to calculate the fraction of the tool helper width to give us 228 pixels. So we take 228/160 = 1.425
2)to determine the y element , we need to calculate the fraction of the tool helper height to give us -121 pixels. So we take -121/80 = -1.5125.
3)Plugging that into the Zone= line and we get Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 1.425 -1.5125 0 0

Voila!






There is another way to do this also. We can change the Zone= file to make the tool helper relative to the Geometric tools menu item. This means changing the 0x31010001 in the zone= line to 0x31010000. Also in this example we will change the 0x31010001 0 0 elements and change the 0x3101000A 0.5 1 elements to 0x3101000A 0 0. This means that the positioning information is only coming from the geometric tools width and height. But note because we are now using the position of the geometric tools element as our starting point, our starting point is now (0,-448). So to get the final position of (168,-463) we need to move 168 pixels to the right and 15 pixels down

1)to determine the x element, we need to calculate the fraction of the geometric tools menu width to give us 168 pixels. 168/400 = 0.42
2)to determine the y element, we need to calculate the fraction of the geometric tools menu width to give us -15 pixels. -15/300 = -0.05
3)Plugging this information in the Zone= line give us: Zone= 20 506 160 80 0 1 0x31010000 0.42 -00.5 0x3101000A 0 0 0 0

A third and probably the easiest way to move the tool helper is through the “offset” elements. To do this, just take the original tool helper Zone= line and then just change the offset elements to offset the tool helper the amount of pixels needed. For this example we need to use the final position of the tool helper item to determine the change in coordinates needed. The final position of the tool helper is (20,-262). The position we want to move it to is (168,-463), so we need to move 148 pixels to the right and 201 pixels down. Plugging this information into the default Zone= line:

Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0
Becomes
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 148 -201

NOTE: Even though the first two elements in the Zone= line are not active in these examples, it would be good modder practice to actually change the numbers to the final position of the tool helper element. The final position using the Zone= convention would be 168 308…making the line:

Zone= 168 308 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 148 -201

I’m going to cut things off on this tutorial here because I want to get into something different for the third tutorial…which I hope is coming very shortly J.
zAmboni is offline   Reply With Quote
Old 04-15-2007, 03:39 AM   #7
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 0
Uploads: 0
Default


RESPECT! plain and simply! RESPECT!
__________________
CaptainCox is offline   Reply With Quote
Old 04-15-2007, 04:24 AM   #8
Jungman
Samurai Navy
 
Join Date: Apr 2005
Location: Iowa, USA
Posts: 596
Downloads: 0
Uploads: 0
Default

Quite literate! How he figured that stuff out...I wonder. If I can use this to renable the FABC dials (all four are in the subs 3D interior as a group and three do work), I miss seeing them.
Jungman is offline   Reply With Quote
Old 04-15-2007, 04:37 AM   #9
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default

Deciphering menu_1024_768.ini items

Tutorial Part 3.

The first two parts of the tutorial have dealt mainly with how things are positioned within a page within the game. In this tutorial I will explain some of the other lines included for an item and how manipulating the lines can cause items to be displayed differently. In this tutorial I will do some additional manipulation of the tool helper item since it was also used in the previous two tutorials.

The first question that I will answer concerns just what elements of the tool helper item are used to determine the graphics that are displayed on the navigation menu page. The tool helper has two states, closed and open. Each state has two different graphics associated with them, one without mouseover and one with mouseover. This means that for the tool helper there are a total of four different graphics associated with it:

1)closed tool helper – no mouseover
2)closed tool helper – mouseover
3)open tool helper – no mouseover
4)open tool helper – mouseover

We can determine how these graphics are displayed by taking a closer look into the tool helper item in the menu_1024_768.ini file. Below is a portion of the tool helper item to illustrate what I am talking about. The information for where the graphics are taken for the tool helper is contained in the Mat x= and Crop x= lines. The Mat x= line shows the subfolder and the graphics file from where the tool helper graphics is found. The Crop x= lines tell what portion of this graphics file to use for the tool helper. But but but….you said above that there are 4 different graphics associated with the tool helper….why are there 8 different Mat x= and Crop x= lines? Through a bit of research I found that 4 of these lines define what graphics to use for 1 through 4 outlined above, I am not sure what the other 4 lines are for. I have noted which of the Crop x= lines are associted with 1-4 above.

[G31 I16]
Name=Tool Helper
Type=1033;Check box
ItemID=0x3101000A
ParentID=0x31010000
Pos=20,186,160,80
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0
Materials=8
Display=0;No stretch
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.673828,0.859375,0.0683594,0.0390625
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.673828,0.774414,0.0683594,0.0390625
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.673828,0.859375,0.0683594,0.0390625 closed tool helper – no mouseover
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.673828,0.774414,0.0683594,0.0390625
Mat 4=data/menu/gui/layout/navigationtools.tga
Crop 4=0.835938,0.859375,0.0683594,0.0390625 closed tool helper – mouseover
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.0683594,0.0390625 open tool helper – mouseover
Mat 6=data/menu/gui/layout/navigationtools.tga
Crop 6=0.673828,0.859375,0.0683594,0.0390625
Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.0683594,0.0390625 open tool helper – no mouseover

For comparison, the other tools on the navmap only have two graphics associated with them. One without mouseover, and one for mouseover. I have determined that the Crop 1= line for the other tools is the graphic associated without mouseover, the Crop 2= line is the graphic used for a mouseover. Again, I have no clue what the other lines are used for.

Soooooooo….how do we decipher the Crop x= line?

The associated graphics file ususally has several different graphics used for the game. To determine just what part of that graphics file is to be used, the game uses the Crop x= line to define the x,y start position and uses the item width and height to basically make a cookie cutter box to define the graphic. Lets break down the Crop 2= line from above:

Crop 2=0.673828,0.859375,0.0683594,0.0390625

0.673828 = the x position where the graphic to be used starts. This x position is represented as the # of pixels to the right of the origin of the graphics file divided by the total width of the graphics file. The total width of the navigationtools.tga(dds) file is 1024 pixels. To find out how many pixels to go to the right, just multiply. 0.673828*1024 = 690 pixels

0.859375 = the y position where the graphic to be used starts. This y position is represented as the # of pixels down from of the origin of the graphics file divided by the total height of the graphics file. The total height of the navigationtools.tga(dds) file is 1024 pixels. To find out how many pixels to move down, just multiply. 0.859375*1024 = 880 pixels

That gives us the x,y position for the start of the graphics cut, but where do we find the width and height? You might think that the next two numbers will give you the information for the width and height, but that is not so. These two numbers (0.0683594,0.0390625) ARE INACTIVE….The width and height are inactive in the Crop x= line when the item has the line Display=0! When Display=0, the width and height are taken from the Zone= line associated with the item. In this case the width is 160 and height is 80.

For reference, here is a pic of the navigationtools.dds file with some notes:






OK, I am going to end this part of the Tutorial here. The next, and possibly final part of the tutorial will deal with the Display= line and some neato things you can do with it.
zAmboni is offline   Reply With Quote
Old 04-15-2007, 02:14 PM   #10
Mav87th
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Marveleus - im pretty sure you soon will have "figured out" how we can make the Compass, Heading and Speeddial zoom up to a larger level with mouse over.....
  Reply With Quote
Old 04-15-2007, 04:01 PM   #11
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default

I havent had a look at the dials and such, but I will do so pretty soon. I just hope that that type of stuff isnt hard coded into the .exe file.
zAmboni is offline   Reply With Quote
Old 04-15-2007, 04:16 PM   #12
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 0
Uploads: 0
Default

I don't think it is hardcoded...looked at it the other day, but as there is 3 dials there is a lot of code blocks to sift through. I bet ya you can do it if anybody zAmboni.
__________________
CaptainCox is offline   Reply With Quote
Old 04-15-2007, 08:20 PM   #13
Chrall
Sailor man
 
Join Date: Apr 2005
Location: Sweden
Posts: 46
Downloads: 38
Uploads: 0
Default

I've been doing a lot of work with the gauges lately and I have yet to find the command for the zoom. I've stopped looking for it, since I don't belive it's there anymore.You can do it the "easy" way and size the whole thing up, but of course that will make it bigger in normal mode.

Here is a compass I made today, bit bigger and with a more readable dial. As you can see I haven't center it properly yet.
Chrall is offline   Reply With Quote
Old 04-15-2007, 08:36 PM   #14
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default

I took a look earlier through the file to see if there was anything that dealt with the zoom of the dials, but I couldn't find anything (It would help a bit if there wasn't all the leftover junk from SH3 in the file either!). I dont think that there is anything in there that deals with the zoom. I think this mainly because I looked for something in the file on how that bottom menu slides up and down (also to see if there was something there about the lock/unlock menu button). I didnt see anything about that in the file either.

Unfortunately I think it is hard coded :/
zAmboni is offline   Reply With Quote
Old 04-15-2007, 10:54 PM   #15
zAmboni
Seaman
 
Join Date: Apr 2005
Posts: 33
Downloads: 0
Uploads: 0
Default

Deciphering menu_1024_768.ini items

Tutorial Part 4.

In the last tutorial I pointed out the numbers in the Crop x= that you think would be associated with width and height were inactive. It seems that when the associated item has the line Display=0;No stretch those two numbers are inactive, and the width and height are taken directly from the Zone= line.

If you browse through the different items in the menu_1024_768.ini file, there are several different values for the Display= line, I have listed them below with some comments on them.

Display=0;No stretch – what you clip is what you get. The graphics that are defined by the Crop x= line is directly placed where the Zone= line defines
Display=1;Centered – Graphics (or text) will be placed at the center of an area defined in the Zone= line
Display=2;Linear – The graphic selection defined in the Crop x= line will be stretched/shrunk to fit the area defined in the Zone= line
Display=3;Middle – not really sure what this is for. I gather it is used the placement of text.
Display=4;All directions – not really sure what this is for either…I believe it is used for placing sliders/scroll bars
Display=5;Linear&rotation – Used for dials and other things that rotate, like the hands of the clock. It allows the stretch/shrink ability in addition for a rotation element. It appears the center of the area defined in the Zone= line is the rotation point for the item.

In the previous tutorials the items I have used for an example all were defined with a Display=0;No Stretch line. With this line included, the area of the graphics file that is “cut out” using the Crop x= line is placed, as is, starting at the placement point defined in the Zone= line. But lets now take a look at some of the other values for the Display= line, using, again, the tool helper as an example.

Lets just do a simple modification of the item and change the Display=0, to Display=1 Centered.

Hrmm….that is interesting, What happened here? OK, I’ll tell ya! Remember the width and height elements that I said were inactive in the Crop x= line? Well they are active now. In addition, the length and width elements of the Zone= line ARE ALSO ACTIVE.

[G31 I16]
Name=Tool Helper
Type=1033;Check box
ItemID=0x3101000A
ParentID=0x31010000
Pos=20,186,160,80
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0
Materials=8
Display=1;Centered
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.673828,0.859375,0.0683594,0.0390625
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.673828,0.774414,0.0683594,0.0390625
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.673828,0.859375,0.0683594,0.0390625
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.673828,0.774414,0.0683594,0.0390625
Mat 4=data/menu/gui/layout/navigationtools.tga
Crop 4=0.835938,0.859375,0.0683594,0.0390625
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.0683594,0.0390625
Mat 6=data/menu/gui/layout/navigationtools.tga
Crop 6=0.673828,0.859375,0.0683594,0.0390625
Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.0683594,0.0390625

You may ask yourself, how can they both be active? Think of it this way. The width and height determined in the Crop x= line is the area that is cut out of the graphics file. The width and height determined in the Zone= file is an area that the graphic will be placed into. When Display=0, the two areas were the same size, and was define through the Zone= line.





Why is the graphics wrong in the screenshot above? That is because the width and height defined in the tool helper Crop x= lines are WRONG. If you do the math, the width defined in the Crop x= line is: 0.0683594 x 1024 = 70 pixels. The height is: 0.0390625 x 1024 = 40. In the previous tutorials we know that the length and width of the tool helper should be 160 x 80. If you notice, this smaller piece of the tool helper is pretty nicely centered in the area (160 x 80) that was defined in the Zone= line. To get things right we need to change the width and height in the Crop= line to define a cut out area of 160x80: width = 160/1024 = 0.15625, height = 80/1024 = 0.078125. Plugging this into the crop x= line gives us:

Crop 0=0.673828,0.859375,0.15625,0.078125

You will need to do the same for all of the crop x= lines.

Now I am going to take a look at the Display=2;Linear line. Lets fix all the Crop x= lines like I just mentioned and then change the Display=1 line to Display=2;Linear.

[G31 I16]
Name=Tool Helper
Type=1033;Check box
ItemID=0x3101000A
ParentID=0x31010000
Pos=20,186,160,80
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0
Materials=8
Display=2;Linear
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.673828,0.859375,0.15625,0.078125
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.673828,0.774414,0.15625,0.078125
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.673828,0.859375,0.15625,0.078125
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.673828,0.774414,0.15625,0.078125
Mat 4=data/menu/gui/layout/navigationtools.tga
Crop 4=0.835938,0.859375,0.15625,0.078125
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.15625,0.078125
Mat 6=data/menu/gui/layout/navigationtools.tga
Crop 6=0.673828,0.859375,0.15625,0.078125
Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.15625,0.078125

If you fire up the game, you wont notice anything different. Well that is because the area defined in the Zone= line and the Crop x= line is the same. But let’s double the length and width defined in the Zone = line:

Zone= 20 506 320 160 0 1 0x31010001 0 0 0x3101000A 0.5 1 -80 0

(Note: I used an offset because the tool will get shifted to the right a bit).




You can see now that the graphic defined in the Crop x= line now is stretched to fit the larger area. You can use this to increase the size of a graphic on a page. You can also make the graphic smaller by changing the width/height in the Zone= line to an area smaller than one defined in the Crop x= line.

Im not going to talk about the Display=3;Middle and Display=4;All directions options because I am not sure what they do. They do weird things to if you plug it into the tool helper item above.

I’m only going to touch upon the Display=5;Linear&rotation option. I haven’t played around with it, so I am not sure if what I would say is right or wrong J. From what I can tell, it is used for dials and hands of clocks or other things that rotate. The center of rotation for the dial would be the center of the area defined in the Zone= line. As far as I can tell, the option works the same as the Display=2;Linear. So you can zoom or shrink a graphics by playing with the width/height in the Zone= line. Just make sure that you adjust the offset that may be caused by changing the width/height in the Zone= line.

I think I am going to end the tutorials here….mainly because I really don’t know anything else about the items in the menu_1024_768.ini file….and I need to get geared up for getting back into the game when the patch comes out this week! .If you have found anything else out about the items in the file, you are welcome to add it in the thread or add your own tutorial on how to mod things J.
zAmboni 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 06:33 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 1997- 2017 Subsim