Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Created December 27, 2019 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronyx69/466ec13af77d6b44fcf50f7a8d2af152 to your computer and use it in GitHub Desktop.
Save ronyx69/466ec13af77d6b44fcf50f7a8d2af152 to your computer and use it in GitHub Desktop.
Renames elevations based on the name of the loaded asset.
// Renames elevations, to fix the game adding 0 or 1 to the elevation names, so that they can be kept consistent when updating a network multiple times.
// Do not run on a newly created network, it must be saved with the final name it should have, loaded again, and only then run this script.
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as NetInfo;
var ai = (asset.m_netAI as TrainTrackAI); // change this to RoadAI or something else if necessary.
if(ai.m_elevatedInfo != null) ai.m_elevatedInfo.name = ai.m_info.name.Substring(0, ai.m_info.name.Length-6) + " E";
if(ai.m_bridgeInfo != null) ai.m_bridgeInfo.name = ai.m_info.name.Substring(0, ai.m_info.name.Length-6) + " B";
if(ai.m_slopeInfo != null) ai.m_slopeInfo.name = ai.m_info.name.Substring(0, ai.m_info.name.Length-6) + " S";
if(ai.m_tunnelInfo != null) ai.m_tunnelInfo.name = ai.m_info.name.Substring(0, ai.m_info.name.Length-6) + " T";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment