Jump to content
  • rsc204
    rsc204

    How to create MMPs

    Preparation

    Starting out you will need a template exemplar and ideally, your own MMP ID range to work with. MMPs have a limited range of IDs, so it's imperative to ask for an assigned range if you later want to share your creations and avoid conflicting with other MMPs.

    You can ask for a dedicated ID range here (SC4D)

    I've uploaded here templates that I made for my own MMPs, in essence these MMPs have their modding based off BadSim's MMPs, which for my money are the best around. It's a bit complex to explain why, but at their core, they reserve little space, meaning in practise your MMPs will be more flexible and usable. Say I've made a path and loads of flora with MMPs, but then want to add a person (actually, I'd add the person first), but the way these are modded give the maximum available "free space" to make this possible.

    MGB's MMP Template.7z

    The best way to work with MMPs is to be organised. Having all the related data in one place whilst working and doing things in a specific order, will both make this process easier and less prone to error. MMPs are not particularly complex, but a single typo or ID error can lead to a lot of frustration, so it's best to start off steadily. I prefer to set up a spreadsheet, listing the MMP IDs, Model IDs and other relevant information. You can also use such a sheet to keep a track of your IDs and which have been used, which trust me you'll be glad you had if you make more than a handful of MMPs.

    MMPTut_BePrepared.jpg.cf2e2e4b9b82576fe9fb565a2338e347.jpg

    The above example shows the spreadsheet I use to keep track of my MMP IDs and help with the modding process. At this point I invite you to take a quick look at another of my tutorials,  how Hex Number Ordering works. In Part II, there is a link to a template spreadsheet you can use for the same purposes. The biggest benefit is that by entering just the first valid ID from your assigned range (will always end 0000), the first 4,096 IDs of your range will be auto-populated. For those that want to learn more about Hex, ID Schemes and Assigned ID ranges, there is hopefully a lot of useful information too.

    In the past I have seen many examples of modders that clearly didn't implement sequential IDs, in some cases that ends up jumping in increments of thousands of IDs for just a handful of items. Not only is this inefficient, but if you need to re-ID everything later it's going to create a lot of work, so it's best to get a handle on this up front. Otherwise, simply use the template provided and it will handle this part for you.

    Back to the example above, note it starts with the MMP's IDs, each MMP (single-stage) or Stage (multi-stage) must have a unique ID, i.e. one for each Model you are making Ploppable.

    Next I have columns listing the Item Name, along with the Dependency, where I list the filename the model comes from.

    That last column RKT1/4 relates to the ID of the model we want to display, Resource Key Type is the name SC4 uses for such links. Generally speaking, most MMPs are going to use RKT1 or regular BAT models, which have 3x8 digit Hex IDs, the Type, Group and Instance ID. If you are making your own SC4 Models (BATs), the IDs for them will actually be part of the filenames. Downloaded SC4Model files may have this, if they were not re-named, however and especially in the case of DAT files or PropPacks, you'll need to get these by digging around in Reader. Thankfully this isn't as hard as it might seem, we can open a file, in this example SG's Mega Props, then find the IDs of all the Models for your MMP. Open the file in Reader, then click on the Analyser button, from this window click Search:

    MMPTut_Analyser.jpg.16722e862fc9fd56a6ff43494d185bac.jpg

    It filters out only the Exemplars, which are listed by Exemplar Name, making things much easier to find. Look for the Resource Key Type 1 (RKT 1) Property (or perhaps 4 - note these are special cases I'm not getting into here). Open this Property and then copy/paste the ID into your Spreadsheet. Now you've a reference you can use to easily identify what Models you will be using and you can re-arrange and get things in order, BEFORE you start modding. If the names aren't enough to identify a model, open the Lot Editor (in PIM-X - recommended), and use that to cross reference the Exemplar Names whilst being able to view the model. 

    If on the other hand, you have ID'd SC4Model files, you can just copy/paste this data from the file names into the spreadsheet. In fact you can speed that process up considerably with a little automation...

    Spoiler

    Create a new temporary folder and stick in it all the SC4Model files you want in your MMP. Open a command prompt, goto this folder and type the following:

    • dir > list.txt

    This will create a file "list.txt", which contains the filenames of every item in the current folder. Now you've a list of IDs to copy/paste from in one place. If you do a little find/replace to remove all the funny characters using a smart tool like Notepad ++, you can even edit the whole in a few steps, so you could copy/paste everything in one go into a column of Excel or similar. Very time-saving for large numbers of files.

     

    Single or Multi-Stage MMPs

    First off, you need to decide if you want a Single-Stage or Multi-Stage MMP. A Single-Stage MMP contains only one Model*, you click once and it places the assigned Model.

    *Note that saying Prop would be incorrect here, since a Prop is type of Exemplar, that links to a model. Whereas we're making a "Flora" Exemplar, which links to a model. Whilst people commonly refer to such things as Props, there is an important technical distinction between the two.

    The attached resource contains a template .dat for both types, technically they are the same, but each needs different Properties to function as intended.

    Single-Stage MMPs
    For the Single-Stage MMP just follow the steps under MMP Base Model under the Multi-Stage MMP instructions. The key differences being that it won't use any of the "chaining" Properties, nor will you need more than one Exemplar.

    Multi-Stage MMPs 
    You can think of a multi-stage MMP as having three basic "parts" that function as follows:

    • MMP Base Model
      The first Exemplar has some additional Properties that relate to it's placement in the menus. It also needs a matching PNG icon with the same IID and linked LTexts for the Name/Description (If these aren't there your MMP will fail to appear in-game).
    • MMP Additional Models
      Much the same as the Base one, just without the 'placement' Properties. Every stage in the chain (i.e. each model except the First and Final one), must have one such Exemplar.
    • MMP Blank (Final) Model
      Again this is based on the same Exemplar as the first two types, but this time with even less Properties, because the 'chain' stops after this Stage is placed. Note that I prefer to use a "Blank" model for this final Stage, achieved by simply removing the RKT 1 Property entirely from the Exemplar.

      The purpose of this, if a user went through all the various "Stages", but wasn't happy with the results, the last click makes the Model Disappear entirely. This can be handy when bulldozing the tile would be undesirable. Note too, you can make one such Exemplar (the blank), and re-use it with the same ID for every new MMP you make. This is just a more efficient use of both IDs and resources, OK yes minor considering everything, but I was educated to optimise everything relentlessly where possible. As such, you don't even need a spare ID here, just re-use the included one as-is if you want.

    So let's imagine an example of an MMP which contained 3 props, let's say it's three chickens. The first "Base" exemplar would link to our first chicken model, it would also link to the Icon and LTexts that appear in the MMP menu. It would then need 2 "Additional" exemplars, for the 2nd and 3rd chicken and a "final" exemplar, which could either be the Blank model or if you prefer not to use such, the 3rd chicken model would be the final one. In-game you'd select the Chicken's MMP, the first click would show chicken #1, the second chicken #2 and the third would show #3, optionally (depending on how you mod things), a 4th click would then show nothing.

     

    Creating your MMP using Reader

    So armed with your data, you should have an idea of how many and which objects to group together at this stage. It's important to have a clear picture of how you want your MMPs to work, because it will take much work to change things afterwards.

    Before we start though, a little housekeeping, we need to change the template ID's to the range you've been assigned. I've used 8888#### in the templates for all IDs, you MUST NOT re-use these, that creates many potential problems.  Using the TGI Editor (under Tools in the File Menu), we can quickly adapt the template file to your range. So for example, if you were assigned the MMP ID Range AE23, the following edit would be necessary:

    MMPTut_TGIEditor.jpg.5773bd704ee4e0e2cb5e432ab79d9475.jpg

    A good tip is to open both template files and give them your MMP Family (the first four digits that every one of your IDs will use). However, other properties also need changing before this file will serve as a suitable template, so we'll come back to this later.

    For now, let's have a look at the contents of the template file, I've colour-coded the entries to break things down:

    • Green: This is the Base Exemplar and it's related files, all use an identical IID.
    • Yellow: These are the Add. Model Exemplars, ID'd in sequence from 1 through F (15 total).
    • Red: This is the Blank Model, if using it, DO NOT alter the ID of this object.

    For reasons I can't explain, the TGI editor is in reverse order from the main window, so caution there. In this example we're only changing to your assigned range, which covers the first four digits of the ID. But this will only work once, after that you'll need to edit these differently, based on the ID's you are using. If you create a spreadsheet, you'll always have a good overview.

    I'm going to stick to using blocks of 16 IDs at a time for the purposes of the tutorial. If you run out of IDs, you may need to come back and make use of those in the gaps later, but this is not likely. Of course ending in 000# only works for the first 16 IDs you use, the second block would be 001#, then 002# and so on. After using 00F#, next is 010#. Hence blocks of 16 IDs allow you to set all the IDs with the fewest number of and simplest edits. Eagle-eyed folks will notice I did not do this in my Spreadsheet, I used each ID in sequence regardless, if you are organised this is just slightly more optimised. Likewise, you could go mad and link ID 0000 to F5A6, which then linked to 28E9 and so on, it will work provided the IDs are correct, it's just much harder to do and keep track of. Try not to focus too much on the theory of this, as you work through this tutorial, come back and read this again, I promise it will make more sense.

    So whilst I'm working with blocks of 16 items, you can add/remove Exemplars or Stages you do/don't need, but by using #Blocks of 16 IDs, it'll make things a lot simpler. If you want more Stages/Models, use the Reader's "Clone" function with the LAST Add. Model exemplar (IID ending F) selected. Simply right click that entry, then select Clone File.

    MMPTut_Clone.jpg.e3184a081ce90cbf1a38396e7919b0f7.jpg

    Always use an Increment of 1 for the Instance ID, this will at least ID all the Exemplar's correctly. Under number of Copies, you can Clone as many Add Model Exemplars as you need in one step.

    Likewise if you need less than 16, remove the number of Add. Model Exemplars you don't require, but do so from the end. In other words if you need say 12 stages (Exemplars/Models), keep those ending in 0 through B (12 in Hex, remember 0 is a number), by removing C, D, E and F. Doing it this way is going to allow the template to make things simpler for you, when you have to manually edit and link all these IDs later.

    So now the Exemplars themselves are (hopefully) correctly ID'd, it's time to start editing their Properties so they will all link together and function properly. Start with the Base Model (or first) Exemplar. Once again, we're going to use the Analyser to save ourselves some work, click on Find a Property (yellow circle), then find User Visible Name Key in the drop-down box and click Find. Highlight all the items in the list that appear, then click Edit:

    MMPTut_BatchEdit.jpg.6ebc827d32e3d264448062276b6ad710.jpg

    Make sure the IID is the same as your Base Model's Exemplar and press Enter on your keyboard, double check they have been correctly updated.

    Next, every Item of your MMP has an Item Name, which will appear both in the Menu and when querying items from the MMP in-game. If you don't want the latter, you can safely delete the User Visible Name Key Property from each of the Add. Model Exemplars, but you must keep this for the Base Model.

    Back to the main Analyser window, select the Base Model Exemplar and give the same IID to the following Properties:

    • Exemplar ID
    • Item Icon
    • Item Button ID
    • Item Description Key (just the IID should need editing)

    These properties all relate to the MMP's menu entry, next we need to edit the Properties that make MMPs chain or link together. Flora: Cluster type.

    Back in the main Reader Windows (we're done with the Analyser), select the first Exemplar and edit the Flora: Cluster type ID, giving it the ID of the next Exemplar or Stage of your MMP. To keep things logical, if we start with ####0000, the next will be ####0001. It's this Property that tells the MMP which Exemplar to use next, this chain continues throughout all the Add. Model Exemplars, until you reach the last of them, which should ALWAYS link to FFFF0000 if you are using a Blank Model. If you prefer not to, delete the Blank Final Model Exemplar and remove the following Properties from the last Add. Model Exemplar in your chain:

    • Flora: Cluster type
    • Flora: Cluster max radius
    • Flora: Cluster max height

    Essentially those three Properties are what continues MMPs chains, the first Exemplar without them becomes the "last click" of your MMP. Single-stage MMPs don't need these Properties at all.

    Continue this process going through all the Add. Model Exemplars, editing both the Exemplar ID and Flora: Cluster type IDs. Again using our logical ID system, the later will always be 1 higher than the former, which matches the actual ID of the Exemplar itself. I like to do the editing of these Exemplars one task at a time, I find it creates less errors and tracking those down later can be very annoying.

    Now you should have all the ID's setup correctly, it's a good time to save a copy of the modified template, so your future MMPs will already have your family IDs setup. You of course only need to do this once, but suffice to say it will make to process of making subsequent MMPs easier, since the template file is now adapted to your personal range.

     

    Linking MMP stages to models

    Now for every Exemplar, we must go through and edit the Exemplar Name properties. Technically this is optional, the names never appear anywhere, but if you need to come back to your .dat later, not having this is going to make life harder. But we can take the load off a little, so let's say you have 10 different "groups" of people, each will have their own MMP. One of those groups is "Orange Vest People", let's use the Analyser again, to mass-edit those names. Same principle as before, only now we look for Exemplar Name to edit. So add your own name, a good routine for all modding, along with a description of what the item is. For example I might add "MGB_" as a more general prefix to any Exemplars I make, but let's say I am making an MMP full of benches, I could use "MGB_Benches_". The purpose of structuring things this way, is that I could then use these prefixes as templates, so you only have to manually add a small part to each name. For example:

    "MGB_Benches_1"
    "MGB_Benches_2"
    "MGB_Benches_3"

    or

    "MGB_Benches_LargeGreen"
    "MGB_Benches_SmallGreen"
    "MGB_Benches_Black"

    This is a lot less effort to enter the names, when the first part is already there for you.

    Next it is time to link each Exemplar or stage to the model we want to be displayed, this is handled by the RKT 1 Property. Typically SC4 Model files always use the following ID format:

    0x5AD0E817,0x00000000,0x00030000

    The first (red) value is the Type ID, which remains constant since it identifies a model. The second (black) is the Group ID, this is typically unique for each model file. The third value (red), assuming the Group IDs are unique, should be constant too. Since the IID in SC4 Models is used to define things like the day/night, rotation, zoom and other texture values. Again assuming all this is the case for the models you are working with, you only need to change the Group ID when editing the RKT 1 property. Being able to copy/paste these values from a spreadsheet makes building the MMP pretty quick.

    If the IID of a model is not 0x00030000, that simply means you will need to both copy the GID and IID. I believe this most typically occurs when the SC4BAT Texture ID fix had not been correctly installed when using SC4 BAT. So if you are making models, ensure you've downloaded this fix from the Maxis Files section of ST or elsewhere.

    I'll also note you can make use of other RKT types, 0 and 4 both work fine with MMPs and everything within the Flora Exemplar of the MMP is otherwise identical and they work just as they would otherwise as Props. This isn't really the place to get into timed/seasonal and full 3D props though.

    So now you should have a fully functioning MMP and it's time to test it in-game, don't forget to save the file first. With any luck, it'll work the first time. I can tell you from experience it did not for me, one typo can break everything and errors can be difficult to track down (time-consuming). So starting out, work slowly, do everything methodically and double-check things as you edit them. Once you get into the flow of this process, you can produce MMPs quite efficiently, maybe in around 10 minutes from start to finish.Don't forget to add a nice new (suitable) Icon and edit the LTexts ;). Also be careful to keep their IID the same as the Base Model Exemplars.


      Edited by rsc204  

    • Like 2
    • Thanks 1

    Sign In to follow this  
    Sign In to follow this  

    User Feedback


    There are no comments to display.



    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

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

    Register a New Account


  • Recently Browsing   0 members

    No registered users viewing this page.

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections