Skip to content

Instantly share code, notes, and snippets.

View boformer's full-sized avatar

boformer boformer

  • Ruhr-Universität Bochum
  • Bochum, Germany
View GitHub Profile
@boformer
boformer / Mod.cs
Last active February 13, 2022 20:46
CRP File Merger and Optimizer
/*
* Copyright 2022 Felix Schmidt
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
var prefab = PrefabCollection<NetInfo>.FindLoaded("Metro Station Track Elevated 01");
prefab.m_availableIn = ItemClass.Availability.AssetEditor;
prefab.m_placementStyle = ItemClass.Placement.Manual;
@boformer
boformer / Mod.cs
Last active July 15, 2021 07:22
Example Harmony 2.x Cities: Skylines Mod (Harmony provided by CitiesHarmony mod)
using ICities;
using System;
using ColossalFramework.PlatformServices;
using ColossalFramework.Plugins;
namespace HarmonyMod {
public class Mod : IUserMod {
// You can add Harmony 1.2.0.8 as a dependency, but make sure that 0Harmony.dll is not copied to the output directory!
// (0Harmony.dll is provided by CitiesHarmony workshop item)
@boformer
boformer / cel-documentation.md
Last active January 14, 2023 22:37
Custom Effect Loader Documentation
@boformer
boformer / EffectsDefinition.xml
Last active August 15, 2022 20:22
CustomEffectLoader Definition File
<?xml version="1.0" encoding="utf-8"?>
<EffectsDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Effects>
<LightEffect
name="boformer.MY CUSTOM EFFECT"
type="Spot"
intensity="6.2"
range="500"
spotAngle="10"
spotLeaking="0.5"
var netManager = NetManager.instance;
for (ushort n = 0; n < NetManager.MAX_NODE_COUNT; n++)
{
if ((netManager.m_nodes.m_buffer[n].m_flags & NetNode.Flags.Created) != NetNode.Flags.None)
{
var segmentCount = netManager.m_nodes.m_buffer[n].CountSegments();
if (segmentCount == 0)
{
Debug.Log("Releasing ghost node " + n);
netManager.ReleaseNode(n);
@boformer
boformer / prop-rotating-multi.cs
Created April 25, 2019 09:19
Rotating props without PropRotatingParams mod (based on a script by Ronyx69) - Multiple rotating parts
// Warning: Do not save vehicles after running this script without a game restart!
// Prop Rotating Script for multiple rotating parts.
// Control rotation axis, pivot and speed.
// Run in asset editor and see effects in real time.
// The LODs are not rotating, they are like regular props.
// Vertex color blue channel for rotating parts must be 0.
@boformer
boformer / prop-rotating-single.cs
Last active April 25, 2019 09:19
Rotating props without PropRotatingParams mod (based on a script by Ronyx69) - Single rotating part
// Warning: Do not save vehicles after running this script without a game restart!
// Prop Rotating Script
// Control rotation axis, pivot and speed.
// Run in asset editor and see effects in real time.
// Animated faces must be vertex painted black! The rest reimains white.
// Google how to do vertex color painting in your 3d software of choice!
mkdir "%LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)"
del "%LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)\$(TargetFileName)"
xcopy /y "$(TargetPath)" "%LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)"
xcopy /y "$(TargetDir)0Harmony.dll" "%LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)"
using Harmony;
using ICities;
using UnityEngine;
namespace NoParkBuildingFires
{
public class Mod : IUserMod
{
private const string HarmonyId = "boformer.NoParkBuildingFires";
private HarmonyInstance _harmony;