Skip to content

Instantly share code, notes, and snippets.

@ronyx69
ronyx69 / SteamWorkshopStatsSheetString.js
Last active December 28, 2018 13:08
Prints out a string of workshop stats (name, days, visitors, subs (current), subs (total), favs (current), favs (total), positive ratings, negative ratings), ready to be pasted into google sheets and must be automatically seperated by @ character. Run in developer console while item stats page is open.
(function(){ 'use strict';
var headingNodes = [], results, link, tags = ['td'];
tags.forEach(function(tag) {
results = document.getElementsByTagName(tag);
Array.prototype.push.apply(headingNodes, results);
});
console.log(
document.getElementsByClassName("workshopItemTitle")[0].innerHTML + '@' +
document.getElementsByClassName("littleNum")[0].innerHTML.split(" ")[1] + '@' +
results[1].innerHTML + '@' + results[3].innerHTML + '@' + results[5].innerHTML +
@ronyx69
ronyx69 / HDRIH1.cs
Created December 10, 2018 14:14
Source code for the HDRI Haven Cubemap Pack.
using ICities;
using System;
namespace HDRIH1Cubemap
{
public class HDRIH1Cubemap : IUserMod
{
public string Name
{
get
@ronyx69
ronyx69 / Railway_StationTrackTagger.cs
Last active May 22, 2021 11:13
Tag station tracks for usage in Railway track replacer UI.
var stationTrackType = "r69rwst-double"; // The type of station track:
// r69rwst-double (normal double station track)
// r69rwst-edouble (elevated double station track)
// r69rwst-single2 (single station track - two sided boarding)
// r69rwst-single1 (single station track - left sided boarding)
// r69rwst-singler (single station track - right sided boarding)
// r69rwst-esingle2 (elevated single station track - two sided boarding (shinkansen only afaik))
// r69rwst-esinglel (elevated single station track - left sided boarding)
@ronyx69
ronyx69 / Railway_PropTagger.cs
Last active May 22, 2021 11:16
Tag props for selection in Railway Replacer prop UI.
var styleName = "Sugondese"; // Name which will be visible in the UI
var type = "cat1n"; // The type of prop:
// cat1n single normal catenary
// cat1e single end-catenary
// cat1t single tunnel catenary
// cat2n double normal catenary
// cat2e double end-catenary
// cat2t double tunnel catenary
@ronyx69
ronyx69 / RotorsShader_VehicleGlass.cs
Created November 24, 2018 19:06
Use static rotors shader sub meshes on vehicles for glass.
// Rotors Shader for Vehicle Glass
// Limited to 32 vertices per sub mesh.
// All vertex normals should be straight on the chosen axis.
var subMesh = 1; // vehicle sub mesh id starting from 1, as seen in the asset editor ui
var axis = "y"; // axis explanations:
// x - facing to the side, spins like a wheel
// y - facing up or down, spins like a heli propeller
// z - facing forward or backward, spins like a plane propeller, requires Rotors FlipXZ mod
@ronyx69
ronyx69 / TrafficLightRailwayBarrier_Script.cs
Last active April 10, 2021 13:21
Script for saving Traffic Light Shader params in props, for Railway Barriers. (Added modless shader parameter saving method by boformer.)
// Traffic Light Shader - Railway Crossing Barriers
// Control rotation axis and pivot.
// Run in asset editor.
// (This used to require the PropRotating mod but that is no longer necessary)
// (added modless shader parameter saving method by boformer)
// Rotating parts must be vertex painted black! The rest reimains white.
@ronyx69
ronyx69 / AssetEditor_RecalculateTangents.cs
Created September 12, 2018 13:23
Recalculates tangents for mesh and lod mesh, necessary if you used the mesh rotation feature in the importer, since that results in broken tangents which makes the normal map behave incorrectly. The normal map must +X +Y which means you DO NOT need to flip any channels.
// prop
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
if(asset.m_mesh != null) asset.m_mesh.RecalculateTangents();
if(asset.m_lodMesh != null) asset.m_lodMesh.RecalculateTangents();
@ronyx69
ronyx69 / LightEffectEdit_Ingame.cs
Created August 26, 2018 12:09
Ingame light effect editing script.
// Ingame light effect editing script.
// Add as many effect changes as necessary.
// Name of the light effect can be found by plopping the prop, and then
// going to [Ctrl+E] Scene Explorer > Tool Controller > Prop Tool >
// m_prefab > m_effects > m_effects.[id] > m_effect
// The light needs to be moved or plopped for the nearby area to update the effects.
@ronyx69
ronyx69 / FlipXZ.cs
Created August 4, 2018 13:14
Source code for the Rotors FlipXZ mod.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICities;
using UnityEngine;
namespace FlipXZ
{
public class FlipXZMod : LoadingExtensionBase, IUserMod
@ronyx69
ronyx69 / Detail.cs
Created July 16, 2018 15:57
Source code for the Detail mod.
using ColossalFramework.IO;
using ColossalFramework.UI;
using ICities;
using System;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace Detail