Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;
using System.Reflection;
using ICities;
using UnityEngine;
namespace LightEffects
// Custom Light Effects Scripts
// Adds custom light effects to props.
// Multiple effects can be added, including vanilla ones.
// The mod is not required to run the scripts or save the asset.
// It's only required for loading them.
@ronyx69
ronyx69 / PropRotating_Script.cs
Last active May 29, 2022 16:00
Script for saving PropRotating params in props. (Added modless shader parameter saving method by boformer.)
// 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!
// The LODs are not rotating, they are like regular props.
@ronyx69
ronyx69 / PropRotating_Mod.cs
Last active September 24, 2018 13:34
Source code for the PropRotating Params mod.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICities;
using UnityEngine;
namespace PropRotating
{
public class PropRotatingMod : LoadingExtensionBase, IUserMod
@ronyx69
ronyx69 / PropMesh_To_NetworkMesh
Last active July 27, 2017 14:58
Replaces a network segment/node mesh with a mesh from a prop.
// PropMesh To NetworkMesh
var propName = "Barrels";
var networkName = "Train Track";
var type = "segment"; // segment or node
var id = 1;
var replaceTexture = false; // true or false
var prop = PrefabCollection<PropInfo>.FindLoaded(propName); // PropInfo, BuildingInfo, VehicleInfo, TreeInfo
@ronyx69
ronyx69 / ShaderChange_FloatingBuilding.cs
Last active August 2, 2017 18:45
Change the shader of a building or prop to floating building in asset editor.
//building
var shader = Shader.Find("Custom/Buildings/Building/Floating");
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;
//prop
@ronyx69
ronyx69 / LightingRebalance.cs
Last active August 7, 2017 15:58
My locally modded lighting and tonemapping settings, fine tuned for vanilla temperate theme and a custom high contrast LUT. http://i.imgur.com/AJ54HWo.png
using ICities;
using System;
using System.Reflection;
using UnityEngine;
namespace LightingRebalance
{
public class LightingRebalanceMod : LoadingExtensionBase, IUserMod
{
public string Name
{
@ronyx69
ronyx69 / Realtime_WIP_TexturesOnly.cs
Last active August 19, 2017 21:40
Script to replace any texture of a prop.
// Textures must be placed in gamefolder/textures/props
// For example if my prop file name is snow1 and asset name is also snow1,
// then the textures would be called snow1.snow1_Data_d.png
// snow1.snow1_Data_a.png, snow1.snow1_Data_n.png and so on...
var assetname = "snow1.snow1_Data"; // CHANGE ONLY THIS
var asset = PrefabCollection<PropInfo>.FindLoaded(assetname);
var assetMaterial = asset.m_material; var texturePath = " ";
Texture2D providedTexture=null; Color px;
@ronyx69
ronyx69 / Realtime_NoUI.cs
Created August 26, 2017 19:07
Replaces textures/meshes for buildings/props/vehicles/trees ingame in realtime. (No User Interface)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using ICities;
using UnityEngine;
using ColossalFramework.IO;
using ObjUnity3D;
//scripts to use with the Realtime mod, filename must match file prefix in import folder
var type="building";
var filename="thing"; var assetname="thing";
Type.GetType("Realtime.RealtimeMod").GetMethod(type).Invoke(null, new object[] { filename, assetname });
var type="prop";
var filename="snow1"; var assetname="snow1";
Type.GetType("Realtime.RealtimeMod").GetMethod(type).Invoke(null, new object[] { filename, assetname });