Results 1 to 3 of 3

Thread: [Guide]The new SMM

  1. #1
    Meneth's Avatar I mod, therefore I am
    Join Date
    Jul 2010
    Location
    Oslo, Norway
    Posts
    5,531

    Default [Guide]The new SMM

    Gracul has made a new, improved Sub-mod Manager. It is currently still in beta, but is included in MSC.
    Due to its improvements, many more sub-mods can be made compatible with each other.
    The format has changed some, however, so old sub-mods will no longer work with it. They have to be updated to the new format. This is however a pretty simple process, and the point of this guide is to provide modders and wannabe modders the information needed to utilize the new SMM.
    New campaign format
    Campaigns.ini no longer exist. Each campaign instead have to have a file in their folder named campaign.txt, which currently has a single section: name
    This section tells the SMM what the name of the campaign is, and without this, the campaign won't show up in the SMM. Here's an example:
    Code:
    [name] Early Campaign
    New sub-mod format
    The SMM now has several more sections and commands for sub-mods. There's four sections that have to be present: name, description, files, and works for.
    [name]
    Tells the SMM what to display as the sub-mod's name:
    Code:
    [name] One Settlement Type
    [description]
    This section tells the SMM what to have as the sub-mods description.
    Code:
    [description] OST makes it so there's only one settlement type, which can produce all the buildings and units in the game.\n
    This enables a much higher degree of freedom.
    Note that line-breaks are written as \n. Without those there will be no line-breaks, even though Return is used.
    [works for]
    This section tells the SMM what campaigns the sub-mod works for. Campaigns are separated by spaces. Unlike how it was with the old SMM, one can now use "all" in this section to make the sub-mod toggle-able for all campaigns.
    Code:
    [works for] early late
    [grouped in]
    Tells the SMM what group the sub-mod is in. Sub-mods in the same group cannot be enabled together.
    Code:
    [grouped in] AI
    [checked]
    You don't write anything in this section. Merely having it in the file means that the sub-mod will be enabled by default.
    Code:
    [checked]
    [required]
    Tells the SMM that a sub-mod from the group the sub-mod in has to be enabled. If none are enabled, the SMM won't let one apply sub-mods. Like [checked] one doesn't write anything in this section.
    Code:
    [required]
    [files]
    Where all file-commands are put. More on this in the next section.
    File commands
    In the old SMM, there were no commands. It'd just overwrite the file in question. The new SMM however has several commands. Note: all text taken from somewhere with a command is taken from one of the files in the sub-mod's folder.
    append
    One of the most useful commands. This command adds all text from one file, at the end of the other file.
    Code:
    append data\export_descr_character_traits.txt with triggers.txt
    It can also be set to append the text before or after a specific point in a file.
    Code:
    append data\export_descr_character_traits.txt with traits.txt before:
    ;===============================================================
    ;== SS TRIGGERs START HERE ==
    
    append data\descr_campaign_db.xml with castles_off.txt before:
            <standard_soldier_limit uint="1000"/>
    It is important that you put a line-break after the section, as that tells the SMM that the next line is a command, not some line of text in some file.
    overwrite
    This works like the old SMM did. It simply overwrites one file with another. If the file to overwrite with isn't specified, it'll default to the file with the same name as the file to be overwritten.
    Code:
    overwrite data\descr_faction_standing.txt
    overwrite data\export_descr_buildings.txt with export_descr_buildings.txt
    replace
    This replaces one section of text in a file with the text from another file. One can either replace a specific block of text (like with appending, you need a line-break at the end)
    Code:
    replace example1.txt with example2.txt on:
    This is a line of text
    Or you can replace everything between two strings.
    Code:
    replace data\world\maps\campaign\imperial_campaign\campaign_script.txt with example3.txt from: 
    script 
    to: 
    end_script
    Translate
    Last, but not least, there's translate, which is used to change text without the risk of breaking anything. To have this work, you need to have a file named the same as the file you want to translate. Include all lines you want edited in that file, with your translation applied. The code you use for the SMM is quite simple.
    Code:
    translate export_unit.txt
    It'll translate all entries you've set it up to translate, and it won't touch the stuff inside {}, so it should never break anything.
    One major difference
    Unlike with the old SMM, you don't need to include the whole of the file you're editing, just what you added. When using append or translate, one only needs to include whatever one has added, and nothing else. Overwriting still works the same as in the old SMM, though.

    If you feel anything is missing from this guide, or you're having trouble getting something to work, post here or PM me.

  2. #2

    Default Re: [Guide]The new SMM

    Unless someone with more knowledge and testing proves me wrong, I've seen that apparently the order of submods list matters (at least thats what i've experimented) so those submods that swap entirely files like Disable RR etc should be upper in the list than those that just change/add/replace some lines of code in a file.

    Also is there a way to edit the SMM to add a scrollbar to the submod selection window?
    or a source code somewhere?
    Last edited by Melooo182; February 15, 2014 at 09:10 AM.

  3. #3

    Default Re: [Guide]The new SMM

    Here is my update on this guide, only added some extra info on top of the one Meneth generously did
    Guide Update
    [Guide]The new SMM
    Gracul has made a new, improved Sub-mod Manager. It is currently still in beta, but is included in MSC.
    Due to its improvements, many more sub-mods can be made compatible with each other.
    The format has changed some, however, so old sub-mods will no longer work with it. They have to be updated to the new format. This is however a pretty simple process, and the point of this guide is to provide modders and wannabe modders the information needed to utilize the new SMM.

    - New campaign format
    Campaigns.ini no longer exist. Each campaign instead have to have a file in their folder named campaign.txt, which currently has a single section: name
    This section tells the SMM what the name of the campaign is, and without this, the campaign won't show up in the SMM. Here's an example:
    Code:
    [name] Early Campaign

    - New sub-mod format
    The SMM now has several more sections and commands for sub-mods. There's four sections that have to be present: name, description, files, and works for.

    [name] Tells the SMM what to display as the sub-mod's name:
    Code: [name]One Settlement Type


    [description]This section tells the SMM what to have as the sub-mods description.
    Code:
    [description]OST makes it so there's only one settlement type, which can produceall the buildings and units in the game.\n
    Thisenables a much higher degree of freedom.
    Notethat line-breaks are written as \n. Without those there will be noline-breaks, even though Return is used.


    [worksfor]Thissection tells the SMM what campaigns the sub-mod works for. Campaignsare separated by spaces. Unlike how it was with the old SMM, one cannow use "all" in this section to make the sub-modtoggle-able for all campaigns.
    Code:
    [worksfor] early late


    [groupedin]Tellsthe SMM what group the sub-mod is in. Sub-mods in the same groupcannot be enabled together.
    Code:
    [grouped in] AI

    [checked]You don't write anything in this section. Merely having it in thefile means that the sub-mod will be enabled by default.


    [required]Tellsthe SMM that a sub-mod from the group the sub-mod in has to beenabled. If none are enabled, the SMM won't let one apply sub-mods.Like [checked] one doesn't write anything in this section.


    [files]Whereall file-commands are put. More on this in the next section.
    - File commands
    In the old SMM, there were no commands. It'd just overwrite the file in question. The new SMM however has several commands. Note: all text taken from somewhere with a command is taken from one of the files in the sub-mod's folder.

    *append: One of the most useful commands. This command adds all text from one file, at the end of the other file.
    Code:
    append data\export_descr_character_traits.txt with triggers.txt
    It can also be set to append the text before or after a specific point in a file.
    Code:
    append data\export_descr_character_traits.txt with traits.txt before:
    ;===============================================================
    ;== SS TRIGGERs START HERE ==
    append data\descr_campaign_db.xml with castles_off.txt before:
    <standard_soldier_limit uint="1000"/>
    It is important that you put a line-break or <end> in a new line after the section, as that tells the SMM that the next line is a command, not some line of text in some file.

    *overwrite: This works like the old SMM did. It simply overwrites one file with another. If the file to overwrite with isn't specified, it'll default to the file with the same name as the file to be overwritten.
    Code:
    overwrite data\descr_faction_standing.txt
    overwrite data\export_descr_buildings.txt with export_descr_buildings.txt

    *replace: This replaces one section of text in a file with the text from another file. One can either replace a specific block of text (like with appending, you need a line-break at the end)
    Code:
    replace example1.txt with example2.txt on:
    This is a line of text
    Or you can replace everything between two strings.
    Code:
    replace data\world\maps\campaign\imperial_campaign\campaign_script.txt with example3.txt from:
    script
    to:
    end_script

    *translate: Last, but not least, there's translate, which is used to change text without the risk of breaking anything. Include all lines you want edited in that file, with your translation applied. The code you use for the SMM is quite simple.
    Code:
    translate data\text\export_unit.txt with example3.txt
    Or simply name the file exactly like the one you want to translate and you won't need to specify paths, just the file name.
    Code:
    translate export_unit.txt

    It'll translate all entries you've set it up to translate, and it won't touch the stuff inside {}, so it should never break anything.

    - One major difference
    Unlike with the old SMM, you don't need to include the whole of the file you're editing, just what you added. When using append or translate, one only needs to include whatever one has added, and nothing else. Overwriting still works the same as in the old SMM, though.

    - Important to know The order of submods does matter, submods that replace entire files should be named accordingly so they are upper in the list than those that just alter some few lines, unless you intend to make the entire file one overwrite any change made by the other submods above in the list. For ordering the submods you can use extra letters like for example: “Zmy_submod”, this will guarante it will be at the bottom, or numbers as well like: “1my_submod”, know that numbers have priority over letters in the ordering.

    Now do some modding and put this knowledge into use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •