Skip to content

Instantly share code, notes, and snippets.

Avatar

Ronyx69 ronyx69

View GitHub Profile
@ronyx69
ronyx69 / ThemeDecals_Script.cs
Last active Apr 12, 2017
Script for creating your own theme decals.
View ThemeDecals_Script.cs
// You MUST use a unique diffuse texture (put whatever texture in it) to avoid unforeseen consequences!
// Import a decal or a big decal as usual and run this script using the texture tag you want:
//themedecal-grass
//themedecal-cliff
//themedecal-sand
//themedecal-gravel
//themedecal-ruined
//themedecal-oil
@ronyx69
ronyx69 / PloppableAsphalt_Script.cs
Last active Apr 12, 2017
Sets tags for props/decals for ploppable asphalt.
View PloppableAsphalt_Script.cs
//asphalt props
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
asset.m_mesh.name="ploppableasphalt-prop";
//asphalt decal
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
asset.m_mesh.name="ploppableasphalt-decal";
@ronyx69
ronyx69 / EmptyMod_Delayed.cs
Last active Apr 12, 2017
An empty mod which waits for all mods to be loaded.
View EmptyMod_Delayed.cs
using ColossalFramework.Plugins;
using ColossalFramework.UI;
using ICities;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace ThemeDecals
@ronyx69
ronyx69 / Vehicle_to_Prop.cs
Last active Apr 12, 2017
A first draft at converting a vehicle to a prop ingame.
View Vehicle_to_Prop.cs
var vehicle = PrefabCollection<VehicleInfo>.FindLoaded("Sedan"); //get the vehicle
var prop = PrefabCollection<PropInfo>.FindLoaded("Cargo container"); //get the prop
prop.m_mesh=vehicle.m_mesh; //apply vehicle mesh to the prop
prop.m_material.SetTexture("_MainTex", vehicle.m_material.GetTexture("_MainTex")); //apply vehicle diffuse to prop
prop.m_material.SetTexture("_XYSMap", vehicle.m_material.GetTexture("_XYSMap")); //apply vehicle XYS to prop
Texture2D aci; aci = new Texture2D(1, 1); //make new empty texture
aci = vehicle.m_material.GetTexture("_ACIMap"); //WRONG!!! ACI should be made unique/instantiated!? idk
@ronyx69
ronyx69 / NetworkList.cs
Last active Apr 12, 2017
Lists all networks in a text file.
View NetworkList.cs
var prefabNames = new List<string>();
for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++)
{
var prefab = PrefabCollection<NetInfo>.GetLoaded(i);
if (prefab == null) continue;
Debug.Log(prefab);
prefabNames.Add(prefab.ToString());
}
prefabNames.Sort();
var s="\n";
@ronyx69
ronyx69 / TextureReplacer.cs
Last active Apr 12, 2017
Replace textures in real time ingame.
View TextureReplacer.cs
// Texture Replacer script by Ronyx69
// INGAME not ASSET EDITOR
// Replaces textures ingame in real time!
// Much thanks to SamsamTS for explaining Actions to me and being helpful.
// D, ACI, XYS textures for buildings, props, vehicles and D, XYCA for trees.
// Unfortunately CANNOT replace LOD textures.
// Technically I know how to replace LOD textures,
@ronyx69
ronyx69 / TextureReplacer_AssetEditor.cs
Last active May 18, 2017
Replace textures in real time in asset editor.
View TextureReplacer_AssetEditor.cs
// Texture Replacer script by Ronyx69
// ASSET EDITOR, not ingame
// Replaces textures in asset editor in real time!
// Much thanks to SamsamTS for explaining Actions to me and being helpful.
// D, ACI, XYS textures for buildings, props, vehicles and D, XYCA for trees.
// Unfortunately CANNOT replace LOD textures.
// Technically I know how to replace LOD textures,
@ronyx69
ronyx69 / PropMesh_To_NetworkMesh
Last active Jul 27, 2017
Replaces a network segment/node mesh with a mesh from a prop.
View PropMesh_To_NetworkMesh
// 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 Aug 2, 2017
Change the shader of a building or prop to floating building in asset editor.
View ShaderChange_FloatingBuilding.cs
//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 Aug 7, 2017
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
View LightingRebalance.cs
using ICities;
using System;
using System.Reflection;
using UnityEngine;
namespace LightingRebalance
{
public class LightingRebalanceMod : LoadingExtensionBase, IUserMod
{
public string Name
{
You can’t perform that action at this time.