Custom Magazines

Magazines consist of TWO objects, the magazine that the Sim picks up and reads, and a simple object (known as the "rack object") that provides the thumbnail to display in the pop-up dialog when the Magazine Rack is clicked on.

While this adds complications to cloning a magazine, the biggest hurdle to creating a custom magazine is that the code to populate the pop-up dialog is hard-coded.

When a Sim is directed to buy a magazine by clicking on the Magazine Rack, the standard Maxis code looks for the known rack objects, creates them off-world if necessary, and adds them to the array that populates the pop-up.

This approach is neither multi-modder nor user friendly, each custom magazine is going to have to know about every other custom magazine, AND the user is going to have to make sure the most recently released custom magazine is loaded last.

While it is possible to iterate objects of a specific category already on a lot, it is not possible to iterate installed objects. However, the rack object magazines are very light weight, so having a few of them on EVERY lot is not going to cause problems. Also, the rack objects only ever exist off-world, so a Sim is never going to try and interact with them directly.

This means that we can make the custom rack object magazine a "global non-CAS SimType" object by setting in the OBJD entry 0x0009 (type) to 0x0007 (SimType) and entries 0x001A (Ignore GlobalSim field in CAS lot) and 0x002A (is global sim object) to 0x0001.

With the rack objects off-world on every lot, we can use "Set To Next, obj with category" to find them.

While we could mod all the standard Maxis rack object magazines to be "global non-CAS SimType" objects, this adds unnecessary overhead to lots, so we'll keep the hard-coded approach to adding those and add logic to differentiate a custom rack object. We can achieve this by using the Run Tree By Name (RTBN) primitive and adding a BHAV to the custom rack object that returns true. As RTBN returns false if the BHAV is not present on the object, we don't need to make any mods to the standard Maxis rack objects.

Taking this approach we end up with a stand-alone custom magazine that we can clone as many times as needed, and a common mod to the Magazine Rack that we only need one copy of but that every custom magazine can include (as all the copies will be identical).


Creating A New Magazine

To create a new magazine using the WH_CustomMagazines_PuzzlingPuzzles.package as a template, proceed as follows

  • Start SimPe
  • Select the "Object Workshop" tab
  • Click the "Open..." button
  • Select the WH_CustomMagazines_PuzzlingPuzzles.package file and click "Open"
  • Make sure the Task is Clone and click the "Set Defaults" link
  • Click ">>Next"
  • Enter a new Title and Description
  • Click "Finish"
  • Wait for objects to load (if necessary), then click "OK" to the "Scenegraph rename Wizard" dialog
  • Save as a new .package file
  • The new package file should have 35 resources, including TWO objects
  • Click on the "Plugin View" tab
  • If you want, manually rename the scenegraph chain, don't forget STR# 0x0085:0x03 and STR# 0x0088:0x00, and don't forget to check it! (Tools->Object Tools->Scenegrapher...)
  • Update the TXTR for the new cover
  • Update STR# 0x012D:0x00 for the tooltip when browsing (see the associated Desc)
  • Update the OBJD names and GUIDs
  • Change BHAV "CT - Get From Rack" line 0x00 to create the associated main magazine object
  • If the magazine is related to an interest, change BHAV "Function - Init" line 0x01 as necessary and BCON 0x1001:0x01 to 0x0064
  • Test in game

With a working clone of the template magazine, you can now add the menu options and associated BHAVs to implement whatever you want to happen when a Sim reads the magazine.

Hope these notes are of use to someone. Enjoy!