Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Retired Duck
retired moderator
Original Poster
#1 Old 16th Oct 2005 at 3:40 PM Last edited by HugeLunatic : 30th May 2021 at 8:01 PM.
Default Tutorial: Fixing the footprint (or "stop walking through my object!")
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!
---

A quick note regarding tables: Before you ask, this only half solves the differently-shaped-table problem. The problem of walking through resized tables is fixed using this technique. Placing chairs around the edge of the table is also fixed. However, the tables still seem to retain the same slots (or something...) for the placement of objects/food etc, so the objects will all be placed on one side of the table.
Advertisement
One horse disagreer of the Apocalypse
#2 Old 16th Oct 2005 at 3:42 PM
Where's the Thanks button!!!?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Retired Duck
retired moderator
Original Poster
#3 Old 16th Oct 2005 at 3:43 PM
I think the post has to be moved into "Tutorials" forum before I get one of those Inge. Sentiment greatly appreciated though! :D
The ModFather
retired moderator
#4 Old 16th Oct 2005 at 4:45 PM
(Moved to General Modding Tutorial)

Thank you Echo for the useful info!

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Field Researcher
#5 Old 17th Oct 2005 at 4:43 PM
Brilliant!! And so simple :D
So you don't really need to reserve the tiles one by one, but rather reserve the whole object instead. Very useful tutorial, thanks a lot!
Lab Assistant
#6 Old 21st Oct 2005 at 4:39 AM
Perhaps that other tutorial can get moved here before it vanishes?

I would also like to add that you can go in the negative direction. For example, a sub-index of -256, -512, and so on will extend the footprint in the opposite direction.

Sweet! Worked like a charm, thanks!

-T
Lab Assistant
#7 Old 21st Oct 2005 at 8:00 AM
thanks so much. this is just what i need for my 16 tile wide theater screen.
One horse disagreer of the Apocalypse
#8 Old 21st Oct 2005 at 8:04 AM
Yes, when I asked a Maxoid why there was still such a thing as a multi-tile object they said it was mainly just legacy and not really necessary. Extra tiles are handy when you want to run different code on different parts of the object, like for example Merola's painting.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Retired Duck
retired moderator
Original Poster
#9 Old 21st Oct 2005 at 8:56 AM
Targa: I was planning on rewriting the original tutorial eventually to include the BHAV info (and updated SimPE gui pics), so when I get that done, I'll certainly try to put it up here. The only reason I haven't so far is that I'd have to go through and change all the image links to bbcode, and I'm feeling lazy at the moment. Thanks for the tip about the negative sub-indices btw, I hadn't ever considered it!
The ModFather
retired moderator
#10 Old 21st Oct 2005 at 1:27 PM
Quote: Originally posted by Targa
Perhaps that other tutorial can get moved here before it vanishes?


Which tutorial are you referring to? Please give me a link and I'll take a look.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Lab Assistant
#11 Old 21st Oct 2005 at 6:43 PM Last edited by Targa : 21st Oct 2005 at 10:10 PM.
In Echo's tutorial post at the top of this thread. This one:
http://www.eternal-echo.net/sims/tutorial/

@Echo: The ability to add negative numbers is important, I suppose, since I've had to do it twice now. In replacing an object mesh with a larger mesh, (in my case, going from 2 tiles wide to 6 tiles wide), adding more Object Data's and Object Functions gave me more tiles to the left of center and none to the right, though my object was centered. I could have moved the pivot point in 3dsmax I suppose, but then you would be "grabbing" the right-hand corner of the object when taking it out of the buy catalog and when moving it. Adding 2 obj dat with positive numbers and 2 more with negative numbers widened my footprint equally in both directions, which is what I needed.

Edit: Well, this tutorial worked great for the first object I worked on, but this new object is not only not affected, Sims can walk through any part of the object now, as if it doesn't exist at all. Any suggestions?

Edit2: Never mind, figured it out. Add this to your tutorial:
In "Object Data", each OBJD must have the value "Footprint mask" set to zero.
The ModFather
retired moderator
#12 Old 21st Oct 2005 at 10:41 PM
Quote: Originally posted by Targa
In Echo's tutorial post at the top of this thread. This one:
http://www.eternal-echo.net/sims/tutorial/


If Echo wants to repost it here, I'll be glad to move it in the tutorial section.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Instructor
#13 Old 27th Oct 2005 at 9:27 PM
ah this is awesome! just what i was looking for! thank you so much.

xD
Lab Assistant
#14 Old 4th Dec 2005 at 12:15 PM
Ah yes, Echo's footprint tutorial... I'm just a little hesitant about the first part, since there are 4 OBJD's for my object... Will I have to change all of them? Or just one? And then there is a slight complication... the tutorial is meant to add tiles, not remove them. After all the hair-pulling I've been through I get shakey thinking about remutilating my poor package =) But hey... I tend to think of it as worthwhile, since it makes a much better release =)

And now that my browser has refreshed... Greeting Echo.. care to fill me in on removing an extra footprint tile? ;-)

