test(harness): the escort test walks its charge away from the keeper; rnt.escortprobe (stage 5)

Run alone on each rig, s5 is 52/52 on Oxide and on Carbon, and rnt.run all
was otherwise green on both (stages 2-4 unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-10-01 09:16:50 -05:00
parent 4ea50c4fd2
commit 900ac4e992

View File

@@ -422,6 +422,31 @@ namespace Oxide.Plugins
arg.ReplyWith("rnt: rocket probe started");
}
/// <summary>A probe: an escort follows a scientist 35 m, the scientist is killed, then 30 s of what the escort does.</summary>
[ConsoleCommand("rnt.escortprobe")]
private void CmdEscortProbe(ConsoleSystem.Arg arg)
{
if (arg.Connection != null && !arg.IsAdmin) return;
Vector3 f;
if (!FindField(300f, 2025, out f)) return;
BasePlayer keeper = StandIn(f + new Vector3(0, 0, 60), 50);
Vector3 c = OnMesh(f);
ScientistNPC charge = SpawnScientist(c + new Vector3(5, 0, 0));
BasePlayer escort = Spawn(c, "t_roam");
Api<string>("RunicNpc_Escort", Id(escort), charge);
int n = 0;
timer.Repeat(2f, 30, () =>
{
n++;
if (n == 3) Teleport(charge, c + new Vector3(0, 0, 35));
if (n == 12 && !Gone(charge)) charge.Kill();
Dictionary<string, object> d = Gone(escort) ? null : Describe(escort);
Puts($"[esc {n}] state={d?["state"]} rest={d?["rest"]} escort={d?["escort"] ?? "null"} target={TargetOf(d)} engaged={d?["engaged"]} home={(d == null ? -1f : Flat(escort.transform.position, V(d["home"]))):0.0} ended={_escortEnded.Count}");
if (n == 30) { Api<int>("RunicNpc_DespawnOwner", Owner); ClearWorld(); }
});
arg.ReplyWith("rnt: escort probe started");
}
[ConsoleCommand("rnt.clear")]
private void CmdClear(ConsoleSystem.Arg arg)
{
@@ -1582,7 +1607,9 @@ namespace Oxide.Plugins
Check("s5.escort.set", said == null, said ?? "escorting");
yield return new WaitForSeconds(2f);
Vector3 home = escort.transform.position;
Teleport(charge, c + new Vector3(0, 0, 35));
// East, not north: north brings the escort within sense range of the keeper stand-in, and Rust's
// design then fights it instead of walking home.
Teleport(charge, c + new Vector3(35, 0, 0));
float closest = float.MaxValue;
for (int t = 0; t < 20; t++)
{