From 2b0fb3c22ded74ab25513c122d74014aadffa086 Mon Sep 17 00:00:00 2001 From: Nibu Date: Fri, 6 Nov 2026 00:15:56 +0000 Subject: [PATCH] fly reaches unoffered hulls through their Loadout; authoring doc no longer says console-only A hull no maker offers is drawn by no generator, so fly now falls back to a catalog Loadout of the named ship hull (Loadouts.Materialize with the game's chooser). The authoring doc claimed a product-less package is console-only; it is unreachable unless a Loadout fits it. Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/Gameplay/ActionGameManager.cs | 20 ++++++++++++++++---- docs/moddable-ship-authoring.md | 5 +++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 62105a711..a0cf3a4c1 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -590,12 +590,24 @@ public class ActionGameManager : MonoBehaviour } var generator = new LoadoutGenerator(ref ItemManager.Random, ItemManager, CurrentGalaxy, Zone.GalaxyZone, null, 2); var pack = generator.GenerateShipLoadout(data => string.Equals(data.Name, hullName, StringComparison.InvariantCultureIgnoreCase)); - if (pack == null) + Ship ship; + if (pack != null) ship = (Ship) EntitySerializer.Unpack(ItemManager, Zone, pack); + else { - ConsoleController.Instance.AppendLogLine($"No ship hull named \"{hullName}\""); - return; + // An unoffered hull is drawn by nobody; it reaches a ship only through a Loadout (ruling off-market-is-general). + var failures = new List(); + var loadout = ItemManager.ItemData.GetAll().FirstOrDefault(l => + ItemManager.ItemData.Get(l.Hull) is { HullType: HullType.Ship } hull && + string.Equals(hull.Name, hullName, StringComparison.InvariantCultureIgnoreCase)); + ship = loadout == null ? null : Loadouts.Materialize(ItemManager, Zone, loadout, generator.ChooseProduct, failures) as Ship; + if (ship == null) + { + ConsoleController.Instance.AppendLogLine(failures.Count > 0 + ? $"Cannot build \"{hullName}\": {string.Join("; ", failures)}" + : $"No ship hull named \"{hullName}\" that a maker offers or a Loadout fits"); + return; + } } - var ship = (Ship) EntitySerializer.Unpack(ItemManager, Zone, pack); ship.IsPlayerShip = true; ship.Direction = _currentEntity.Direction; ship.Position.xz = _currentEntity.Position.xz + _currentEntity.Direction.Rotate(ItemRotation.Clockwise) * 30; diff --git a/docs/moddable-ship-authoring.md b/docs/moddable-ship-authoring.md index 6a9e5c5c0..81871b2dc 100644 --- a/docs/moddable-ship-authoring.md +++ b/docs/moddable-ship-authoring.md @@ -245,8 +245,9 @@ catalog. Continue refuses a run naming a design the catalog no longer holds price and `ship-authoring product --name [--description ]` writes the package's product by that maker (`--remove` deletes it). A package with a product needs a price above 0, - because generation skips price 0; a package with none stays valid and is - console-only. Compose follows. + because generation skips price 0; a package with none stays valid but no + maker offers it, so generation never draws it. Console `fly ` reaches such a hull only + through a catalog Loadout of it. Compose follows. 3. A command-line validator rejects malformed cells, overlapping or dangling hardpoints, missing model nodes, and unresolved asset references with precise errors. It changes no live catalog or scene on failure. The