Modding Basics - Cities: Skylines Wiki (2024)

This article is timeless and should be accurate for any version of the game.

Contents

  • 1 Getting Started
    • 1.1 Namespace
    • 1.2 Using directives
    • 1.3 IUserMod
  • 2 Modding Basics
    • 2.1 Unity
    • 2.2 Basic mods
      • 2.2.1 Example
      • 2.2.2 Managers
      • 2.2.3 Modding API
    • 2.3 Advanced mods
      • 2.3.1 Singletons
  • 3 See also

After you've setup your basic or advanced mod it's time to actually start making a mod.This page will cover how to get started and all the basics of modding.

Getting Started[edit | edit source]

The first thing you do to create a mod is to create a class that implements IUserMod.This is the start point for any mod and by implementing IUserMod the game will be able to load your mod.

Namespace[edit | edit source]

Your mod should always be within a namespace.The name of the namespace doesn't matter that much but it's recommended to just use the name of your mod.This will prevent conflicts with other mods and it will keep your projects more organized by scoping your code within your namespace.

Using directives[edit | edit source]

To properly use the ICities API and other assemblies you have to add the using directives.In most cases you'll be using ICities and UnityEngine so start of by adding these lines in your code.

using ICities;using UnityEngine;

IUserMod[edit | edit source]

By implementing IUserMod you have to specify a Name and Description for your mod.These are used within the Content Manager to display your mod.The initial code for your mod should then look something like this and you should be able to load it in the content manager.

using ICities;using UnityEngine;namespace ModName {public class ModName: IUserMod {public string Name {get { return "Mod Name"; }}public string Description {get { return "My first awesome mod that doesn't do anything! *JEEY*"; }}}}

Modding Basics[edit | edit source]

Now that you have a working mod it's time to make it actually do something.This differs for each mod obviously but here are some things you should know to get started.There are millions of possibilities what your mod can do so after this you'll be on your own to figure out how to convert your ideas into an actual mod.There are still a lot of other guides you can read to learn how to do specific things.

Unity[edit | edit source]

The game is built in Unity which means you have access to all the functionality Unity offers in both basic and advanced mods.For example you could create game objects and monobehaviours, render UI elements, use physics and a bunch of other things.Check out the Unity Manual or the Unity API to learn how Unity works and to see what you can do.

Basic mods[edit | edit source]

For basic mods you'll mostly be implementing interfaces and extending the base classes.

Example[edit | edit source]

If you add this class to your mod you get unlimited oil and ore resources.Classes can be added in your main file or by creating a new file.

public class UnlimitedOilAndOreResource: ResourceExtensionBase { public override void OnAfterResourcesModified(int x, int z, NaturalResource type, int amount) { if ((type == NaturalResource.Oil || type == NaturalResource.Ore) && amount < 0) { resourceManager.SetResource(x, z, type, (byte)(resourceManager.GetResource(x, z, type) - amount), false); } }}

If we break this down you can see that we create a new class that extends ResourceExtensionBase.By doing this we can override an API method OnAfterResourcesModified which gets executed when a natural resource is modified.We then do some checks to make sure we're only overriding oil and ore.The last thing it does is actually modify the resource by using the resourceManager.There are a lot of managers that can be used to modify things and get values so you'll mostly be using managers and calling their methods.

Managers[edit | edit source]

All interfaces/base classes have a OnCreated method which provides you with the related manager.For example if you extend LoadingExtensionBase you can override the OnCreated method and you'll get the ILoading manager.Each manager interface also has a reference to all other managers.

public class LoadingExample: LoadingExtensionBase {public override void OnCreated(ILoading loading) { loading.managers.milestones.UnlockMilestone("Basic Road Created");}}

As you can see here we get a reference to the ILoading manager but then we access all managers and are able to access the milestones manager.We can then unlock the 'Basic Road Created' milestone when a level is loaded.For more information see the managers info on the modding page.

Modding API[edit | edit source]

The next step is to look at the Modding API and see what you can do.It describes all the classes and interfaces within the ICities assembly.

Advanced mods[edit | edit source]

Apart from the things you can do in basic mods you have a lot more possibilities.There are a lot of guides explaining how to do specific things so make sure to take a look at them.You'll mostly be Reverse Engineering the CS code to figure out what exactly you can do.By using Reflection you can go even further but this is for more advanced programmers only.

Singletons[edit | edit source]

There are a lot of singletons in the game for managers and other things.This will be the starting point for most things you do to modify the game.For example to simply pause the game you could do this.

