A step-by-step guide for how to get started with modding the game. Note that at the time of writing this guide, only modifying XML files is possible. Autrement dit, you can change for example values or text, mais tu peux’t code whole new game mechanics at this point.
Commencer
Modding Settlement Survival is not completely straightforward, but with a few hints, it is pretty easy.
Au moment de la rédaction (2021-11-11), only basic XML editing is supported. That means that you can change values or text, mais tu peux’t code in completely new game mechanics. Toujours, you can change a number of things doing that.
je’d recommend using Notepad++ to edit files. It will detect that you’re dealing with XML files and for example mark comments accordingly, which you can ignore when editing the files.
Pour commencer, go to your Settlement Survival folder which you can do by going to your game library, opening the properties of the game, et sous « fichiers locaux » cliquez sur « browse ».
Maintenant, you will need to make a new folder called “MyMods” in the following location:
Settlement Survival\Settlement Survival_Data\MyMods
Alors, create a folder for your mod with the name of your mod so that the structure will be \MyMods\YourModName
Substituting “YourModName” with the actual name of your mod.
In that folder, your mod will need 3 basic components:
- AModConfig.xml with some basic data about the mod, like title and description
- PreviewIcon.png which will show up as the picture in the Steam Workshop
- UN “zipConfig” folder which will include the modified XML files which will actually be modifying the game
Nous’ll go through these step by step, but here is what the contents of your MyMods\YourModName folder should look like in the end:
AModConfig.xml
The AModConfig.xml carries the metadata of the mod, so for example its name.
Below is what the file needs to contain, where you just need to fill in the following parts yourself:
- The mod name / titre
- Description
- Your name under auther (Oui, il’s “auther”, not a typo in this guide)
- ChangeNote
You can either create an XML file with the content below (and your changes to it) or copy the file from another mod and then modify that file accordingly. If you take an existing mod’s file, make sure you delete the steam key in SteamKey_Str. It will automatically be filled in after you publish the mod to the Workshop with a unique ID and it needs to be empty for a new mod as you can see here:
<?Version xml ="1.0" codage ="utf-8"?> <UGCItemInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Titre>A Mod Title</Titre> <Des>Description of what your mod does</Des> <Auther>Your Name</Auther> <Lang>schinese</Lang> <ChangeNote>Changed a thing</ChangeNote> <SteamKey_Str></SteamKey_Str> </UGCItemInfo>
PreviewIcon.png
This step is pretty simple. Toi’ll need a png file that will be displayed in the Workshop. The official guide recommends a size of 200×120 pixels for the icon.
Editing the Game Files
Now that everything else is set up, we can get started with actually modifying the game files.
D'abord, nous’ll need to find where we can find the entry that we want to modify. Alors, we can make an XML file with the changes we want to make.
If you struggle following what you need to do, dans 4.3 there will be a full example file so you can see the end results of all the steps. En général, il’s also a good idea to look at other, existing mods and learn from how they work. Et bien sûr, enfiler’t hesitate to ask questions in the comments either if something is unclear or you have any questions.
Finding the File/Entry
Sometimes it can be obvious which file an entry is in and where you need to make the changes. Souvent, il’s not obvious because of the way the game stores information.
A lot of files make use of IDs instead of names. Alors par exemple, the building Reservoir has the building ID 2036. To figure out the ID, you can search for the name in the lang.xml file. This file handles the names that end up getting actually displayed in the game, so if you search for « Réservoir » in this file, you will quickly find this entry:
<LangConfig> <IDENTIFIANT>Building_Name_ID_2036</IDENTIFIANT> <LangList> <Lang> <LangType>Chinois</LangType> <LangValue>蓄水池</LangValue> </Lang> <Lang> <LangType>Anglais</LangType> <LangValue>Réservoir</LangValue> </Lang> ....
And at the top of that entry, you can see the ID.
One thing to keep in mind is that sometimes buildings have the same name as a technology, Par exemple, alors assure-toi’re looking at the ID for the right type of entry – bâtiment, article, technology etc. The same ID can also be used in several different contexts so if you want to do the opposite and look up the name of something based on the ID, again make sure you look for the right type.
Once you have the ID, then you can use that to find the actual entry you want to change. Alors par exemple, if we wanted to modify some values of the Reservoir, we could now search in the building.xml file for 2036 and we would get to the Reservoir entry.
Sometimes it can be difficult to find what you are looking for, surtout quand tu’re not even sure which file something is located in. Dans ce cas, je’d recommend using a grep tool, which basically allows you to search for some text (like an ID you found in lang.xml) is not just one text file, but all the text files in a folder.
Editing an Entry
When you have found the file/entry, you can start actually modifying it. Pour ça, d'abord, make a copy of the original file, and put it in the zipConfig folder in your mod folder (Settlement Survival\Settlement Survival_Data\MyMods\YourModName\zipConfig).
The files will have many individual entries. Every entry starts and ends with a tag, Par exemple, building entries start with
<BuildingConfig>
and end with
</BuildingConfig>
If you just look at how the first proper entry starts (ignoring comments), toi’ll know what to look for.
Alors, delete all other entries apart from the one you want to edit (ou si vous’re editing multiple buildings, keep all the ones you want to edit). Make sure to not delete the first 2 lines or the last line in the file, and only delete other entries.
For building.xml, that means making sure these lines don’t get deleted:
<?Version xml ="1.0"?> <ArrayOfBuildingConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
And the last line:
</ArrayOfBuildingConfig>
Entre, there should only be the entry (or entries) you want to modify left.
Now you can make the changes you wanted. This is often pretty self-explanatory, but there are also comments at the beginning of a file with some descriptions. Par exemple, if we wanted to change the output of the Reservoir, this would be the relevant part:
<ConsumeAddAbilityList> <!--配方--> <ConsumeAddAbility> <IDENTIFIANT>1</IDENTIFIANT> <Nom>Building_Name_22</Nom> <Lable>Building_Lable_1031</Lable> <ProduceType> <GoodsList> <Marchandises> <IDENTIFIANT>1001</IDENTIFIANT> <UnEducated>24</UnEducated> <Instruit>24</Instruit> </Marchandises> </GoodsList> </ProduceType> </ConsumeAddAbility> </ConsumeAddAbilityList>
So both uneducated and educated citizens produce 24 water by default. (To find out what item an ID refers to, you can look it up in the lang.xml file similar to earlier. The item ID 1001, dans ce cas, refers to water, which is the only item the reservoir produces.)
Besides changing how much water gets produced, you could also change the ID to another item, or make it produce 2 différents articles.
Example File
En tout, if our goal was to double the output of the reservoir, we would end up with a building.xml file in the zipConfig folder of our mod that looks like this:
<?Version xml ="1.0"?> <ArrayOfBuildingConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <BuildingConfig> <IDENTIFIANT>2036</IDENTIFIANT> <!--蓄水池--> <!--特性--> <ContentDes>Building_ContentDes_2036</ContentDes> <!--建筑升级槽位数量--> <RemouldSlot>2</RemouldSlot> <!--是否可以建造地板--> <CanFloor>FAUX</CanFloor> <!--表现类型--> <ViewType>1</ViewType> <!--建筑类型--> <FuncType>3</FuncType> <!--建筑名称--> <Nom>Building_Name_ID_2036</Nom> <!--建筑描述--> <Des>Building_Des_ID_2036</Des> <!--建筑序号--> <Commande>1</Commande> <!--建筑图标--> <Icône>Icon_building_1011</Icône> <!--建造的类型--> <BuildType>1</BuildType> <!--建筑边界道路--> <Border> </Border> <!--建筑方向--> <BorderArrow>dos</BorderArrow> <!--建造次数=配置值--> <AllConsumWorker>75</AllConsumWorker> <!--最大耐久度--> <MaxDurability>150</MaxDurability> <!--该建筑工作职业--> <WorkerCareer>22</WorkerCareer> <!--最大建造人数--> <MaxBuilder>2</MaxBuilder> <!--默认工作人数--> <DefaultWorkerNum>1</DefaultWorkerNum> <!--工作动作--> <DoAction>31</DoAction> <!--点击音效--> <ClickSound> <Chemin>Sound/Building/Build_Click8</Chemin> <Volumn>1</Volumn> </ClickSound> <!--建筑模型列表--> <ModelsList> <Modèles>Building/Building/Breservoir001</Modèles> </ModelsList> <!--建筑地面网格--> <FixedSize> <Condition> 4,4,4,4,4,4 4,4,4,4,4,4 7,7,7,7,7,7 7,7,7,7,7,7 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 </Condition> <Attacher> 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 1,1,1,1,1,1 </Attacher> </FixedSize> <!--建造建筑点相对坐标--> <BuildLocList> <!--建筑建造位置--> <BuildLoc> </BuildLoc> </BuildLocList> <!--整体消耗资源--> <AllConsumResList> <!--整体消耗资源--> <AllConsumRes> <IDENTIFIANT>33007</IDENTIFIANT> <Num>30</Num> </AllConsumRes> <AllConsumRes> <IDENTIFIANT>33008</IDENTIFIANT> <Num>30</Num> </AllConsumRes> <AllConsumRes> <IDENTIFIANT>4001</IDENTIFIANT> <Num>40</Num> </AllConsumRes> </AllConsumResList> <!--维修材料消耗--> <FixStaff> <IDENTIFIANT>3001</IDENTIFIANT> <Num>2</Num> </FixStaff> <!--消耗原材料获得能力--> <ConsumeAddAbilityList> <!--配方--> <ConsumeAddAbility> <IDENTIFIANT>1</IDENTIFIANT> <Nom>Building_Name_22</Nom> <Lable>Building_Lable_1031</Lable> <ProduceType> <GoodsList> <Marchandises> <IDENTIFIANT>1001</IDENTIFIANT> <UnEducated>48</UnEducated> <Instruit>48</Instruit> </Marchandises> </GoodsList> </ProduceType> </ConsumeAddAbility> </ConsumeAddAbilityList> <!--工作人数区间:额外控制界面上的开关按钮--> <WorkerRange> <Inférieur>1</Inférieur> <Upper>2</Upper> </WorkerRange> <!--工作人数区间--> <WorkRequired> <!--产出物品所需工作总次数--> <NeedWorkRequired>8</NeedWorkRequired> <!--受教育者工作次数--> <EducatedWork>2</EducatedWork> <!--未受教育工作次数--> <UnEducatedWork>2</UnEducatedWork> </WorkRequired> <!--一级物品上限--> <CollectItemMainTagLimit>1</CollectItemMainTagLimit> <!--建筑改造列表--> <RemouldList> <RemouldID>1</RemouldID> <RemouldID>7</RemouldID> </RemouldList> </BuildingConfig> </ArrayOfBuildingConfig>
Note how the whole BuildingConfig entry is included even though we just changed 2 Nombres, for educated and uneducated workers, ici:
... <Marchandises> <IDENTIFIANT>1001</IDENTIFIANT> <UnEducated>48</UnEducated> <Instruit>48</Instruit> </Marchandises> ...
Aussi, note how the first 2 lines and the last lines of the file are preserved.
Combining Mods
Because the game only allows any entry to be modified by one mod, this means you may run into issues if you’re using several mods that want to modify the same things. Alors par exemple, our mods Simple Meat and More Fancy Food both make changes to recipes with meat and so change the entries for buildings processing meat. Installed together, the game will give an error because they both want to edit the same entry.
To deal with that, you can make a new mod that combines the functionalities. Our mod Food Overhaul is exactly that, the changes from Simple Meat and More Fancy Food combined. Most changes of the mods don’t conflict with each other so they can simply be added together, but for the mentioned recipe changes this mod then combines the change in item ID et montant.
Enabling, Essai, and Publishing the Mod
After you made your changes, il’s time to test if it worked! To enable a mod, start up the game, go into the mod menu and tick the box at the right.
One important thing to keep in mind is that right now, the game does not automatically reload mod files after they were changed, even if you close the game! So any time you make changes to your mod, you need to manually tell the game to reload the mod files, which you do by going into the mod menu, disabling and reenabling your mod.
Aussi, some changes won’t be applied if you load a savegame. Par exemple, if you change recipes that buildings are currently using, you will have to go through those buildings and reselect the recipes. In other cases rebuilding buildings may be necessary.
When you have tested your mod, confirmed it works and are ready to / want to publish it, all you need to do is to click the « publier » button in the mod menu in the game. Que’s'asseoir! Toi’ve made a mod for Settlement Survival!
Updating a Mod
If you want to make additional changes to your mod, or need to fix bugs, que’s also pretty easy.
- Make the changes to the mod files as usual
- (facultatif) Update the change notes in the AModConfig.xml file for what you changed
- Make sure the SteamKey_Str is now filled in with the ID of your mod
- Press publish
If the mod ID is not in the file and you’re not sure what it is: il’s the number string at the end of the link to your mod, donc par exemple:
steamcommunity.com/sharedfiles/filedetails/?id=2644570870
The mod ID here would be 2644570870
C'est tout ce que nous partageons aujourd'hui pour cela Survie des colonies guide. Ce guide a été initialement créé et rédigé par River System. Si nous ne parvenons pas à mettre à jour ce guide, vous pouvez trouver la dernière mise à jour en suivant ceci lien.