About This File
In order to create a Cities: Skylines mod, you must go through a fairly tedious process of importing correct references through setting the right framework information, and then implementing interfaces, etc. After all of that, you then have to manually move over your built mod to the mods folder. Yuck!
Cities Skylines Modding Templates Extension for Visual Studio
I've created this extension for Visual Studio to help streamline the process for starting up new modding projects. In just a couple steps, you are able to produce a mod that will show up in the game on the first build. It works by using Visual Studio's Template system, along with a custom Wizard interface that I've created to customize the basic information of the new modding project.
How do I use it?
1. Open up the New Project interface in Visual Studio, making sure that the framework is .Net Framework 3.5 (This is because Cities: Skylines uses MONO which is based off of 3.5). Expand out the C# category and select the new category called Skylines Mods and choose the lonely Cities: Skylines Mod project template and give it a name. The default name it uses is MySkylinesMod.
2. A new window will now pop up, which is the bulk of the work of this template extension. Here, you can give your mod a name, description, and the author. The name and description fields is what shows up in the Content Manager window for the game. The Game Directory portion of the wizard should automatically fill itself. If It doesn't, then the Browse button will enable so you can define the install location of Cities: Skylines. By default, it assumes that you've installed it from Steam. The Mods Directory category is only used if the "Build to Mods Dir." is selected. That means that when building the project, a folder will be created that's the same name as the project name and a copy of the compiled mod (.dll) will all be placed into your mods directory. The Mods Directory is optional, however the Games Directory is required. The wizard uses this for the assemblies portion in order to correctly establish a reference when it comes time to compiling. You can select which assemblies you want referenced. You can always reference more later. Notice that the basic assemblies like mscorlib and System are excluded in this listing since these are included by default. Any assemblies that the wizard does not deem as "ignored" (Included by default/Shouldn't be needed) will show up in the selection box for reference, as long as it's in the proper folder.
3. After the project is created, go ahead and take a look at the code that was generated. It implements and includes ICity automatically and uses the information that was provided in the wizard for the Name and Description fields. When you're satisfied, go ahead and compile the project. If you selected the option to build to the mods directory, then you're ready to test! The image below shows where the Mods are automatically placed when compiled.
4. Load up the game and enable the mod through the Content Manager!
Awesome! How do I get it?
All you have to do is extract the .vsix file from the provided .zip. An installer-type interface will come up.
How do I uninstall it?
Because it's only an extension comprised of templates, all you have to do is go to Tools->Extensions and Updates and select Templates. The extension is called Cities Skylines Modding Templates and there is a button under Disable where you can uninstall it.
How do I update when there's a new version?
You don't have to uninstall the old version of the template extension, just install it how you would as if it was the first time installing the extension. Visual Studio will automatically do the rest.
What do I need to use it?
The extension was made exclusively for Visual Studio 2013 (Visual Studio 12). Any version of VS12 should do, as long as it has C#. If you're feeling brave, I can provide an extension installer for a lower version of Visual Studio, but I can't guarantee that it'll work. If you have Visual Studio Community, there should be no issues. Any Express editions do not allow extensions, so naturally it will not work for them. Community edition is free though!
What do I do if I find a problem?
Let me know ASAP so I can get to it and fix it!
What's the future?
I plan on adding some Item Templates in the future for complex things like making changes to the interface. I want to make sure that what I have now is working for other people before I work on Item Templates.
What's New in Version 1.0.2 See Changelog
- Version 1.0.2 - Fixed generated version in the AssemblyInfo.cs file to prevent possible crashing in game. Updated the Post-Build Event for copying over the DLL to use %LOCALAPPDATA% system environment variable if selected.