fly <hull> 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 <noreply@anthropic.com>
This commit is contained in:
Nibu 2026-11-06 00:15:56 +00:00
commit 2b0fb3c22d
2 changed files with 19 additions and 6 deletions

View file

@ -590,12 +590,24 @@ public class ActionGameManager : MonoBehaviour
} }
var generator = new LoadoutGenerator(ref ItemManager.Random, ItemManager, CurrentGalaxy, Zone.GalaxyZone, null, 2); 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)); 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}\""); // An unoffered hull is drawn by nobody; it reaches a ship only through a Loadout (ruling off-market-is-general).
return; var failures = new List<string>();
var loadout = ItemManager.ItemData.GetAll<Loadout>().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.IsPlayerShip = true;
ship.Direction = _currentEntity.Direction; ship.Direction = _currentEntity.Direction;
ship.Position.xz = _currentEntity.Position.xz + _currentEntity.Direction.Rotate(ItemRotation.Clockwise) * 30; ship.Position.xz = _currentEntity.Position.xz + _currentEntity.Direction.Rotate(ItemRotation.Clockwise) * 30;

View file

@ -245,8 +245,9 @@ catalog. Continue refuses a run naming a design the catalog no longer holds
price and `ship-authoring product <ship.cc> <maker> --name <name> price and `ship-authoring product <ship.cc> <maker> --name <name>
[--description <text>]` writes the package's product by that maker [--description <text>]` writes the package's product by that maker
(`--remove` deletes it). A package with a product needs a price above 0, (`--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 because generation skips price 0; a package with none stays valid but no
console-only. Compose follows. maker offers it, so generation never draws it. Console `fly <hull>` reaches such a hull only
through a catalog Loadout of it. Compose follows.
3. A command-line validator rejects malformed cells, overlapping or dangling 3. A command-line validator rejects malformed cells, overlapping or dangling
hardpoints, missing model nodes, and unresolved asset references with hardpoints, missing model nodes, and unresolved asset references with
precise errors. It changes no live catalog or scene on failure. The precise errors. It changes no live catalog or scene on failure. The