This War of Mine

This War of Mine

34 ratings
Adding new items through modkit of This War of Mine
By toomanynights
Some would say that This War of Mine workshop is bugged and you don't have an opportunity to add a new item. While the first statement could be true, the second one isn't 100% correct. You actually have that opportunity, and thise quide will tell you how.
 
Rate  
Favorite
Favorited
Unfavorite
Introduction And Stuff
So if you felt a bit confused when you first tried to add a new item through This War of Mine modkit, then you’re just like me. It seems like for now modkit is a bit bugged and you can’t add a new item just like that.
I’ve spent a few evenings trying to make it work, and it seems I made it. So this here is a guide on how to add a new item to This War of Mine.
Boring Technical Hypothesis
Modkit seems to work with two main components: Storyteller.exe, that actually is an interface for editing .xml’s, and “ModTools.exe”, which appears to be a console utility that extracts stuff from game, converts it into simple .xml files, and then grabs your .xml’s and puts ‘em back into game.

The directory structure of mod is quite easy itself: “Items”, “Localisations” and other folders contain much like what they say. But whenever there’s a folderful of .xml’s, there’s also a .bin file.



I believe that it contains a list of .xml’s that will be brought from mod to the game. But the thing is that whenever you just add or duplicate item through modkit, it won’t just appear in that .bin. It should, but I guess it's a modkit bug. So now we’ll do it manually.
Starting to Add That Item
First off you’re gonna have to create a new mod. Since we’re doing things right here, this item will have its own icon, so when you create a mod - be sure to push “Extract Textures” checkbox.



This thing is gonna take a while, but when it’s done - go to the “Items” branch and choose item that you want to be the example of your own.
There you can see items that never appear in game, like “PocketTools”. Funny thing is that they are in that .bin already, so actually you could just edit one of them and be happy, BUT I STRONGLY RECOMMEND NOT TO DO THAT, because two mods with similar item edited will have conflicts and you won’t even see it coming.

So in this instance it’ll be “Filter”, go and duplicate this item.



Your Filter2 will appear instantly, but don’t forget to change its name on your right as well.

Becoming Godparent
Now let’s change Filter2’s name and description in order to give it a personality.
You can see when the item keeps its name and description in “StringDescription” and “StringName” rows:



Go there now: “Localization strings” - “Game string group” - “Groups” - “Items” - “Groups” - “Fuels” - “Strings”. Notice that when you’re working on something different than Filter, group can be different as well.

Duplicate Filter’s name and description. Notice that after being duplicated, it’ll lose all its content.



I wanna keep things ordered, so I’ll change new strings’ names into “Filter2_Name” and “Filter2_Description” and fill all the rows, except for “Ancient” and “Portuguese” (vanilla items are like that as well). Please don’t be lazy and fill all the languages, use the translator if you’re not a polyglot. The community will hopefully fix the translation difficulties for you if your mod goes worldwide.
By the way, it appears like your localization strings won't survive first saving anyways. So don't bother very much before first saving (just fill only one language), and then come back and fill the whole bunch of languages.





And here comes the tricky part! See that little “Description” thing? Open it up and make sure that “#checked” tag is right where it belongs - in “Notes”, Without it after saving your mod all the rows will go empty and won’t show in game.

So, when you’re done with that, go back to your “Filter2” and edit name and description rows.

Making Custom Icon
Now, when the name and description are ready to go, it’s time to change the item’s icon. In order to do that, first look at which icon sheet the parent item used.



Now you know it’s UI/KosovoIcons/sheet04_a.dds. Then go there. You can use “folder” icon on top to make it faster.



When you’re there, find sheet04_a.dds and duplicate it. Let’s name it “sheet_filter2_a.dds”. Also find sheet04_o.dds and make it’s own clone, “sheet_filter2_o.dds”.
Of course you could use empty cells, or just replace unused icons with your own. But again, I do not recommend you that to avoid conflicts with other people’s mods.

When you’re done duplicating, open “_a” sheet with, say, Paint NET[www.getpaint.net] editor.



I can’t see anything, so I’ll add a new layer, move it to background and paint it black.

DON’T FORGET TO REMOVE THE BLACK LAYER BEFORE SAVING!!!



As you can remember, Filter had icon #18, but if you count here, you can clearly see it’s on a position #19. I don’t know why. Let’s just deal with it and replace filter’s icon with something we need.
Oh, by the way, be sure to paste your picture onto NEW layer. It’ll make your life easier, believe me.



And now, NOT forgetting to remove the black layer, save this stuff.
Rinse & repeat with “_o” texture.
Go back to your item and point your Filter2 onto your new icons.

Messing With Bins
I guess it’s not the end of editing options of your item, but rest of them are more obvious, so I guess you can do it yourself. So now we’re moving to another tricky part: manual adding your item into config.

Before you start messing with bins, save your mod. If while saving you see a dialogue where it asks you to add your item (not icons or something, but "xml" file of item), then you won't need to manually edit .bins, go on to the next step.

