b99.4 main update

- Updated MapTool to work with b99.4
- Extracted updated demonstrator locations
- Extracted updated track data
This commit is contained in:
Pyro Nicampt committed 2025-04-20 15:10:55 -05:00
1 parent 510d7f9bdf
commit ea87d37106
7 files changed
+1409 -1376

No files matched your search

+12
View File
@@ -46,6 +46,18 @@
<HintPath>lib\BezierCurves.dll</HintPath>
<Private>False</Private>
</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.Core" />
<Reference Include="System.Xml.Linq" />
+1 -1
View File
@@ -2,7 +2,7 @@
"Id":"CommunityMapTool",
"DisplayName":"Derail Valley Community Map Tool",
"Author":"PyroNicampt",
"Version":"1.1.0",
"Version":"1.2.0",
"ManagerVersion":"0.31.1.0",
"EntryMethod":"CommunityMapTool.Main.Load"
}
+18 -8
View File
@@ -5,13 +5,14 @@ using System.Text;
using UnityEngine;
using UnityModManagerNet;
using DV.LocoRestoration;
using DV;
using DV.OriginShift;
namespace CommunityMapTool {
[EnableReloading]
static class Main {
private static string trackOutputPath = "map_dump.json";
private static string demonstratorOutputPath = "demo_dump.json";
private static string statusText = "";
static bool Load(UnityModManager.ModEntry modEntry) {
modEntry.OnUpdate = OnUpdate;
modEntry.OnUnload = Unload;
@@ -28,20 +29,27 @@ namespace CommunityMapTool {
}
static void OnGUI(UnityModManager.ModEntry modEntry) {
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 Demonstrator Spawnpoints")) DemonstratorDump();
if(GUILayout.Button("Copy Position To Clipboard")) ClipboardPlayerPosition();
if(statusText != "") GUILayout.Label(statusText);
}
static void ClipboardPlayerPosition() {
if(PlayerManager.PlayerTransform == null) return;
Vector3 pos = PlayerManager.PlayerTransform.AbsolutePosition();
GUIUtility.systemCopyBuffer = $"{{\"x\":{pos.x},\"y\":{pos.y},\"z\":{pos.z}}}";
statusText = $"Copied \"{GUIUtility.systemCopyBuffer}\" to clipboard";
}
static void DumpAllTracks() {
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();
string[] baseCurveData = new[] {
"type", "bezier",
@@ -57,16 +65,16 @@ namespace CommunityMapTool {
for(int i = 0; i < railTrack.curve.pointCount; i++) {
BezierPoint point = railTrack.curve[i];
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($"\"h1\":{{\"x\":{point.globalHandle1.x - WorldMover.currentMove.x},\"y\":{point.globalHandle1.y - WorldMover.currentMove.y},\"z\":{point.globalHandle1.z - WorldMover.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($"\"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 - OriginShift.currentMove.x},\"y\":{point.globalHandle1.y - OriginShift.currentMove.y},\"z\":{point.globalHandle1.z - OriginShift.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(i + 1 < railTrack.curve.pointCount ? "}," : "}");
}
sb.Append("\n\t]\n}");
records.Add(sb.ToString());
}
foreach(Junction junction in WorldData.Junctions) {
foreach(Junction junction in registry.OrderedJunctions) {
StringBuilder sb = new StringBuilder();
string[] baseJunctionData = new[] {
@@ -91,6 +99,7 @@ namespace CommunityMapTool {
records.Add(sb.ToString());
}
File.WriteAllText(trackOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
statusText = $"Dumped to {trackOutputPath}";
}
static void DemonstratorDump() {
List<string> records = new List<string>();
@@ -100,7 +109,7 @@ namespace CommunityMapTool {
string[] jsonKVP = new[] {
"name", $"\"{spawnPoint.name}\"",
"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++) {
if(i % 2 == 0) sb.Append($"\n\t\"{jsonKVP[i]}\":");
@@ -114,6 +123,7 @@ namespace CommunityMapTool {
}
File.WriteAllText(demonstratorOutputPath, "[" + string.Join(",", records.ToArray()) + "\n]");
statusText = $"Dumped to {demonstratorOutputPath}";
}
}
}
+20 -9
View File
@@ -1,10 +1,21 @@
Assuming Visual Studio Community:
1. Add the following to the `lib` folder from `[steam common dir]/Derail Valley/DerailValley_Data/Managed/UnityModManager`:
- `Assembly-CSharp.dll`
- `BezierCurves.dll`
- `UnityEngine.dll`
- `UnityEngine.UI.dll`
- `UnityEngine.InputLegacyModule.dll`
- `UnityEngine.IMGUIModule.dll`
- `UnityEngine.CoreModule.dll`
- `/UnityModManager/0Harmony.dll`
- `/UnityModManager/UnityModManager.dll`
- `Assembly-CSharp.dll`
- `BezierCurves.dll`
- `DV.OriginShiftInfo.dll`
- `DV.RailTrack.dll`
- `DV.Utils.dll`
- `UnityEngine.dll`
- `UnityEngine.UI.dll`
- `UnityEngine.InputLegacyModule.dll`
- `UnityEngine.IMGUIModule.dll`
- `UnityEngine.CoreModule.dll`
- `/UnityModManager/0Harmony.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
View File
@@ -28,7 +28,7 @@
<div id="cursorCoordDisplay"></div>
Map v0.6.1 alpha
<br>
Updated for Game Build 99.3
Updated for Game Build 99.4
<br>
This tool is a fan work, Derail Valley owned by Altfuture
</div>
+2 -2
View File
@@ -963,7 +963,7 @@
{
"name":"spawn anchor CW Bush 22m",
"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",
@@ -1088,7 +1088,7 @@
{
"name":"spawn anchor CME Mine 30m",
"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",
+1355 -1355
View File
File diff suppressed because it is too large. Load diff