Back Previous Next

Making objects buyable

Oops, the mailbox or the pedestrian portal have been deleted by the move_objects cheat. Or you want to be able to serve your guests fruitcake, or have pizza without having to wait for the pizza guy. All this requires making the object buyable, so that it can be introduced into the lot.

Each object (even the Sims themselves, bizarrely enough) contains an OBJD block with the qualities "function flag" and "room flag". If these are set to zero, the object is not buyable. If they are set to a number that corresponds to a room or function category in the catalogue, they appear in the catalogue.

The screen cap of IFF Pencil in the next section shows the room, function and HD+ flags. Enter the right values in the fields of the object you want to make buyable. If the object is meant to be a download, it's a good idea to fill in the HD+ subsort flag even if you don't have HD yourself.

Below are tables of the room and function values. For the HD subsort values, see the next section.

FlagDescriptionDec. valueHex value FlagDescriptionDec. valueHex value
FunctionSeating11 RoomLiving room88
FunctionSurfaces22 RoomDining room3220
FunctionDecorative3220 RoomBedroom22
FunctionElectronics88 RoomStudy12880
FunctionAppliances44 RoomBathroom44
FunctionPlumbing1610 RoomKitchen11
FunctionLighting12880 RoomOutside1610
FunctionMiscellaneous6440 RoomMiscellaneous6440

There is a more user-friendly way to simply make objects buyable: use Object Editor Light. This program, called "Light" because originally an enhanced version was in the works, should not be confused with Object Editor, a utility that has less functionality and is only suitable for doing things like altering catalogue prices. OEL has two drop-down boxes from which the room and function flags can be chosen (but nothing for added Hot Date categories) and some catalogue information; non-buyables don't usually have a category description, although I would rather fill that description elsewhere (see the next section). The function flag here is called "Type ID".

Of the subsequent fields, only the first price field needs to be filled, the second one can be ignored. Things like depreciation values have little meaning for items like food, although Sims may apply the "value judgement" (a routine which checks for current price, and uses the depreciation values) to a bought slice of pizza and go "it's not worth a lot of money, so I don't like it!" The object scores, lastly, have nothing to do with the object's effect on the Sims and are only there for the catalogue. For food, it may be appropriate to fill in 1 for Hunger.

IFF files can contain more than one object; if so, all objects that must appear in the catalogue have to be made buyable individually.

Some objects, like "TrashOutside.iff", may crash OEL. These are best edited with IFF Pencil.

By setting the flags, I can make absolutely every object buyable: babies, newspapers, even bills. Although why anyone should want to buy bills is beyond me. Also, the experimental buyable bills are hard to pay. (Bills are not the only object best left unbought. In Unleashed, I made seed packets buyable so that children could buy them. The result: a seed packet that lay around uselessly, because I had no way of getting it into anyone's inventory.) The items most commonly made buyable are food and essential files that can go missing, like mailboxes and the invisible pedestrian portal. To actually make the latter turn invisible when bought, some extra code is needed. Although it may be fun to have a visible portal that people can pop in and out of! (Reminder: the portals can only be bought after typing "move_objects on" in the cheat box.)

To make the pedestrian portals invisible, some code needs to be added to the "init" code block, number #4101 in the BHAV block. To get there, open "PedPortal.iff" in IFF pencil, click on "BHAV" in the left window, then on the line numbered "#4101" in the right window, and the editing window will open - we're ready to do some programming! In the left half of the editing window, right-click and choose "Add". A new line will appear, with some nonsense equation in it. Not a problem. Look at the line above it, line #7. This is the last line and its outcomes are True, Error. But now line 8 is going to be the last line, so select line 7 and change the True value to 8 by putting "8" in the True line field in the Data rectangle to the right. Then select line 8 and use the drop-down box (that's most convenient) to set line 8's True line and False line to, respectively, True and Error. In the Function field (topmost field of the data rectangle), fill in a "2" if it wasn't there already. Next, in the fields marked "Parameter 1" to "Parameter 4", fill in the following numbers in this order: 31, 1, 1280, 1795. (You can also fill in the eight squares below if you're feeling adventurous, it's the same four numbers displayed in hex.) And now, the writing for line 8 changes to something that suggests the portal will now be invisible.


It should end up looking like this. The parts edited are outlined in red.

18-04-2005: I found a much simpler way to do the same, although it doesn't really matter which method is used. The pedestrian portal, like other ancient objects, uses the OBJD table (as opposed to the OBJf table) to link BHAV instructions to common actions. One such action is "drop" or "placement", which is what the user does when buying an object and then putting it in place. The BHAV instruction for this is 4097:

The experienced hacker can see that the second and third line make the object invisible after placement, but also that the code exits after the first line! Both the first and third line end in "True,Error". Set the topmost outcome of the first line to "1" instead of "True", and the code will do what it's supposed to.

HD and higher expansion packs introduce new "visitors-only" neighbourhoods that have their own pedestrian portals. To make these buyable in the right neighbourhood, see Categories revisited. For the rest, they need the same treatment as the ordinary pedestrian portal, repeated as many times as there are portal objects in the IFF file.

I always make food buyable, but I skip some items. Raw food, whether for one person or a group, is very hard to prepare; a Sim really has to be persuaded to pick it up. If I give the order "Prepare" to a Sim who is standing several squares away from the food, the task will simply slip out of the cue. So I don't bother to get those items in the catalogue. Ditto hamburgers; if the Sim doesn't own a barbecue, they will disappear as soon as they are bought anyway. The best buyable food item is the pizza box - and since I can set the price, I can make it absolutely free!

Some objects that the makers never intended to be buyable - the mailbox and portals - have no catalogue description blocks. These can easily be added in IFF Pencil: choose Edit from the menu bar, then Add, then fill in "CTSS" (case-sensitive!) for the block, "2000" for its ID and leave the description blank. Then double-click on the newly added CTSS block in the left window to bring up the CTSS resources. Needless to say, there are none. Right-click on the right window, choose "Add" to create a new item; do this again, so that there is now an item #0 and an item #1. In the text field of item #0, enter then object's name; in the text field of #1, the object's description. Confusingly, the text field "description" has a description, too. The description fields will never be shown in the game, and can be made blank. The description should be set for all languages - see Wrong names/descriptions.





Back Previous Next