Otherwise go into “Items” folder of your mod and open “config.bin” with any HEX editor (I prefer “Hex Editor Neo[www.hhdsoftware.com]”).
See that messed up list? Find where the parent item’s mentioned.


As you can see, every item is written like “.Filter.xml.”. But it won’t work if you just put “.Filter2.xml.” after Filter.xml, because regular dot is Hex-translated into “2e”, and you need to start your item with “01” and end with “00”. So copy&paste until you get the “Filter2.xml” right.



Now save that config and go back to your modkit. Pack your mod with blue arrow. When it asks you if you want to pack your new textures, say “OF COURSE I WANT THAT!”.

By the way, do NOT attempt to save and/or pack your mod while editing one of .bin's or textures. This will end up with unreadable error and you'll probably lose all your progress since last saving.
Holding Your Breath…
It’s a precious moment. Especially for me after all those hours of testing.
Go in game. Be sure to disable all mods instead of a newly born, reload the game, and then start a new scenario (you saw it coming, right?). Then go to your workshop, if your item is supposed to be there, and…



There it goes! Now you only have to go to the main menu, “Modding center”, and upload your mod to Workshop.

Yeah. I would say “it was easy, wasn’t it?”, but I know it wasn’t so I don’t wanna be too ironic.
It could be easier, yes, but please let’s be thankful to 11 Bit Studios. Those guys made a really awesome game, and they even gave us an opportunity to change it the way we want. It doesn’t work perfectly now, but let’s be patient about the bugfix and use this workaround in the meantime.

If you find this guide helpful, please take part in propagating it further, because more TWOM players know this stuff - more interesting mods are coming.

Finishing Touches
There’s one more thing in This War of Mine modding tools that doesn't work 100% correctly. Files are packed quite well, but not all of them are being sent into Workshop, so you will see 'em, but your subscribers won't.

I’ve sent a detailed bugreport to 11BitStudios, and I believe they will fix this thing soon.
Until then you can do the following:

Go to ..\Steam\steamapps\common\This War of Mine\Mods. Use Mods.list to find your mod's ID.
Copy all files, except for the directory, that contain your ID.
Paste ‘em into a folder with the same name as your mod’s Steam ID. Just create that folder nearby. You can find your mod’s Steam ID if you visit your mod’s Steam page:



Go to that folder. Remove "ID_" prefix of each file (so "5a7d0b1aabf846bd888c2fa138d_common.dat" should become just "common.dat").
Pack that stuff into archive (not only files, but the folder you’ve created as well!).

And ask your subscribers to unpack it with replacing into ...\Steam\steamapps\workshop\content\282070

The example of how it can be organized is here: http://steamcommunity.com/sharedfiles/filedetails/?id=631716909

There's also a way to do it without additional archives. For that you need to use 2.0 version of modkit.


If you find this guide helpful, please take part in propagating it further, because more TWOM players know this stuff - more interesting mods are coming.
< >
65 Comments
Trhso May 27 @ 2:23am 
Hi, can you help me about how to get back changes what i made? I chenge loot at some map (church _bandit) and it seems it causing crash game, so i need get fixed pool back to its original state.
Where could I get the version 2 of modkit???
MateItsNate Mar 15 @ 4:28pm 
someone's probs already said this but the reason it's #19 in the image and #18 in the toolkit is because code starts at 0
toomanynights  [author] Feb 5 @ 12:48am 
@Deloitte0111 If there's a way to do that, I'm unaware of it, unfortunately. As far as I'm concerned, it can't be done.
Deloitte0111 Feb 4 @ 6:25pm 
@toomanynights,I just wonder If there is any chance to make new items That can show in the shelter like med,cannedfood,raw food
toomanynights  [author] Feb 4 @ 6:38am 
@Deloitte0111 It's probably best if you create a topic in "Workshop discussions" here:
http://steamcommunity.com/workshop/discussions/18446744073709551615/?appid=282070
There's plenty of folks who mostly can reply to almost any question.
Deloitte0111 Feb 4 @ 4:11am 
Sorry I got a few questions about making mod ,can you add me friend in steam?
WolfScout1950 Dec 5, 2017 @ 10:59pm 
Do you know how can I customize the look of the basic workshop or how can I change the things you can make with it? I am trying to create scavenging station which should work like the trap but instead of food, you'll get materials and wood from it. Thank you.
toomanynights  [author] Aug 11, 2017 @ 2:06pm 
@Lukong1515 o_o I'm not sure, I'm out of modding for a long time now.
Last thing I heard about it is a patch note saying that they fixed this thing.
Lukong1515 Aug 11, 2017 @ 1:29pm 
I got the Custom Icon in, The Description, The Name, the Bench & Materials Required, but when I took my Magnum into the Field, I wasn't able to use it.
For the Filter2 That is different, but Tools don't become tools.