Echo's SimStuff Header

Adding reserved floor tiles to single tile objects.

FYI: This tutorial has been translated into German by Xanathon and is available on his site here.

Introduction:
When an object mesh is made larger than the object it is cloned from, you will probably notice that your sims have an annoying habit of walking through the other cells as if they don't even see them. This can be annoying, and disruptive to the illusion. And as far as I know has always just been something you have to put up with, because in all my exploring I haven't come across anyone posting a solution before.

Well the good news is that it seems to be fixable!

There are two stages to fixing it. The first is making the visible footprint match your object. That is, you have to have the right number of green squares when you try to place the object. By itself, this is mostly an aesthetic change, but it is necessary for the next step.

The second half is the part that actually tells your sims that they can't walk there, and compared with the last part is surprisingly simple. It does, however, require modification of a BHAV file, and my explanation here assumes some small familiarity thereof.

Before we begin:
- This tutorial assumes you already have an object made and tested in game. If you haven't, this won't be of much use to you.
- Make a backup copy of your object now. If you make a mistake, you don't want to lose your whole object!
- If you haven't already registered for unique GUIDs through SimPE (shame on you!) then do that now as well.

Part 1: Making a single-tile object multi-tile friendly
Open SimPE, and open the object you want to make multi-tile friendly.

Select "Object Data" from the filetypes list on the left. You should see one record on the right. (note: if you see more than one record, your project is probably already multi-tile friendly, you can just skim through this info then do part 2)

Select the one record, then right click and choose the option "clone"

A second line, identical to the first, will appear.
Select the first line again, then go to its Plugin View tab. Select the "RAW Data" tab within this panel.

Scan down the list until you find the Multi-Tile master id, and give it the value 1.
The field below this is called the Multi-Tile sub index. Give it the value -1.

From this point on, I will be refering to this OBJD as the Master Tile. You can put that in the record's "filename" field if you want to, for reference, but you do not need to.

Commit.

Now select the second OBJD record, the one you created before, and use the "get GUID" function to assign it a new GUID. Now open up the RAW Data tab for this record.

Scan down the list until you find the Multi-Tile master id, and give it the value 1.
Now give the Multi-Tile sub index the value 0.

This OBJD represents the tile at position 0, which is in the same location as your original object.

Scan down until you find the field "Multi-Tile Lead Object". Set this to the value 1.

Commit.

Make sure you still have the same OBJD record selected, then go over to the "Packed File" tab. Find the "Instance" field, then select "make all listed unique". You will see that all the numbers in the instance column near the top of the screen have different numbers now. Take a note of these numbers, you will need them in a minute.

Now, select the "Object Functions" filetype from the list in the top left. You will see one record. Right click on this record and clone it like you did with the OBJD previously. A new record will appear.

You will notice that both of the records listed have the same instance number. Remember those instance numbers I had you note down from the OBJD list? Well each of the OBJf records needs to have one of the instance numbers from the OBJD list.

For each OBJf in turn, select the Packed File tab, copy one of the instance numbers into the instance field, and commit. When this is completed, you should have two OBJf, each one matched with the same instance number as one of the OBJDs.

Save. Your object should now be multi-tile friendly. If you want, you can check that your object still works in game. It should look and behave exactly as it did before, with only one tile. However, now you are able to add more tiles fairly easily.


Part 2: Adding more tiles
Once your object is multi-tile friendly, adding more tiles is relatively easy.

For each tile you want to add, repeat the following steps:

Go to your Object Data list, and clone the last record.
Open the newly cloned record, and use the "get GUID" function to assign it a new GUID.
Open the "RAW Data" tab, and scan down until you find "Multi-Tile sub index".
Here you need to enter a value that represents where the tile needs to go in relation to all the other tiles. This diagram demonstrates how to get this number:

By way of example:
A sub index of 0 places the tile at coordinates (0,0).
A sub index of 1 places the tile at coordinates (0,1).
A sub index of 2 places the tile at coordinates (0,2).
and so on, heading up.
Now to add width as well as height, we go in blocks of 256:
A sub index of 256 places the tile at coordinates (1,0).
A sub index of 512 places the tile at coordinates (2,0).
and so on.
If you want something in, say, position (1,1), you add the two together:
(1,1) = (1,0) + (0,1)
257 = 256 + 1

Enter that number into the "Multi-Tile sub index".

Now scan down to the "Multi-Tile lead object" field, and make it 0. There should only be one OBJD with the value of 1, and that was created in part 1.

Move over to the "Packed File" tab, and give the record a new instance number. Make it 1 higher than the highest listed instance number.

Commit and save.

Now go to the Object Functions file type, and clone the last record. Open the clone, then under the Packed File type, set its instance number to the same number you just gave your newest OBJD.

Commit and save.

Repeat the above steps for every tile you want to add, then save and test in game to make sure the tiles match the footprint.

Still not working? Make sure you've done everything in the checklist:
1. Do you have a master tile OBJD?
1.1 Is its Multi-Tile master ID set to 1?
1.2 Is its Multi-Tile sub index set to -1?

2. Do you have an additional OBJD for every tile you need?
2.1 Is its Multi-Tile master ID set to 1?
2.2 Is its Multi-Tile sub index set to the number representing its physical location?

3. Does every OBJD have a unique instance number?

4. Does every OBJD have a OBJf with a matching instance number?

Part 3: Changing the BHAVs

What you need to do is find your object's "Function - Init" Behaviour Function and add a new command at the end. This command should be:

My 0x0008 Set Flag Literal Value 0x0008

The values to get this are:
OpCode: 0x0002
Operands:
08 00 08 00 FF 09 03 07
00 00 00 00 00 00 00 00
True Target: Return True
False Target: Return Error

(For those interested, this is setting the object’s flag "7: Do NOT Use Maya Model Footprint". It seems that if this flag isn't set, as is the case by default, the system reads the footprint data from the footprint block in the CRES field. However, if it is set then the game generates the footprint itself at runtime based on the OBJD files in the package. )

Now you'll need to link the new command in to the rest of the Init function. You need to find the other line in the Init function that has "Return True" as its true target, then change it so that it is pointing to the line number of the command you just added. If that makes no sense, I suggest you look up a couple of BHAV tutorials, they explain it better than I have and they have pictures.

You're done!

If you've managed to do all this, then your sims should finally respect your object as they should! If you've had any problems, why not post in this related thread on MTS2.


This site is not endorsed by or affiliated with Electronic Arts, or its licensors. Trademarks are the property of their respective owners. Game content and materials copyright Electronic Arts Inc. and its licensors. All Rights Reserved.