b99.4 main update
- Updated MapTool to work with b99.4 - Extracted updated demonstrator locations - Extracted updated track data
This commit is contained in:
1 parent
510d7f9bdf
commit
ea87d37106
7 files changed
+1400
-1367
No files matched your search
@@ -46,6 +46,18 @@
|
|||||||
<HintPath>lib\BezierCurves.dll</HintPath>
|
<HintPath>lib\BezierCurves.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DV.OriginShiftInfo">
|
||||||
|
<HintPath>lib\DV.OriginShiftInfo.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DV.RailTrack">
|
||||||
|
<HintPath>lib\DV.RailTrack.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DV.Utils">
|
||||||
|
<HintPath>lib\DV.Utils.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"Id":"CommunityMapTool",
|
"Id":"CommunityMapTool",
|
||||||
"DisplayName":"Derail Valley Community Map Tool",
|
"DisplayName":"Derail Valley Community Map Tool",
|
||||||
"Author":"PyroNicampt",
|
"Author":"PyroNicampt",
|
||||||
"Version":"1.1.0",
|
"Version":"1.2.0",
|
||||||
"ManagerVersion":"0.31.1.0",
|
"ManagerVersion":"0.31.1.0",
|
||||||
"EntryMethod":"CommunityMapTool.Main.Load"
|
"EntryMethod":"CommunityMapTool.Main.Load"
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,14 @@ using System.Text;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityModManagerNet;
|
using UnityModManagerNet;
|
||||||
using DV.LocoRestoration;
|
using DV.LocoRestoration;
|
||||||
using DV;
|
using DV.OriginShift;
|
||||||
|
|
||||||
namespace CommunityMapTool {
|
namespace CommunityMapTool {
|
||||||
[EnableReloading]
|
[EnableReloading]
|
||||||
static class Main {
|
static class Main {
|
||||||
private static string trackOutputPath = "map_dump.json";
|
private static string trackOutputPath = "map_dump.json";
|
||||||
private static string demonstratorOutputPath = "demo_dump.json";
|
private static string demonstratorOutputPath = "demo_dump.json";
|
||||||
|
private static string statusText = "";
|
||||||
static bool Load(UnityModManager.ModEntry modEntry) {
|
static bool Load(UnityModManager.ModEntry modEntry) {
|
||||||
modEntry.OnUpdate = OnUpdate;
|
modEntry.OnUpdate = OnUpdate;
|
||||||
modEntry.OnUnload = Unload;
|
modEntry.OnUnload = Unload;
|
||||||
@@ -28,20 +29,27 @@ namespace CommunityMapTool {
|
|||||||
}
|
}
|
||||||
static void OnGUI(UnityModManager.ModEntry modEntry) {
|
static void OnGUI(UnityModManager.ModEntry modEntry) {
|
||||||
if(PlayerManager.PlayerTransform != null) GUILayout.Label($"Player Position: {PlayerManager.PlayerTransform.AbsolutePosition()}");
|
if(PlayerManager.PlayerTransform != null) GUILayout.Label($"Player Position: {PlayerManager.PlayerTransform.AbsolutePosition()}");
|
||||||
GUILayout.Label($"WorldMover offset: {WorldMover.currentMove}");
|
GUILayout.Label($"WorldMover offset: {OriginShift.currentMove}");
|
||||||
if(GUILayout.Button("Dump All Tracks")) DumpAllTracks();
|
if(GUILayout.Button("Dump All Tracks")) DumpAllTracks();
|
||||||
if(GUILayout.Button("Dump Demonstrator Spawnpoints")) DemonstratorDump();
|
if(GUILayout.Button("Dump Demonstrator Spawnpoints")) DemonstratorDump();
|
||||||
if(GUILayout.Button("Copy Position To Clipboard")) ClipboardPlayerPosition();
|
if(GUILayout.Button("Copy Position To Clipboard")) ClipboardPlayerPosition();
|
||||||
|
if(statusText != "") GUILayout.Label(statusText);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ClipboardPlayerPosition() {
|
static void ClipboardPlayerPosition() {
|
||||||
if(PlayerManager.PlayerTransform == null) return;
|
if(PlayerManager.PlayerTransform == null) return;
|
||||||
Vector3 pos = PlayerManager.PlayerTransform.AbsolutePosition();
|
Vector3 pos = PlayerManager.PlayerTransform.AbsolutePosition();
|
||||||
GUIUtility.systemCopyBuffer = $"{{\"x\":{pos.x},\"y\":{pos.y},\"z\":{pos.z}}}";
|
GUIUtility.systemCopyBuffer = $"{{\"x\":{pos.x},\"y\":{pos.y},\"z\":{pos.z}}}";
|
||||||
|
statusText = $"Copied \"{GUIUtility.systemCopyBuffer}\" to clipboard";
|
||||||
}
|
}
|
||||||
static void DumpAllTracks() {
|
static void DumpAllTracks() {
|
||||||
List<string> records = new List<string>();
|
List<string> records = new List<string>();
|
||||||
foreach(RailTrack railTrack in WorldData.RailTracks) {
|
RailTrackRegistry registry = UnityEngine.Object.FindObjectOfType<RailTrackRegistry>();
|
||||||
|
if(registry == null) {
|
||||||
|
statusText = "Could not find RailtrackRegistry";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach(RailTrack railTrack in registry.OrderedRailtracks) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
string[] baseCurveData = new[] {
|
string[] baseCurveData = new[] {
|
||||||
"type", "bezier",
|
"type", "bezier",
|
||||||
@@ -57,16 +65,16 @@ namespace CommunityMapTool {
|
|||||||
for(int i = 0; i < railTrack.curve.pointCount; i++) {
|
for(int i = 0; i < railTrack.curve.pointCount; i++) {
|
||||||
BezierPoint point = railTrack.curve[i];
|
BezierPoint point = railTrack.curve[i];
|
||||||
sb.Append("\n\t\t{");
|
sb.Append("\n\t\t{");
|
||||||
sb.Append($"\"position\":{{\"x\":{point.position.x - WorldMover.currentMove.x},\"y\":{point.position.y - WorldMover.currentMove.y},\"z\":{point.position.z - WorldMover.currentMove.z}}}, ");
|
sb.Append($"\"position\":{{\"x\":{point.position.x - OriginShift.currentMove.x},\"y\":{point.position.y - OriginShift.currentMove.y},\"z\":{point.position.z - OriginShift.currentMove.z}}}, ");
|
||||||
sb.Append($"\"h1\":{{\"x\":{point.globalHandle1.x - WorldMover.currentMove.x},\"y\":{point.globalHandle1.y - WorldMover.currentMove.y},\"z\":{point.globalHandle1.z - WorldMover.currentMove.z}}}, ");
|
sb.Append($"\"h1\":{{\"x\":{point.globalHandle1.x - OriginShift.currentMove.x},\"y\":{point.globalHandle1.y - OriginShift.currentMove.y},\"z\":{point.globalHandle1.z - OriginShift.currentMove.z}}}, ");
|
||||||
sb.Append($"\"h2\":{{\"x\":{point.globalHandle2.x - WorldMover.currentMove.x},\"y\":{point.globalHandle2.y - WorldMover.currentMove.y},\"z\":{point.globalHandle2.z - WorldMover.currentMove.z}}}, ");
|
sb.Append($"\"h2\":{{\"x\":{point.globalHandle2.x - OriginShift.currentMove.x},\"y\":{point.globalHandle2.y - OriginShift.currentMove.y},\"z\":{point.globalHandle2.z - OriginShift.currentMove.z}}}, ");
|
||||||
sb.Append($"\"type\":\"{point.handleStyle}\"");
|
sb.Append($"\"type\":\"{point.handleStyle}\"");
|
||||||
sb.Append(i + 1 < railTrack.curve.pointCount ? "}," : "}");
|
sb.Append(i + 1 < railTrack.curve.pointCount ? "}," : "}");
|
||||||
}
|
}
|
||||||
sb.Append("\n\t]\n}");
|
sb.Append("\n\t]\n}");
|
||||||
records.Add(sb.ToString());
|
records.Add(sb.ToString());
|
||||||
}
|
}
|
||||||
foreach(Junction junction in WorldData.Junctions) {
|
foreach(Junction junction in registry.OrderedJunctions) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
string[] baseJunctionData = new[] {
|
string[] baseJunctionData = new[] {
|
||||||
@@ -91,6 +99,7 @@ namespace CommunityMapTool {
|
|||||||
records.Add(sb.ToString());
|
records.Add(sb.ToString());
|
||||||
}
|
}
|
||||||
File.WriteAllText(trackOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
|
File.WriteAllText(trackOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
|
||||||
|
statusText = $"Dumped to {trackOutputPath}";
|
||||||
}
|
}
|
||||||
static void DemonstratorDump() {
|
static void DemonstratorDump() {
|
||||||
List<string> records = new List<string>();
|
List<string> records = new List<string>();
|
||||||
@@ -100,7 +109,7 @@ namespace CommunityMapTool {
|
|||||||
string[] jsonKVP = new[] {
|
string[] jsonKVP = new[] {
|
||||||
"name", $"\"{spawnPoint.name}\"",
|
"name", $"\"{spawnPoint.name}\"",
|
||||||
"type", $"\"demonstratorSpawn\"",
|
"type", $"\"demonstratorSpawn\"",
|
||||||
"position", $"{{\"x\":{spawnPoint.transform.position.x - WorldMover.currentMove.x},\"y\":{spawnPoint.transform.position.y - WorldMover.currentMove.y},\"z\":{spawnPoint.transform.position.z - WorldMover.currentMove.z}}}"
|
"position", $"{{\"x\":{spawnPoint.transform.position.x - OriginShift.currentMove.x},\"y\":{spawnPoint.transform.position.y - OriginShift.currentMove.y},\"z\":{spawnPoint.transform.position.z - OriginShift.currentMove.z}}}"
|
||||||
};
|
};
|
||||||
for(int i = 0; i < jsonKVP.Length; i++) {
|
for(int i = 0; i < jsonKVP.Length; i++) {
|
||||||
if(i % 2 == 0) sb.Append($"\n\t\"{jsonKVP[i]}\":");
|
if(i % 2 == 0) sb.Append($"\n\t\"{jsonKVP[i]}\":");
|
||||||
@@ -114,6 +123,7 @@ namespace CommunityMapTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllText(demonstratorOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
|
File.WriteAllText(demonstratorOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
|
||||||
|
statusText = $"Dumped to {demonstratorOutputPath}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
|
Assuming Visual Studio Community:
|
||||||
|
|
||||||
1. Add the following to the `lib` folder from `[steam common dir]/Derail Valley/DerailValley_Data/Managed/UnityModManager`:
|
1. Add the following to the `lib` folder from `[steam common dir]/Derail Valley/DerailValley_Data/Managed/UnityModManager`:
|
||||||
- `Assembly-CSharp.dll`
|
- `Assembly-CSharp.dll`
|
||||||
- `BezierCurves.dll`
|
- `BezierCurves.dll`
|
||||||
|
- `DV.OriginShiftInfo.dll`
|
||||||
|
- `DV.RailTrack.dll`
|
||||||
|
- `DV.Utils.dll`
|
||||||
- `UnityEngine.dll`
|
- `UnityEngine.dll`
|
||||||
- `UnityEngine.UI.dll`
|
- `UnityEngine.UI.dll`
|
||||||
- `UnityEngine.InputLegacyModule.dll`
|
- `UnityEngine.InputLegacyModule.dll`
|
||||||
@@ -8,3 +13,9 @@
|
|||||||
- `UnityEngine.CoreModule.dll`
|
- `UnityEngine.CoreModule.dll`
|
||||||
- `/UnityModManager/0Harmony.dll`
|
- `/UnityModManager/0Harmony.dll`
|
||||||
- `/UnityModManager/UnityModManager.dll`
|
- `/UnityModManager/UnityModManager.dll`
|
||||||
|
|
||||||
|
2. Build Solution
|
||||||
|
3. Copy `info.json` and `bin/debug/CommunityMapTool.dll` to `Derail Valley/Mods/CommunityMapTool`
|
||||||
|
4. Run game using [Unity Mod Manager](https://www.nexusmods.com/site/mods/21)
|
||||||
|
|
||||||
|
Mod functions are all within the UMM settings screen.
|
||||||
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
<div id="cursorCoordDisplay"></div>
|
<div id="cursorCoordDisplay"></div>
|
||||||
Map v0.6.1 alpha
|
Map v0.6.1 alpha
|
||||||
<br>
|
<br>
|
||||||
Updated for Game Build 99.3
|
Updated for Game Build 99.4
|
||||||
<br>
|
<br>
|
||||||
This tool is a fan work, Derail Valley owned by Altfuture
|
This tool is a fan work, Derail Valley owned by Altfuture
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -963,7 +963,7 @@
|
|||||||
{
|
{
|
||||||
"name":"spawn anchor CW Bush 22m",
|
"name":"spawn anchor CW Bush 22m",
|
||||||
"type":"demonstratorSpawn",
|
"type":"demonstratorSpawn",
|
||||||
"position":{"x":1827.585,"y":122.213,"z":5668.852}
|
"position":{"x":1823.676,"y":122.213,"z":5664.788}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"spawn anchor CS Field 50m",
|
"name":"spawn anchor CS Field 50m",
|
||||||
@@ -1088,7 +1088,7 @@
|
|||||||
{
|
{
|
||||||
"name":"spawn anchor CME Mine 30m",
|
"name":"spawn anchor CME Mine 30m",
|
||||||
"type":"demonstratorSpawn",
|
"type":"demonstratorSpawn",
|
||||||
"position":{"x":15541.85,"y":179.9383,"z":11026.77}
|
"position":{"x":15552.81,"y":181.5,"z":11033.37}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"spawn anchor MF Roundhouse 50m",
|
"name":"spawn anchor MF Roundhouse 50m",
|
||||||
|
|||||||
+1355
-1355
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user