1. If you are going to register on XLNation, please make sure you do not use a proxy server.
    If you use a proxy server your registration will most likely get blocked due to spammers and hackers using proxy servers to hide their real IP address.

    If your using your home or work IP address and have not received your registration email, check your spam folder.
    PLEASE DO NOT ASK TO HAVE YOUR ACCOUNT DELETED IF YOU HAVE POSTED IN THE FORUM! If so we do not delete accounts due to the mess it can make on the forum.
    Dismiss Notice
  2. Please see the following thread for more information
    XLN's future is looking kind of grim

Tutorial Modding for dummies: Small collision, no collision and OWP

This tutorial teaches you how to make a simple mod

  1. Ole
    Modding for dummies-first tutorial of the series

    IMPORTANT INFO
    I've heard questions about this and I though, let's get this clear:
    -your mod ONLY exists from the class files, no need to add the ddstextures, layout files, sgbins and localizations
    -if there is no <GroundType>ANY</GroundType> in the <placement> section, add it yourself
    -don't use windows notepad for your mod, use Notepad ++ instead (and make sure the coding is set to ANSI in the coding menu in Notepad++)

    Question test results:
    [​IMG]
    As you can see, the NO collision box mods work, except that they say they aren't connected to the road, I've updated that part of the tutorial to fix that.
    The third building is the suggestion of Lextacy to use a collision box of 0,80 meters, which has the extra that even when the two buildings are exactly on eachother, you can place them though eachother. And you can place the back side through for example roads now. Here's an example:
    [​IMG]
    The German Pack building has a collision box of 1,40 and the hotel a collision box of 0,80
    I hope the 0 meters wide collision box will work for more buildings, time will tell, I'll keep the 1 meters wide collision box in the tutorial in case the 0 wide doesn't work for all buildings

    This tutorial might seem hard with all the code, but it's the easiest you can get with modding.

    This tutorial is about making buildings small/no collision and Over Water Placeable
    ATTENTION: A mod like this with just one or a couple buildings isn’t enough to be uploaded on the XL Exchange. If you want to make a mod that is, you should make a pack with more than 30 buildings with a small collision box or OWP
    Be aware that your mod could be in conflict with other mods if it adds a small collision version of the SAME building.
    Making a small collision/ OWP version of a MOD can be a bit different, so pay attention and always test it before you share it. Some modders won’t be glad if you make a new XLEX entry for your addon, if the modder is still active please discuss before uploading.

    Requirements:
    -Pakunpak
    - Notepad ++
    -unpacked Cities XL

    First, make sure you have all cities xl game files unpacked. There are other tutorials on this site that explain how to do that in more detail, I will give a quick explanation below:
    Register or to view Spoiler content!
    If you open data folder inside your unpack folder, it should look like this:
    [​IMG]
    This time, we are interested in the design folder, you can open it now.
    When you open it, you see a shitload of folders, don’t worry about it. Basically we’re just interested in the “buildings” folder, you can open it.
    Okay, okay, just as much folders as the previous one, and this time we’re interested in almost every one of them.
    Now the hard part, finding the building that you saw in game, the one you want to be small collision or over water placeable, maybe even both. If you remember the in-game icon, you should open a new tab and go back to the “data” folder again. This time you’ll click interface and then ddstexture. If it’s a normal building, click buildings. You’ll see a list of pictures, if you can’t see the pictures, even with the ‘big icon’ mode on you should find yourself a “dds” viewer, because these pictures are .dds .
    Text explanation
    If you have found your building in the icon list, cope its name and go back to the folder you had already opened. This folder is full of .class files, and if you search for the name of that dds icon you found, a class file with the same name will pop up, open it.

    Picture explanation
    [​IMG]
    Next:
    [​IMG]
    COPY^^
    Then:
    [​IMG]
    Next:
    [​IMG]
    When you open the class file you’ll see a lot of code, we’re interested in a couple of sub-sections of the code:
    Text explanation:
    The first section we’re interested in is the menu location, aka the tag. Changing this is needed for both over water mods as small collision mods. This is a code line that tells the game where to show to model. Browse the file for a code that looks like this:
    Code:
     <Tag>Commerce;Hotel;T4;MS18;GemCity;PRIVATE;UnqualifiedWorker;HolidayHotel;NOZAC</Tag>
    Except if you want to change it to a whole other location, it’s very easy: Change MS18 to MSNOCOLLISION if you want it in the small collision box menu or change MS18 to MSOVERWATER if you want it in the OWP menu. If you want it in the custom content menu, change MS18 to MSCUSTOM.
    BE CAREFUL: You HAVE to change this, you won’t be able to see which one is no collision/OWP or the real version if you don’t

    Now to the next step:
    Small collision:

    Go to the <collisionshape> part of the file, what looks like this:
    Code:
     <CollisionShape>
                <Dimension>60,80</Dimension>
                <Height>69.59999847</Height>
                <FundamentHeight>40</FundamentHeight>
                <Use>1</Use>
            </CollisionShape> 
    The code tells us that the building is 60 meters wide by 80 meters long by 69,5 meters high. We don’t have any problems with the height, except if you want the building to go through something like a bridge.
    continue in the SMALL collision box or the NO collision box spoiler
    SMALL collision box:
    Register or to view Spoiler content!
    NO collision box:
    Register or to view Spoiler content!

    OWP
    Register or to view Spoiler content!
    Now, for both the OWP and the small/no collision mod, add something to the description part of the name of the class file. Don’t change too much though, and make sure that it’s a unique name, and there isn’t another file called like that, or will ever be. (The description part is the part before _t1/_t2_/_t3/_t4
    For example, change b_hotr04_t3.class to b_hotr04OLE_t3.class
    Save your changed class file to a new “mod folder” (a mod folder is a folder called data inside a folder with any name)
    My new mod folder for this mod looks like this:
    D:/myfirstmod/data/design/buildings
    The design and buildings folders aren’t mandatory, but I strongly advice to use them.
    [​IMG]
    Now the last step, export it to the game:
    Open pakunpak and select the data folder in the source tab. Select a save location for your mod, call it something like [your name]_[name of the mod]_v1.0.patch.
    Then hit compress
    [​IMG]
    If you haven’t done it yet, place back the mods your moved before unpacking CXL and place your new mod in the paks folder too.

    Results:
    [​IMG]
    As you can see, the building is now fully OWP and has a small collision box

    Pre-requisites for your mods:
    -UIM

    Tutorial files and the mod I made:
    http://sharesend.com/wklqizoo

    Extra info
    -If you want a pack of OWP/SC buildings, you can put all class files together in one patch file. (so just place them all in your “mod folder”.
    -if the game crashes when you try the mod, and you get this error in your log:
    Code:
    XML ParseError, while parsing "ï": 
    make sure the coding is set to ANSI and not to UTF-8 BOM
    -if you’re getting an error while packing in Pakunpak, try to run it as admin
    Lokentaz, Monty, kipate and 4 others like this.

Recent Reviews

  1. Andrea Simone
    Andrea Simone
    5/5,
    Thanks for sharing, useful!
  2. Miguel
    Miguel
    5/5,
    Thanks for sharing this tutorial. Very well explained.
  3. Peter912
    Peter912
    5/5,
    A very useful and simple tutorial!