Code Monkey home page Code Monkey logo

cities-skylines-2-mod-template's Introduction

Cities: Skylines 2 - C# Mod template

This repository template allows you to get started with Cities: Skylines 2 modding easily, all the way to building your mod on commit with GitHub Actions and publishing your mod automatically on Thunderstore.

Requirements

Usage

  • Create a new repository based on this one
  • Clone your new repository to your computer
  • Uncomment and update the Cities2_Location variable in MyCoolMod.csproj
  • Run make build

After running the last command, the mod should be automatically copied to your game directory, so launching the game should include running the mod you just started :)

Renaming your project

You can leverage the helper script in scripts/rename.csx in order to replace "MyCoolMod" with whatever you want to name your project. Usage:

$ dotnet script scripts\rename.csx "MyCoolMod" "AnotherModIMade"

Set license details

You'll need to update LICENSE with the correct details for <Year> and <Author>, and change "MyCoolMod" to your mod name if you haven't already.

Incrementing version number

  • Update .csproj file with new version number
  • Update thunderstore.toml file with new version number
  • Update CHANGELOG to describe the changes you've made between this and previous version
  • Commit version bump
  • Do a git tag with the new version number
    • git tag -a v0.2.0 -m v0.2.0
  • Push your changes + tags
    • git push origin master --tags

CI / GitHub Actions - Setup

In order to get the CI/GitHub Actions workflow to work, you have to do a couple of things.

  • Create a new private repository with all the game DLLs that you require for building your mod
  • Create a new GitHub Personal Access Token ("PAT") that has only READ access to the created private repository
  • Create a new secret variable in GitHub Actions called GH_PAT that has your PAT with read access to the private repository

Now the CI job should work as expected :)

Regarding BepInEx version 5 (Stable) VS 6 (Alpha/Unstable/Nightly)

Currently, this mod template defaults to building against BepInEx version 6 (unstable pre-release). If you'd like to instead use Stable BepInEx version 5, you can run the build like this:

$ make build BEPINEX_VERSION=5

In order to run code only for one BepInEx version, you can do something like this:

#if BEPINEX_V6
    using BepInEx.Unity.Mono;
#endif

That would only run using BepInEx.Unity.Mono when you're building the project for BepInEx 6. Add in a else if you want to do something different when it's version 5.

Credits

  • Thanks to Cities Skylines 2 Unofficial Modding Discord
  • Particular thanks to @StudioLE who helped with feedback and improving .csproj setup

Community

Looking to discuss Cities: Skylines 2 Unofficial modding together with other modders? You're welcome to join our "Cities 2 Modding" Discord, which you can find here: https://discord.gg/vd7HXnpPJf

cities-skylines-2-mod-template's People

Contributors

captain-of-coit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.