This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning: Do not save vehicles after running this script without a game restart! | |
// Size of decal in meters - width and length | |
// (texture width and height will be stretched to match this) | |
var size = new Vector2(16.0f, 8.0f); | |
// Tiling amount | |
var tile = new Vector3(1.0f, 1.0f); | |
// Box mesh height, leave at a negative value to calculate automatically |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prefab = PrefabCollection<NetInfo>.FindLoaded("Metro Station Track Elevated 01"); | |
prefab.m_availableIn = ItemClass.Availability.AssetEditor; | |
prefab.m_placementStyle = ItemClass.Placement.Manual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using ICities; | |
using UnityEngine; | |
namespace SofterShadows | |
{ | |
public class SofterShadowsMod : LoadingExtensionBase, IUserMod | |
{ | |
public string Name => "Softer Shadows"; | |
public string Description => "Brightens up the shadows of the game"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning: Do not save vehicles after running this script without a game restart! | |
// 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. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ICities; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Xml.Serialization; | |
using UnityEngine; | |
using PrefabHook; | |
using ColossalFramework.UI; | |
using ColossalFramework.Plugins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prefabNames = new string[] | |
{ | |
"Pedestrian Connection", | |
"Pedestrian Connection Surface", | |
"Pedestrian Connection Inside", | |
"Pedestrian Connection Underground" | |
}; | |
foreach (var prefabName in prefabNames) | |
{ | |
var prefab = PrefabCollection<NetInfo>.FindLoaded(prefabName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var networkName = "Basic Road"; // replace with the one you want to edit | |
var segmentMaterial = PrefabCollection<NetInfo>.FindLoaded(networkName).m_segments[0].m_segmentMaterial; | |
Texture2D texture2D; | |
if (File.Exists("tt/" + networkName + "_D.png")) | |
{ | |
texture2D = new Texture2D(1, 1); | |
texture2D.LoadImage(File.ReadAllBytes("tt/" + networkName + "_D.png")); | |
texture2D.anisoLevel = 0; | |
segmentMaterial.SetTexture("_MainTex", texture2D); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var netManager = NetManager.instance; | |
for (ushort n = 0; n < NetManager.MAX_NODE_COUNT; n++) | |
{ | |
if ((netManager.m_nodes.m_buffer[n].m_flags & NetNode.Flags.Created) != NetNode.Flags.None) | |
{ | |
var segmentCount = netManager.m_nodes.m_buffer[n].CountSegments(); | |
if (segmentCount == 0) | |
{ | |
Debug.Log("Releasing ghost node " + n); | |
netManager.ReleaseNode(n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning: Do not save vehicles after running this script without a game restart! | |
// 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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning: Do not save vehicles after running this script without a game restart! | |
// Prop Rotating Script for multiple rotating parts. | |
// Control rotation axis, pivot and speed. | |
// Run in asset editor and see effects in real time. | |
// The LODs are not rotating, they are like regular props. | |
// Vertex color blue channel for rotating parts must be 0. |