
Recommend you: Water spawner mod download cities skylines
| URBAN ALBUM DOWNLOAD | 904 |
| FASTER THAN LIGHT FREE LATEST DOWNLOAD | 594 |
| THE ADI 198X INTEGRATED AUDIO DRIVER DOWNLOAD | 758 |
| TMP FILES WONT DOWNLOAD | 530 |
Water spawner mod download cities skylines - are
Modding API
This article is timeless and should be accurate for any version of the game.
Overview[edit]
The Modding API is an interface for programmers to override and extend game features. It is presently minimalistic and aims to be so. The available features will evolve alongside user wishes in the future.
In summary, a C# mod can achieve the following things:
- Gameplay: Affect in-game economy and building levels;
- Data Interoperability: Read and save city data (e.g. create map drawing exports);
- Editing: Dynamically create and destroy buildings.
What the API cannot do:
- (Pending)
More overview information is also available in Category:Programming.
File Location[edit]
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
- On Mac
- On Linux
Each mod is implemented in a sub-folder of the name of the mod. The sub-folder contains a Source folder where the C# script is situated. When the game starts, it will compile all the files within the Source folder and create a .dll file at the root of the Mod folder. That dll in turn is loaded at runtime and implements the custom behaviors.
The mod implements a set of interfaces defined in the assembly. It is possible to use Microsoft Visual Studio or another programming IDE to compile a dll and bypass the automatic compilation the game provides. The file located at contains interface definitions. This assembly can be added as a reference to projects within Visual Studio, allowing developers to leverage intellisense when writing mods. Visual Studio can also be used to compile code into assemblies which allows more advanced modding techniques to be used.
The full set of the C# language and a subset of the features of C# are available, as well as all the functionalities provided by the assembly. When using Visual Studio for compilation, any language version that can be compiled to target .NET Framework will do.
Mod can be shared through the Content Manager just like other assets. A check box allows the source code to be embedded in the Workshop item if desired.
Security considerations[edit]
The code in Mods for Cities: Skylines is not executed in a sandbox.
While we trust the gaming community to know how to behave and not upload malicious mods that will intentionally cause damage to users, what is uploaded on the Workshop cannot be controlled.
Like with any files acquired from the internet, caution is recommended when something looks very suspicious.
You can always disable Mods by setting in the launch options of the game in your Steam library>Game settings.
This toggle will prevent the game from compiling and loading modded code. However, it might make more sense to just not download any Mods in the first place.
The toggle only applies to Mods involving custom code; assets and non-executable content remain accessible.
Custom options/settings for mods[edit]
Please refer to the page Mod Options Panel if you are looking for details on exposing options/settings in the Options panel for your mod.
Starting a mod[edit]
The first step to creating a mod is to add these lines to the C# file:
Once done, you will want to add a name and a description of the mod.
To do so, the definition class must inherit from IUserMod from the namespace ICities.
Here is an example of a mod definition:
For snippets on more practical examples, see Basic Snippets.
The next step is to implement what you want by overriding the methods provided in the following interfaces: IUserMod, IAreasExtension, IChirperExtension, IDemandExtension, IEconomyExtension, ILevelUpExtension, ILoadingExtension, IMilestonesExtension, ISerializableDataExtension, ITerrainExtension, IThreadingExtension. The created classes and method must inherit from the needed classes. Each interface provides the OnCreated() and OnReleased() callback. These methods are invoked at creation and destruction time but also when recompiling a mod while the game is running. Each interface, targeted for the purpose their name describes also provides an interface to a "manager" in OnCreated() which allows to interact with the game managers directly. So implementing an extension interface provides the callbacks mechanic and the manager reference handle interacting with the game. It can be frustrating to work to the base interfaces as it is required to overload every single method even though you may only need one or just a few of them, for convenience we provide a non-pure abstract implementation of most extensions. IThreadingExtension non-pure counterpart would be ThreadingExtensionBase in example. Inheriting one base class instead of the pure interface will allow you to only override the required methods as well as get access to a IManagers type which links you to all managers, regardless which interface you are in.
Here are the interfaces and a description of what is proposed:
General
These functions are in each base class at the exception of IUserMod, and are called respectively at the creation and the destruction of an instance.
The managers getter returns a global storage for each managers available across different extensions.
Debugging[edit]
By adding a reference to and , we can use to add debug message to our mod.
Use to open the in-game console.
Official Modding API[edit]
DataTypes[edit]
Service[edit]
Enumeration for service types
SubService[edit]
Enumeration for sub-service types
Level[edit]
Enumeration for building levels
LoadMode[edit]
Enumeration for supported load modes
AppMode[edit]
Enumeration for application modes
Expansion[edit]
Enumeration for game expansions
NaturalResource[edit]
Enumeration of the resources in the Industries expansion
IAreas[edit]
AreasExtensionBase[edit]
Base class to derive from to modify areas/tiles unlocking behaviour
Thread: Any
Gets global managers interfaces
For more info on IManagers, see #IManagers
Thread: Any
Gets the area manager interface
For more info on IAreas, see #IAreas
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Any
Invoked when the game checks if an area can be unlocked
Returns true if it can otherwise false
originalResult contains the default estimation from the game
Thread: Any
Invoked when the game calculates the price of a tile
The parameters provide information on resources and outgoing connections service to allow overriding the cost calculation
originalResult contains the default estimation from the game
Thread: Simulation
Invoked when the game unlocks a tile
Notifies which tile index is being unlocked
IAreasExtension[edit]
Pure interface to modify areas/tiles unlocking behaviour
Thread: Main
Invoked when the extension initializes
For more info on IAreas, see #IAreas
Thread: Main
Invoked when the extension deinitializes
Thread: Any
Invoked when the game checks if a tile can be unlocked
Returns true if it can otherwise false
originalResult contains the default estimation from the game
Thread: Any
Invoked when the game calculates the price of a tile
The parameters provide information on resources and outgoing connections service to allow overriding the cost calculation
originalResult contains the default estimation from the game
Thread: Simulation
Invoked when the game unlocks a tile
Notifies which tile index is being unlocked
AreasExtensionBase[edit]
Base class to derive from to modify areas/tiles unlocking behaviour
Thread: Any
Gets global managers interfaces
For more info on IManagers, see #IManagers
Thread: Any
Gets the area manager interface
For more info on IAreas, see #IAreas
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Any
Invoked when the game checks if an area can be unlocked
Returns true if it can otherwise false
originalResult contains the default estimation from the game
Thread: Any
Invoked when the game calculates the price of a tile
The parameters provide information on resources and outgoing connections service to allow overriding the cost calculation
originalResult contains the default estimation from the game
Thread: Simulation
Invoked when the game unlocks a tile
Notifies which tile index is being unlocked
IBuilding[edit]
IBuilding[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
For more info on IManagers, see #IManagers
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Description follows..
BuildingExtensionBase[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
For more info on IManagers, see #IManagers
Thread: Any
Gets the building manager interface
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Description follows..
Thread: Main
Invoked when the extension deinitializes
IChirper[edit]
IChirperMessage[edit]
Chirper message
Name of the sender
Content of the chirp message
Citizen id of the sender
IChirper[edit]
A lightweight interface to interact with the Chirper
Thread: Any
Gets global managers interfaces
Thread: Main
Gets/Sets the position of the Chirper in UI screen coordinates
Thread: Main
Exterminate the Chirper:(
Thread: Main
Temporarily show or hide the Chirper panel
Thread: Main
Default chirper configuration is to remain centered on the screen, call this method to turn this behaviour on or off
Thread: Main
Allows to set the anchor of the chirper panel, it will expand considering the anchor does not move
TopLeft causes the chirper to expand toward the BottomRight, BottomCenter toward TopCenter and so forth
Thread: Main
Causes the Chirper to synchronize the messages. Will trigger OnMessagesUpdated()
Thread: Main
Deletes a Chirper message
IChirperExtension[edit]
Pure interface to modify the Chirper behaviour
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Main
Called once per frame.
Thread: Main
Invoked when the Chirper synchronize messages (after loading a save i.e)
Thread: Main
Invoked when the Chirper receives a new message
ChirperExtensionBase[edit]
Base class to derive from to modify the Chirper behaviour
Thread: Any
Gets global managers interfaces
Thread: Any
Gets the chirper manager interface
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Main
Invoked when the Chirper synchronize messages (after loading a save i.e)
Thread: Main
Called once per frame.
Thread: Main
Invoked when the Chirper receives a new message
ChirperAnchor[edit]
enum ChirperAnchor { TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight, }Supported chirper anchors
IDemand[edit]
IDemand[edit]
Demand manager
Thread: Any
Gets global managers interfaces
IDemandExtension[edit]
Pure interface to modify demand logic
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Invoked when the game calculates residential demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Invoked when the game calculates commercial demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Invoked when the game calculates workplace demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Returns a smoothed demand for each demand type
DemandExtensionBase[edit]
Base class to derive from to modify demand logic
Thread: Any
Gets global managers interfaces
Thread: Any
Gets the demand manager interface
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Invoked when the game calculates residential demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Invoked when the game calculates commercial demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Invoked when the game calculates workplace demand
originalDemand is the demand calculated by the game, return a different value to override it
The demand is in the range 0 to
Thread: Simulation
Returns a smoothed demand for each demand type
IEconomy[edit]
IEconomy[edit]
Economy manager
Thread: Any
Gets global managers interfaces
Thread: Main
Returns the current money amount being displayed in the UI
Thread: Simulation
Returns the current money amount internally used by the simulation thread
IEconomyExtension[edit]
Pure interface to modify economy logic
Thread: Simulation
This override must return true to take control of OnPeekResource
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Invoked once every four seconds with the simulation set to normal speed. Triggers every time the Economy Manager updates the current money amount.
Thread: Simulation
Invoked when the simulation evaluates if a resource is available.
The amount parameter specifies the amount being evaluated, a return value not equal to the amount parameter notifies the system the player does not have enough resource available.
Thread: Simulation
Invoked when the simulation uses resources. Return value is the actual amount to be reduced from money amount.
Thread: Simulation
Invoked when the simulation adds resources. Return value is the actual amount to be added to money amount.
Thread: Any
Return value is construction cost for anything player can build.
Thread: Any
Return value is maintenance cost for anything player can build. This is reduced from money amount 16 times per week.
Thread: Any
Return value is relocation cost for buildings owned by player.
Thread: Any
Return value is refund amount when bulldozing recently build buildings or roads.
EconomyExtensionBase[edit]
Base class to derive from to modify economy logic
Thread: Any
Gets global managers interfaces
Thread: Any
Gets the economy manager interface
Thread: Simulation
This override must return true to take control of OnPeekResource
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Invoked once every four seconds with the simulation set to normal speed. Triggers every time the Economy Manager updates the current money amount.
Thread: Simulation
Invoked when the simulation evaluates if a resource is available.
The amount parameter specifies the amount being evaluated, a return value not equal to the amount parameter notifies the system the player does not have enough resource available.
Thread: Simulation
Invoked when the simulation uses resources. Return value is the actual amount to be reduced from money amount.
Thread: Simulation
Invoked when the simulation adds resources. Return value is the actual amount to be added to money amount.
Thread: Any
Return value is construction cost for anything player can build.
Thread: Any
Return value is maintenance cost for anything player can build. This is reduced from money amount 16 times per week.
Thread: Any
Return value is relocation cost for buildings owned by player.
Thread: Any
Return value is refund amount when bulldozing recently build buildings or roads.
EconomyResource[edit]
enum EconomyResource { None, ConstructionCost, MaintenanceCost, LoanAmount, LoanPayment, PrivateIncome, CitizenIncome, TourismIncome, PublicIncome, RewardAmount, PolicyCost, BailoutAmount, RefundAmount, LandPrice, All, }ILevelUp[edit]
ILevelUp[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
ILevelUpExtension[edit]
void OnCreated(ILevelUp LevelUp);Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Update levelup data for a residential building
Thread: Simulation
Update levelup data for a commercial building
Thread: Simulation
Update levelup data for an industrial building
Thread: Simulation
Update levelup data for an office building
LevelUpExtensionBase[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Update levelup data for a residential building
Thread: Simulation
Update levelup data for a commercial building
Thread: Simulation
Update levelup data for an industrial building
Thread: Simulation
Update levelup data for an office building
ResidentialLevelUp[edit]
Levelup data for residential buildings
If target level is greater than current level, building tries to level up
Current education progress to reach next level.
Range or 0 if it cannot be calculated right now
Current landvalue progress to reach next level.
Range or 0 if it cannot be calculated right now
Set to true if landvalue is too low for current building level.
Triggers notification icon and eventually causes building to be abandoned
CommercialLevelUp[edit]
Levelup data for commercial buildings
If target level is greater than current level, building tries to level up
Current wealth progress to reach next level.
Range or 0 if it cannot be calculated right now
Current landvalue progress to reach next level.
Range or 0 if it cannot be calculated right now
Set to true if landvalue is too low for current building level.
Triggers notification icon and eventually causes building to be abandoned
IndustrialLevelUp[edit]
Levelup data for industrial buildings
If target level is greater than current level, building tries to level up
Current education progress to reach next level.
Range or 0 if it cannot be calculated right now
Current service progress to reach next level.
Range or 0 if it cannot be calculated right now
Set to true if service coverage is too low for current building level.
Triggers notification icon and eventually causes building to be abandoned
OfficeLevelUp[edit]
Levelup data for office buildings
If target level is greater than current level, building tries to level up
Current education progress to reach next level.
Range or 0 if it cannot be calculated right now
Current service progress to reach next level.
Range or 0 if it cannot be calculated right now
Set to true if service coverage is too low for current building level.
Triggers notification icon and eventually causes building to be abandoned
ILoading[edit]
ILoading[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
Thread: Any
Returns true when the loading of a map/save is completed, otherwise false
Thread: Any
Returns the current application mode
Allows to know if the game state is currently in-game, in map editor or in asset editor
Thread: Any
Forces a new theme to be applied to the next save. Will only become active when reloading
Options are: "Sunny", "North", "Tropical"
ILoadingExtension[edit]
void OnCreated(ILoading loading);Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Main
Invoked when a level has completed the loading process
The mode defines what kind of level was just loaded
Thread: Main
Invoked when the level is unloading (typically when going back to the main menu or prior to loading a new level)
LoadingExtensionBase[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
Thread: Any
Gets the loading manager interface
Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Main
Invoked when a level has completed the loading process
The mode defines what kind of level was just loaded
Thread: Main
Invoked when the level is unloading (typically when going back to the main menu or prior to loading a new level)
IManagers[edit]
IManagers[edit]
Helper interface which stores getter to all available game managers
Thread: Any
Gets the areas/tiles manager
Thread: Any
Gets demand manager
Thread: Any
Gets the economy manager
Thread: Any
Gets the levelup manager
Thread: Any
Gets the milestones manager
Thread: Any
Gets the serialization manager
Thread: Any
Gets the terrain manager
Thread: Any
Gets the threading manager
Thread: Any
Gets the loading manager
IMilestones[edit]
IMilestones[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
Thread: Any
Returns an array of string containing the name of all the unlockable milestones
Thread: Simulation
Unlocks the Milestone designated by the name parameter. Use EnumerateMilestones() to list all the available milestone strings
IMilestonesExtension[edit]
void OnCreated(IMilestones milestones);Thread: Main
Invoked when the extension initializes
Thread: Main
Invoked when the extension deinitializes
Thread: Simulation
Called every time the game checks updates the user progression status
Thread: Any
Returns the number of citizens needed to reach to the next milestone
The originalTarget parameter is the number of citizens desired to pass the milestone as foreseen by the developers
The scaledTarget parameter is the number of citizens expected to pass the milestone as calculated by the game accounting for the buildable area
MilestonesExtensionBase[edit]
IManagers managers { get; }Thread: Any
Gets global managers interfaces
-