• Moose
  • Creating Custom Working Light Props


    Level: Advanced Please PM STomnibus if you have any questions about this article.

    This is a technical guide/tutorial on creating custom light props that actually light up in the game (at night).

    The tutorial assumes the following knowledge:

    • Familiarity with iLive's Reader utility
    • Understanding of the key SC filetypes, such as FSH and S3D files
    • A strong understanding of TGI's and IID's

    There are two parts to this document, a technical overview of the components involved in in game and custom light props, followed by a mini tutorial on creating custom lights. Some of this stuff is fairly complex, and there are some areas where it's easy to make mistakes, so I'd advise doing this stuff carefully and take a few backups. I had many frustrating nights trying to get it right.

    Thanks to Karybdis, Pegasus and the BSC team for help with this.


    When looking at the props we wanted to add to the Amsterdam Centraal Station lot, I found some funky blue lightpoles in front of the real station and thought they'd be great for custom lights in the game. I know smoncrie had played around with this a bit and written a brief tutorial. Pegasus has also been playing with custom light models. In the end I was able to create the lights I wanted, but it was a long process.

    Lights and LightCones, A Technical Overview

    Before jumping headfirst into creating custom lights, we need to look at the technical aspects of the Maxis lights and lightcones. If you skip this section and go to the tutorial, you'll get yourself into strife, guaranteed.

    Files and Relationships

    The following points describe the files used by lghts and their relationships:

    • To build a custom light you're concerned with two models, the lightpole which you would build in the BAT, and the light it "produces" (such as lightcone). You can refer to the supplied ones or copy the supplied ones and tweak to your liking.
    • Each model (e.g. lightpole and lightcone) consists of two filetypes; the FSH filetype (Type = 0x7ab50e44) and S3D filetype (Type = 0x5ad0e817). These are normally in a 1:1 relationship, one FSH file per S3D, but some S3D files share a FSH file (such as the standard MAXIS lightcones).

    • Each model will have either one (1) FSH/S3D file pair or twenty (20) FSH/S3D file pairs. The BAT will produce twenty (for each of zoom 1-5 and each direction combination). Some MAXIS models only have one pair of FSH/S3D files. This is usually where the model looks exactly the same in each direction and zoom level (such as the lightcones which are basically a spherical shape and look the same in each direction).
    • Prop exemplars refer to the S3D file (either the single one if there is only one or the ****0000 IID one if there are twenty of them). This is done through the Resource Key Type 4 exemplar property. If this points to an invalid model, you will normally get the brown box.
    • Each S3D file refers to a FSH file (or "texture") through its Material ID (under the Mats tab in the reader). If this points to an invalid texture, you will get a box in Red/Blue/Green.

    GID's and IID's

    For the lights to work in both day and night, all models (both the lightpole and lightcone) must use a GID of BADB57F1 (0xbadb57f1). If you don't for custom lights, you may see what you're expecting during the day but at night you'll either get the brown box or an unexpected model.

    Because you must use a GID of BADB57F1, and only the first four characters of the IID are used as a unique reference (the other four are used for zoom and rotation) you have to be really careful when allocating IID's. There seem to be great chunks not used by MAXIS (3***, 5***, 7***, b***, d*** and f*** based on a quick check of the simcity_*.dat files). I've been using 4DE*.

    The Standard MAXIS Lightcones

    MAXIS provide four lightcone models:

    • 0x5ad0e817,0xbadb57f1,2cb70000 - a large cone approx. 13m high, radius at base of 4.5m
    • 0x5ad0e817,0xbadb57f1,2cb80000 - a medium cone approx. 10m high, radius at base of 3.5m

    • 0x5ad0e817,0xbadb57f1,09c6e584 - a smaller/flatter cone approx. 6m high, radius at base of 2.5m
    • 0x5ad0e817,0xbadb57f1,29da0000 - a small globe of light as used with the $ lights

    These are shown below against a 10m x 10m grid.


    These S3D files refer to one of two textures (FSH files):

    • 0x7ab50e44,0x1abe787d,09c6e584 - lightcone; used by 2cb70000, 2cb80000 and 09c6e584
    • 0x7ab50e44,0x1abe787d,ea89e9ee - globe of light, used by 29da0000

    Building Custom Lights

    There are three stages to creating custom lights; create your own lightcone models (optional, you can use the supplied ones), create your own lighpole models, and putting them together.

    Creating your own LightCone Models

    Theoretically it's possible to create your own complete lightcone model (i.e. create the S3D + FSH files) but it would be a lot of work. The simplest way is to use the existing MAXIS lightcone models and tweak the FSH file.

    You will need custom light models if you want different light colours (as Peg has done with his Peglites). Also if you are going to use multiple lightcones on a single light that will intersect, you might want to reduce the brightness of the light (otherwise you'll burn your eyes out looking at the intersection of the lightcones).

    You will need to copy both the MAXIS S3D and FSH files into your own .dat file (reader). You need the S3D file as it refers to the FSH file. You use the normal FiSHman and image editing tools to change the FSH file and upload it.

    You will need to ensure you set the GID of your custom files to BADB57F1, the IID's to something unique (within the BADB57F1 set) and that the Material ID points to your custom FSH file.

    Creating you own Lightpole Models

    This is just standard BAT work. Two things to remember:

    1. You should make your poles equivalent to the light model sizes (i.e. approx. 11-12m tall, approx. 8-9m tall or 6-7m tall).
    2. If you are going to have multiple lightcones hanging off a single pole, you will need to know the X,Y co-ordinates of the light sources (bulbs) in your model.

    Once you have exported the model from the BAT and created the model as a Prop in the Plugin Manager, you will need to go through every S3D file and FSH file in your .desc file and change the GID to BADB57F1 and the IID to a unique value (same unique value for all files). You will also need to go through the S3D files and set the Material ID to be the unique ID you have set for these files. This is a critical step and it must be done correctly.

    Putting it all Together

    The key to putting it all together is the prop exemplar file. There are two properties you must have:

    • Nighttime State Change - 0x01 means "change to state 1"

    • Resource Key Type 4 - this replaces the Resource Key Type 0/1 that is the default for single state/single model props. Resource Key Type 4xm is used to tie changing props to game activity (such as traffic lights). I've removed it and the props seem to function ok.

    The resource key type 4 contains a variable number of sets of values. Each set contains eight Uint32 values. Each set of values represents one model (such as lightpole or lightcone) and state (daytime = 0, nighttime = 1) combination. For example a light with three lightcones would have five sets of values (i.e. fourty all up):

    • SET1 - reps 1 - 8 - nighttime model for lightpole
    • SET2 - reps 9 - 16 - nighttime model for lightcone #1
    • SET3 - reps 17 - 24 - nighttime model for lightcone #2

    • SET4 - reps 25 - 32 - nighttime model for lightcone #3
    • SET5 - reps 33 - 40 - daytime model for lightpole

    An example of this is shown below:


    Each set of eight values contains:

    • the first REP is day (0) or night (1), although I think the values can be different things, because there is the Nighttime State Change property that say's "at night time use state A" (where A is normally "1" corresponding to the value of the first rep).

    • the second, third and fourth reps are the X,Z,Y represent the offset from the centre of the prop.
    • the fifth rep will be either:

      • 0x27812820 if there is a single S3D file for the prop/lightcone etc. which corresponds to Resource Key Type 0, or
      • 0x27812821 if there are 20 S3D files (for combinations of N/S/E/W at zoom 1 - 5) which corresponds to Resource Key Type 1.

      [*]the sixth, seventh and eigth reps are the T,G and I values for the prop/lightcone.

    To work out the X,Z and Y values, you need to convert from Hex to Decimal and then divide the number by 16^4 (i.e. 65536). For example, the $StreetlightDiagonalAVE_2CC1 uses two lighcones (5ad0e817,badb57f1,2cb70000) with the following dimensions:


    From what I've seen the Z value refers to the height of the cone base above the ground.

    So my example above using the custom lightcone of 4DE00000 has the following X,Z,Y values for the lightcones (rep #2, #3 and #4):

    • #2 .63m, -1.5m, 1.12m
    • #3 .63m, -1.5m, -1.12m
    • #4 -1.3m, -1.5m, 0m

    Here are three lights I created for the Amsterdam Centraal Station lot (day and night views). There are actually three light cones per light pole.



    That's pretty much it. If you have any questions, PM deadwoods or email at st_deadwoods@optusnet.com.au.

    If you have any further questions about this article, please PM STomnibus.

    1 person likes this

    User Feedback

    There are no comments to display.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an Account  

    Sign up to join our friendly community. It's easy!  :thumb:

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

  • New Articles

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Featured Topics

  • Recent Modding / Content Posts

    • I'm going to bump this because I need help also, but have some more insight to provide. I installed GMax, then tried to install BAT and it keeps telling me that SC4 Deluxe does not appear to be installed. I have the original CDs for SC4 Deluxe but they have been scratched horribly and since it is a pain in the butt to find locally, I bought the Digital Download from Origin...because at the time I did not want to order it online and wait for shipping what/not. Here is what I know, and tried although it has still all been unsuccessful.  I uninstalled SC4D entirely due to the "Origin\" install folder, and i cleared out any leftover data from the "Origin\SC4" install folder and also the "MyDocuments\SC4 folder".  I updated the settings in Origin so the Default Installation folder would be Maxis\ instead of Origin\.  So when I reinstalled it, now it is in "Program Files (x86)\Maxis\".  Then I tried to install BAT again, but still got the same error.  For giggles, I uninstalled it and wiped the folders again and launched the install from the CD.  Here is what I noticed.  While the CD installs to "Maxis\SimCity 4 Deluxe", Origin installs it to "Maxis\SimCity 4 Deluxe Edition".  So after a couple minutes, as usual, the install crapped out due to the damage on the CD which I expected.  I cleared the folders again and did another reinstall from Origin.  After it completed, I renamed the "SimCity 4 Deluxe Edition" folder that Original created to "SimCity 4 Deluxe" to match where the CD would have installed, tried to install BAT, and still got the same error. At this point, I am at a loss.  I figured that folder rename should have solved the problem, but I guess it goes deeper.  Maybe instead of looking for a file or folder on the hard drive BAT is actually looking in the Registry?  I will try and play with that later, but was wondering if any of this could bring light on the problem for someone here to identify a resolve.
    • Maybe you can post your questions in your BAT thread or the BAT Troubleshootin thread instead of opening a new topic every time. About your question, my approach would be just to try out different textures I can find on the net, maybe game related textures create most this effect you are seeking.
    • Cool building! So, is that name indicating that the overhang will be over a highway passing under it?
    • Very unique! We need more buildings in the game that aren't orthogonal squares and rectangles.
    • Pathing and historical prototypes I've worked out the elevated heavy rail lot's pathing issues and it is quite a nice feeling to see the props collide with the tunnel. Strangely, the trains don't derail at all. I'll increase the tunnel height to clear the double stacks. Using "Modern" clearances as opposed to "Classic" or "Old Time", in model railroader terms. I would never have figured any of this out without the following resources: ST thread for the introduction to concepts: SC4D wiki for important implementation details: http://www.wiki.sc4devotion.com/index.php?title=SC4Path_Format @MandelSoft's tutorial section on SC4Paths: http://sc4devotion.com/forums/index.php?topic=11023.msg329941#msg329941 SimsWiki on LotConfigPropertyLotObject syntax: http://simswiki.info/wiki.php?title=LotConfigPropertyLotObject I also want to share this amazing prototype, the St Johns Park Terminal to Manhattan's High Line. This is an elevated freight rail station several NY city blocks long. The air rights on the property are currently bid up to $50 billion so there is little chance it will be preserved. It's on my list to BAT, though. My direct inspiration for the transit lot is industries like Merchants Refrigeration Company: This packing company on 14th St. Notice the line enters each building around the third floor: This unidentified building on the High Line: And especially the Nabisco plant: Bonus historical shots from Boweryboys of completely bonkers street running in the Roaring 20s: the "Avenue of Death", no kidding. Notice how many horses are still on the road. Most commercial traffic had motorized here by the end of World War I. And very VERY early elevated rail: Final style note for NYC-style viaduct rail architecture: the High Line was constructed during the Art Deco period, but it modified many older buildings.