MSCO 2.10.3: bolt stages and part tightness synced, snap to pivot, admin tighten/loosen
- Every bolt (Screw FSM, stage 0-8) and every part's tightness (BoltCheck/Use "Tightness", counted by the tool) is synced as state - before only the bolt turned on other clients, the part stayed loose or tight there - Tightening a part (tool, admin, other player) snaps it exactly onto its pivot (installed parts sit at local 0), except screw-in parts and hinged doors/hoods - Admin VEHICLE tab: TIGHTEN/LOOSEN per part, TIGHTEN ALL/LOOSEN ALL, bolted/loose state - fsmdump "pivots": installed part offsets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+21
@@ -17,6 +17,7 @@ namespace MSCO
|
||||
public static string Write(string filter)
|
||||
{
|
||||
string[] filters = (filter ?? "").ToLowerInvariant().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (filter != null && filter.Trim().ToLowerInvariant() == "pivots") return WritePivots();
|
||||
if (filters.Length == 0) return "fsmdump <text>[,text2] - e.g. fsmdump garage";
|
||||
var sb = new StringBuilder();
|
||||
int count = 0;
|
||||
@@ -51,6 +52,26 @@ namespace MSCO
|
||||
return count + " FSM(s) written to " + file;
|
||||
}
|
||||
|
||||
/// <summary>Eingebaute Teile: Lage relativ zu ihrem Halter (pivot_...) - ist sie immer 0?</summary>
|
||||
static string WritePivots()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
int count = 0;
|
||||
foreach (Transform t in Resources.FindObjectsOfTypeAll<Transform>())
|
||||
{
|
||||
if (t == null || t.gameObject.hideFlags != HideFlags.None || !t.name.StartsWith("pivot_")) continue;
|
||||
foreach (Transform child in t)
|
||||
{
|
||||
count++;
|
||||
sb.Append(FsmSync.PathOf(child)).Append(" | pos ").Append(child.localPosition.ToString("F4"))
|
||||
.Append(" rot ").Append(child.localEulerAngles.ToString("F1")).Append(" active ").Append(child.gameObject.activeInHierarchy).AppendLine();
|
||||
}
|
||||
}
|
||||
string file = Path.Combine(Bootstrap.Folder ?? ".", "fsmdump.txt");
|
||||
File.WriteAllText(file, sb.ToString());
|
||||
return count + " installed part(s) written to " + file;
|
||||
}
|
||||
|
||||
static void Dump(StringBuilder sb, PlayMakerFSM fsm, string path)
|
||||
{
|
||||
sb.Append("==== ").Append(path).Append(" | ").Append(fsm.FsmName).Append(" | active ").Append(fsm.gameObject.activeInHierarchy)
|
||||
|
||||
Reference in New Issue
Block a user