Coder Social home page Coder Social logo

adeeds / cce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paavohuhtala/cce

0.0 3.0 0.0 206 KB

Cities Compiler Extender. More APIs in scripting mods without using an external compiler. Forked to work on OSX

License: MIT License

Makefile 8.14% C# 91.86%

cce's Introduction

Cities Compiler Extender - CCE

A tool for Cities: Skylines for easier mod development.

TL;DR

Allows you to use more stuff in scripting mods without having to use an external compiler.

Why?

Cities: Skylines comes with a built-in C# compiler, which allows you to hot-compile and hot-load mod scripts while running the game. Unfortunately you can only use certain assemblies, which means that the mods developed this way are heavily limited, since the most powerful & useful APIs are not available.

Luckily, you can compile your mods with an external compiler to bypass the limitations, but by default the game won't reload your mods without a restart. You can delete your mod binary and change the assembly version every time you recompile it (which can be automated in an IDE) to enable hot-loading, but it is not ideal.

This tool gives you the ability to use additional assembly references in code-only mods. This is accomplished by modifying one of the game's assemblies (namely Assembly-CSharp.dll) to change the internal compiler's configuration to include Assembly-CSharp.dll and ColossalManaged.dll into the list of referenced assemblies.

Caveats

You have to (most likely) run this tool again after each game update. This tool might (and probably will) stop working at some point in the future, because it relies on the bytecode of Starter.Awake() not changing too much.

How to use

.NET
CCE path-to-the-game-directory

Mono
mono CCE path-to-the-game-directory

The path must be an absolute path to the game's installation directory (for example "C:/Program Files (x86)/Steam/steamapps/common/Cities_Skylines"). The tool creates a new file, which is called Assembly-CSharp.mod.dll, in Cities_Data/Managed. This tool won't overwrite the existing Assembly-CSharp.dll. You have to backup the current version of the file and replace it yourself with the modified version.

How to build

If you have installed make and Mono, just run 'make' in the root directory of the project. If you haven't, you can create a Visual Studio/Monodevelop solution yourself. The project requires Mono.Cecil, which is included in /Dependencies.

Prebuilt binaries

Not currently available.

Todo

  • Automatic backup of Assembly-CSharp.dll
  • A Visual Studio project file
  • Better error handling
    • For example, a warning if the .dll has been already modified

License

See LICENSE.txt.

cce's People

Contributors

adeeds avatar paavohuhtala avatar

Watchers

 avatar  avatar  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.