[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.
|