View Single Post in: [OUTDATED] Changing Lot size after building and/or playing (Archived)

Test Subject
Original Poster
#106 Old 27th Aug 2006 at 5:31 PM
Default How do I create a 1x1 lot?
First of all: In the following I'm using for sizes the values in the same line as all the resources of the lot do. That means you have to add 1 (respectively 10) for the road to get the used size values. E.g. a 1x1 lot in effect is a 1x2 lot or for a 2x2 lot the game uses the size values 2x3.

As in fact I'm using an early version of my LotExpander with reverse functionality to do the necessary changes, the following describes the basics of this program too.

I'm starting the first time with an empty 3x2 lot in the standard orientation. That means without rotating it while placing. So the values of 'Orientation' and 'U11' are both '0' (see below). With moveobjects I'm moving mailbox and trashcan to the right, because this early version of LotExpander don't move objects if necessary.

Ok, let's start modding.
There are 2 packages to manipulate it: the neighbourhood package and the lot package.

Neighbourhood package

Open the neighbourhood with SimPE and have a look at Plugin view of 'Lot Description' resource from the interested lot. There are 3 values relevant for us: 'Width', 'Height' and 'U11'. 'U11' is used by game to store the orientation the lot is loading the first time. We need this value to interpret the coordinate systems of all the lot resources. For 'Lot Description' it defines the meaning of the fields 'Width' and 'Height'. If you are looking from street side and the value of 'U11' is '0' or '2', the field 'Width' shows us the height and 'Height' the width of the lot. If the value of 'U11' is '1' or '3', the two fields show us what their names say. (Don't change the value of 'U11', because that confuses the game and you'll get a terrible hole in your neighbourhood.)
So we have to change the value of 'Height' from '3' to '1'.
That's it in neighbourhood package.

Lot package

In lot package there are multiple resources to change. But because the lot is empty the most changes are easy.

First we delete the 'Texture Image' resources (1C4A276C). The game will create new ones if we do a structural change.

There are some resources where we have only to change the values for the new size:

'World Database' (49FF7D76): Width (Offset 93) value = X * 10 - 1, Height (Offset 97) value = Y * 10 - 1

'Lot' (6C589723): Width (Offset 66) value = X, Height (Offset 70) value = Y

'Wall Graph' (0A284D0B): Width (Offset 95) value = X * 10 + 1, Height (Offset 99) value = Y * 10 + 1

'Lot Texture Map' (4B58975B): Width (Offset 72) value = X * 10, Height (Offset 76) value = Y * 10

The changes in following resources are a little bit more complex.

'2D Array' (6B943B43):
Width (Offset 81) value = X * 40 + 1, Height (Offset 85) value = X * 40 + 1
All instances of this resource, except '3B76', stores 16 values of byte per tile (4 * 4).
Because we change the Height from 3 to 1 we just have to cut the file about 2 * (3 – 1) * 40 bytes (X * difY * 40). Changing width would be a little bit more complex because you have to do it line-by-line.

Instance '3B76'
Width (Offset 81) value = X * 10 + 1, Height (Offset 85) value = X * 10 + 1
This is store one float value per tile.
So we have to cut it the same length as the other instances.

'3D Array' (2A51171B)
Width (Offset 81) value = X * 10, Height (Offset 85) value = X * 10
The instances of this resource stores Data with individual length per tile and layer. Because our lot is empty there is only one layer and so the changes are not as complex as on lots with buildings.
We have to delete (3 – 1) * 10 * <Length of Data> line-by-line along the width.
The length of Data (in byte) for the individual instances is shown in following list.
'00': 6
'01': 4
'03': 1
'09': 8
'0A': 8
'0B': 8
'0C': 4
'14': 16
'15': 4
'1B': 8

Now we finally have to move some of the 'portal- objects'. Different to other objects the positions of the portals depends only from values in XOBJ (584F424A) resources. On empty lots (and each other except some from Maxis) the instances of this resource for portals are '03' up to '08'.
The position is stored in two float values (X, Y):
Y with offset 80
X with offset 84
We have to subtract from Y-values greater 10 : (3 – 1) * 10

That's it!

I hope someone can understand my gibberish.