Skip to content

Instantly share code, notes, and snippets.

View TimTheTerribleCS's full-sized avatar

Tim The Terrible TimTheTerribleCS

  • Delft, The Netherlands
View GitHub Profile
@TimTheTerribleCS
TimTheTerribleCS / CatenaryReplacer.cs
Last active June 25, 2017 20:00
Catenary Replacer
using System.Collections;
using ICities;
using System.Collections.Generic;
using UnityEngine;
namespace CatenaryReplacer
{
public class CatenaryReplacerMod : LoadingExtensionBase, IUserMod
{
private string[] styles = new string[] { "No Catenary", "Dutch A", "Dutch B", "German A", "PRR A", "PRR B", "Japan A" };
Initialize engine version: 5.1.3p2 (bebcb01d8ab6)
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.0]
Renderer: NVIDIA GeForce GTX 770 (ID=0x1184)
Vendor: NVIDIA
VRAM: 2017 MB
Begin MonoManager ReloadAssembly
Platform assembly: E:\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll (this message is harmless)
Loading E:\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll into Unity Child Domain
var net = "Train Track";
var original = "RailwayPowerline";
var replacement = "NL_Powerline_2TB.NL_Powerline_2TB_Data";
var netInfo = PrefabCollection<NetInfo>.FindLoaded(net);
if (netInfo == null)
{
Debug.LogWarning("The name '" + net + "' you entered does not belong to a loaded net!");
return;
}
@TimTheTerribleCS
TimTheTerribleCS / ChangePosition
Created September 19, 2016 17:02
Change the position of a certain lane prop
var net = "Rail1L";
var netInfo = PrefabCollection<NetInfo>.FindLoaded(net);
if (netInfo.m_lanes != null)
{
foreach (var lane in netInfo.m_lanes)
{
if (lane != null && lane.m_laneProps != null && lane.m_laneProps.m_props != null)
{
foreach (var laneProp in lane.m_laneProps.m_props)
{
@TimTheTerribleCS
TimTheTerribleCS / StationTrack
Last active October 3, 2016 12:09
Lenghtens stations tracks
// specify the id of the segment you want to edit (search with the other script)
var segmentId = XXXXX;
// specifies how the start and end point of the segment are modified
// x, y, z in meters (the second parameter is the height)
var moveStart = new Vector3(-24, 0, 0);
var moveEnd = new Vector3(24, 0, 0);
// Here you can change the network type (e.g. from ground train track to elevated train track)
var changeNetTypeTo = "Train Station Track";
using ICities;
using System.Collections.Generic;
using UnityEngine;
namespace CatenaryReplacer
{
public class CatenaryReplacerMod : LoadingExtensionBase, IUserMod
{
private string[] styles = new string[] { "No Catenary", "Dutch A", "Dutch B", "German A", "PRR A", "PRR B" };
var shader = Shader.Find("Custom/Net/Electricity");
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo;
if(asset.m_material != null) asset.m_material.shader = shader;
if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;
using System;
using System.Linq;
using System.IO;
using System.Xml.Serialization;
using UnityEngine;
public abstract class Configuration<C> where C : class, new()
{
private static C instance;
@TimTheTerribleCS
TimTheTerribleCS / output_log.txt
Created January 8, 2017 20:10
output_log.txt
This file has been truncated, but you can view the full file.
Initialize engine version: 5.4.2f1 (94e3a60ee258)
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.0]
Renderer: NVIDIA GeForce GTX 770 (ID=0x1184)
Vendor: NVIDIA
VRAM: 2017 MB
Begin MonoManager ReloadAssembly
Platform assembly: E:\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll (this message is harmless)
Loading E:\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll into Unity Child Domain
// C:\Users\Tim\Downloads\NetworkMeshReplacer\NetworkMeshReplacer\NetworkMeshReplacer.dll
// NetworkMeshReplacer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Global type: <Module>
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 2.0
using ColossalFramework;
using ColossalFramework.Plugins;
using ColossalFramework.UI;