Closed leviathan13 closed 5 years ago
The mod.json
is a JSON file -- you can read more about JSON here. Keep in mind that JSON is just the structure, the names of the fields are ModTek specific.
In your manifest in your mod.json
, you can include your .csv files that you would like to append. Lets say that I have a directory called itemCollections
that has all of them in it, my mod.json
would include something like:
"Manifest": [
{ "Type": "ItemCollectionDef", "Path": "itemCollections", "ShouldAppendText": true },
]
This "ShouldAppendText" flag is what tells ModTek that these are incomplete files that should simply be tacked on to the existing file. These files only include the lines that you want to appear at the end of the file and should include a newline at the end of the last line
My .csv file for adding a new item (in this case, a half load of MG ammo) would look like this:
Ammo_AmmunitionBox_Generic_MG_Half,AmmunitionBox,0,10
Oh thank you! So I just have to make a .csv files with the same name of the file I want to edit and put it in that folder? Great, now I understand.
I would also suggest to add an example like this to the documentation, so hopefully modders will use this method more often and avoid a lot of conflicts.
I'm a noob at modding and I've encountered the same problem mentioned in https://github.com/BattletechModders/ModTek/issues/117: as far as I understand, if you make your own custom itemCollection file, then you have to add it to all shops by editing the star system json files in /starsystem (I know that you can use advanced json merges, but that's still a lot of files to edit). This is why the quickest method to add a new custom item to the game is to manipulate the base itemCollections files. However, most mods replace them using the "streaming" function of ModTek, but that means only one mod can edit the same itemCollection file.
In the thread, @Mpstark responded that now there is a function to append text strings to .csv files, but I did not understand how. Let's say that I want to add a line to "itemCollection_Components_base", how would I go about it?
Side question, the syntax used in the mod manifest, is it unique to ModTek or is it a common programming language that I can look up?