Pax,
Indigo
Retired Duck
retired moderator
Original Poster
#15 Old 5th Dec 2005 at 4:04 AM
Greetings Indigo

Well if you're nervous about mutilating packages, do what I do and make a packup copy of the package first . As for removing tiles, it's really just a matter of working backwards. I'm assuming you still want the object to have multiple tiles, you just want to get rid of some of them (so, say, have two or three instead of four)?

First, figure out which OBJD is the master tile. Make sure you don't do anything to that one, it can stay as it is.

Now look at the other OBJDs, and take a note of the value in their "Multi-Tile Sub Index" field. Using the info in the tutorial (the diagram under "Part Two: Adding More Tiles"), see if you can figure out which OBJD is representing which tile in the footprint. Once you've found which one you want to remove, then take a note of its Instance number. Then you can just delete the OBJD.

To keep things neat, you should now go and delete the OBJf files which has the same Instance number as the OBJD you just deleted (Although strictly speaking it won't break your file to leave it in there).

If you want to reduce it to a single tile/OBJD, it's a little more complicated because you have to undo the multi-tile step as well. The simplest way is to still have a master and a single slave OBJD, but that does use up an extra GUID that isn't needed. If you want to reduce it to a single tile efficiently let me know and I'll explain the steps involved there too.

Hope that made sense. If it didn't, let me know and I'll try to do a more detailed version.

Echo
Inventor
#16 Old 6th Dec 2005 at 2:04 AM
thankyou so much! i have laid off some objects i have made because i wouldn't be able to sort it out but now i can go ahead thanks very much again.
Part-time Hermit
#17 Old 11th Dec 2005 at 5:21 PM
I was fine with the first part of the tutorial, but the Function-Init editing part completely throws me off. I'm not sure what to do to add a new command and where exactly. I got as far as putting those values listed into the boxes, but I have no clue other than that. Do I need to use the Add button at some point?
The ModFather
retired moderator
#18 Old 11th Dec 2005 at 5:38 PM
I suggest to check the option "Special Buttons" (near the Add & Delete buttons); some new buttons will appear. Now select the last line of the BHAV (the one that exits to "Return True") and click "Add via True".
This will add a new line, already linked to the previous one. You just have to check if the OpCode is 0x0002, and then fill in the operands from the tutorial.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Part-time Hermit
#19 Old 11th Dec 2005 at 6:13 PM
OK, I feel like a complete dummy, but I still don't get it. To be able to view the last line of the BHAV I have to open it in a separate window (by clicking on View BHAV). If I click on that line with the Return True value there and then go back to the main window and click Insert Via True, it doesn't do anything to that line, it just adds a line to the main window and links it to something else, not the line I want it to.
One horse disagreer of the Apocalypse
#20 Old 11th Dec 2005 at 6:24 PM
No don't use View BHAV. That is a readonly viewing of the BHAV pointed to in an opcode, just so you can see what code you're calling. It's not the current BHAV.

Are you trying to open the BHAV via the Object Function table? That's not right, you want to look at the filetype list and select the appropriate BHAV to open from there. Then you wil be able to edit it.

If you are already doing that right, and you can't see the last lines, you can pull the plugin pane a bit bigger and you should also be able to see a scroll bar

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Part-time Hermit
#21 Old 11th Dec 2005 at 6:48 PM Last edited by IgnorantBliss : 11th Dec 2005 at 6:55 PM.
No, I have the Behaviour Function and the Function Init open, but I only see one line in the Plugin view, there is nothing to scroll down to. Even going to Advanced Mode doesn't change it. I'm using SimPE 0.52. Could this object (a coffee table) only have one line to begin with?
One horse disagreer of the Apocalypse
#22 Old 11th Dec 2005 at 7:08 PM
Yes very possible. Usually a standard object like a table simply calls the Init from the semiglobals. But you should be able to add lines after that line if you wanted something extra to happen. Obviously you need to make sure the new line is linked into the flow so it actually runs. Just click Add.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Part-time Hermit
#23 Old 11th Dec 2005 at 7:12 PM
OK, I added a line after that one line like told in the tutorial, but now I can't place the coffee table anywhere, the placement arrows just stay red regardless of where I try to place it. So I guess I did something wrong still.

Edited to add: Never mind, I made a mistake with the OBJf that probably caused the problem.
One horse disagreer of the Apocalypse
#24 Old 11th Dec 2005 at 7:17 PM
Would you like to list your edited BHAV here? If you tick "Special buttons" in your BHAV editor one option is to copy the listing to your clipboard, then you can paste it into a forum post.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Part-time Hermit
#25 Old 11th Dec 2005 at 7:24 PM
OK, the placement problem was because the extra OBJf was missing. I had added it at some point but had several different versions of this table saved and it was missing from this one. Now I can place the table on the floor just fine. Now if only I could make the new tile fully functional, being able to place items on it .

Thanks for the help!
Page 1 of 11
Back to top