diff --git a/Assets/Scripts/ServerShared/ScenarioStage.cs b/Assets/Scripts/ServerShared/ScenarioStage.cs index afb8ccfda..2580c629b 100644 --- a/Assets/Scripts/ServerShared/ScenarioStage.cs +++ b/Assets/Scripts/ServerShared/ScenarioStage.cs @@ -136,6 +136,16 @@ public class ZoneStage return entity; } + // A piloted ship that carries a standing haul order (ruling demo-zenith-ore-depot): its task is derived from the order at + // admission (HaulRun.TaskOf), so the order must exist by then; ScenarioStage writes its orders before it admits. A fit that is not + // a ship is Place's failure. + public Ship Hauler(ScenarioFit fit, string orderId, float2 at) + { + var ship = Place(fit, at, piloted: true) as Ship; + if (ship != null) ship.Haul = new CultRecordRef(HaulOrderData.KeyOf(orderId)); + return ship; + } + // The task a piloted entity starts on: it closes on the target and holds there (the flight's follow task, standoff // nothing), in place of the patrol circuit the zone would draw for it. The pilot starts knowing it (RunStart seeds a sensor track). A check that rests on where a pilot goes states // it here, so the pilot's course is the scenario's and not a draw. An entity that is not placed and piloted, or a diff --git a/Assets/Scripts/ServerShared/Scenarios/DemoTerminus.cs b/Assets/Scripts/ServerShared/Scenarios/DemoTerminus.cs index 08c4f28b0..91a00019c 100644 --- a/Assets/Scripts/ServerShared/Scenarios/DemoTerminus.cs +++ b/Assets/Scripts/ServerShared/Scenarios/DemoTerminus.cs @@ -53,7 +53,7 @@ public sealed class DemoTerminus : Scenario stage.Player(stage.Generated("Longinus"), float2.zero); // Zenith's silo buys the ores the refinery's gear draws (ruling demo-zenith-ore-depot), by a standing order to the - // refinery; nothing hauls it yet (follow-up ore-haul-run). + // refinery, and a hauler of Zenith's faction carries it (ore-haul-run). var zenith = stage.Station("trade-hub"); var refinery = stage.Station("processing"); if (refinery == null) return; @@ -61,5 +61,6 @@ public sealed class DemoTerminus : Scenario var ores = StationWants.Of(refinery).Where(good => FieldKinds.IsOre(items.ItemData, items.ItemData.Get(new CultRecordRef(good)))) .OrderBy(good => good.Value, System.StringComparer.Ordinal).Select(good => new CultRecordRef(good)); stage.HaulOrder("demo-terminus-ore", zenith, refinery, ores, "scenario:demo-terminus"); + stage.Hauler(stage.Generated(null, zenith.Faction), "demo-terminus-ore", stage.Arena.GetOrbitPosition(zenith.OrbitData)); } }