Singleton<SimulationManager>.instance.SimulationPaused = true;

Most Manager instances can also be referenced using the static instance property, which wraps the Singleton, the above example becomes:

SimulationManager.instance.SimulationPaused = true;

See also[edit | edit source]

  • Modding
Modding Basics - Cities: Skylines Wiki (2024)

FAQs

How to start modding city skylines? ›

Simply go to the Cities: Skylines game page in the Library and click on the word "Workshop" that sits just below the Play button. This will bring players to a massive library of mods they can browse to find new assets, maps, game mods, building themes, and more.

What programming language does Cities: Skylines use? ›

The game ships with a C# compiler which allows for automatic script compiling at game start. The mod user folder is located at: On Windows C:\Users\<username>\AppData\Local\Colossal Order\Cities_Skylines\Addons\Mods. On Mac /Users/<username>/Library/Application Support/Colossal Order/Cities_Skylines/Addons/Mods.

What country were city skylines made in? ›

Colossal Order is a Finnish video game developer known for its business simulation game series Cities in Motion and for its city-builder series Cities: Skylines. The company was founded in Tampere, Finland in 2009.

When mods Cities: Skylines 2? ›

Starting on March 25, players will be able to access mods through the Cities: Skylines 2 Modding Beta.

How to structure Cities: Skylines? ›

To isolate commuter and industrial traffic from each other, zone commercial area at the middle, residential and industrial on either side of commercial area. Offices can be zoned anywhere since they simply provide jobs only and are less burden on transportation system. Railways can get congested, just like roadways.

How do you start making money in city skylines? ›

How to Make Money in Cities: Skylines 2
  1. Sell Excess Electricity and Water to Neighboring Cities.
  2. Create Districts and Impose Parking Fees.
  3. Increase Zone Taxes.
  4. Reduce Service Budgets.
  5. Don't Invest in Services and Upgrades Unless They're Needed.
Nov 1, 2023

Is Cities: Skylines more CPU or GPU? ›

While the CPU primarily handles the simulation and calculations in Cities Skylines, the graphics processing unit (GPU) also has an impact on the game's performance, particularly in rendering the graphics and visuals of the city.

How long is a year in city Skylines? ›

Time & Seasons

With both a day and night cycle and seasons at release, Cities: Skylines II handles time differently than its predecessor. One cycle through day and night equals one month and each season lasts about three months, with one year in the game taking twelve in-game days.

What is the maximum city size in Cities: Skylines? ›

To get started let's have a brief comparison between the map sizes. In Cities: Skylines the playable area consists of 5x5 tiles, 9 of which can be purchased once everything is unlocked. One map tile is 1.92 x 1.92 km which results in the total playable area being 92.16km² with a maximum of 33.18km² to build a city on.

Why were skylines illegal in us? ›

The model was illegal because it did not pass the Federal Motor Vehicle Safety Standards set under the Imported Vehicle Safety Compliance Act of 1988. This left many Nissan fans of the model very sad for years.

Which city has the best skylines in the world? ›

Hong Kong

“Of all the cities in the world, Hong Kong has the most skyscrapers in one place so looking at the skyline at night, with the hills in the background, is absolutely amazing.” explains Oliver.

Are Cities: Skylines maps based on real cities? ›

Several of the maps are based on real locations.

Is Cities Skylines 2 confirmed? ›

Cities: Skylines II was revealed on March 6, 2023, as part of the Paradox Announcement Show 2023.

How do mods work in Cities: Skylines? ›

Mod is short for "modification", as in modification of game files to change the functionality of Cities: Skylines. Mods can be most easily added to the game by subscribing in the Steam Workshop where they can be updated by the creator and automatically sent to the users.

Will cities skylines 2 have dlcs? ›

Yes, Cities Skylines 2 will have DLC which can range from full expansion packs to new radio stations. As the game matures, so will its back catalog of extra content.

How do you use first person mod in Cities: Skylines? ›

Usage. After installation, simply press CTRL+F during gameplay to switch to the first-person camera mode. Press again to revert to the default camera.

How to compile city skylines mods? ›

Press F6 to compile your mod. The Output Type in your project's Properties should be set to Class Library. The compiled DLL will be placed in obj\Debug or obj\Release under the project folder, depending on the active configuration. You can switch configurations with the combo box in the toolbar.

Are city skylines mods free? ›

Unlock a world of possibilities in your Cities: Skylines II game with Cities: Skylines 2 Mods. Our free Mod files offer a wide range of new options to enhance your playing experience and upgrade your strategy.

Top Articles
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5455

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.