Skip to content

Instantly share code, notes, and snippets.

Avatar

Ronyx69 ronyx69

View GitHub Profile
@ronyx69
ronyx69 / ConvertTextureDump.cs
Created Jan 15, 2019
Converts a texture to a different format for dumping with mod tools, for cases where some textures can't be dumped normally. Puts the converted texture in Sunny Properties > Sunny Net > NetProperties >m_downwardDiffuse
View ConvertTextureDump.cs
// map theme texture
var source = UnityEngine.Object.FindObjectOfType<TerrainProperties>().m_grassDiffuse;
var target = new Texture2D(source.width, source.height, TextureFormat.RGBAFloat, true);
target.SetPixels(source.GetPixels());
target.anisoLevel = source.anisoLevel; target.filterMode = source.filterMode;
target.wrapMode = source.wrapMode; target.Apply();
UnityEngine.Object.FindObjectOfType<NetProperties>().m_downwardDiffuse = target;
@ronyx69
ronyx69 / UpdateBuildingColors_Ingame.cs
Created Jan 15, 2019
Refreshes building color variations ingame.
View UpdateBuildingColors_Ingame.cs
BuildingManager.instance.UpdateBuildingColors();
@ronyx69
ronyx69 / FlagParams_Mod.cs
Last active Jan 21, 2019
Source code for the Flag Params mod.
View FlagParams_Mod.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICities;
using UnityEngine;
namespace FlagParams
{
public class FlagParamsMod : LoadingExtensionBase, IUserMod
@ronyx69
ronyx69 / Flag_Script.cs
Last active Aug 26, 2020
Script for saving Flag shader params in props. (Added modless shader parameter saving method by boformer.)
View Flag_Script.cs
// The script will not work properly if you have no texture imported.
//
// The vertex paint of the mesh controls the amount of movement:
// white means no movement and black means maximum movement.
//
// If you're using multiple "flag" textures in one prop, (like vanilla flags)
// the flag must be entirely black and everything else should be white,
// and you can't use the strength variable, otherwise the UV mapping will break.
// The flag should be UV mapped onto the flag on the bottom right of the texture.
@ronyx69
ronyx69 / SteamWorkshopStatsSheetString.js
Last active Dec 28, 2018
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.
View SteamWorkshopStatsSheetString.js
(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 Dec 10, 2018
Source code for the HDRI Haven Cubemap Pack.
View HDRIH1.cs
using ICities;
using System;
namespace HDRIH1Cubemap
{
public class HDRIH1Cubemap : IUserMod
{
public string Name
{
get
@ronyx69
ronyx69 / Railway_StationTrackTagger.cs
Last active Jan 20, 2020
Tag station tracks for usage in Railway track replacer UI.
View Railway_StationTrackTagger.cs
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
Created Nov 27, 2018
Tag props for selection in Railway Replacer prop UI.
View Railway_PropTagger.cs
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 Nov 24, 2018
Use static rotors shader sub meshes on vehicles for glass.
View RotorsShader_VehicleGlass.cs
// 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 Sep 17, 2019
Script for saving Traffic Light Shader params in props, for Railway Barriers. (Added modless shader parameter saving method by boformer.)
View TrafficLightRailwayBarrier_Script.cs
// Traffic Light Shader - Railway Crossing Barriers
// Control rotation axis and pivot.
// Run in asset editor.
// (This is used to be part of 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.
You can’t perform that action at this time.