View Single Post
Old 04-15-07, 12:52 AM   #6
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
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.
  Reply With Quote