7 Commits
edge ... v1.0.2

Author SHA1 Message Date
9895187815 Merge pull request 'fix(swap): give our NPC the prefab's id again (Rust 11/25)' (#34) from fix/swap-prefab-id into main
All checks were successful
Release plugin / release (push) Successful in 28s
Reviewed-on: #34
2026-11-30 23:16:52 -06:00
f21a468863 fix(swap): give our NPC the prefab's id again (Rust 11/25)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s
Rust's 11/25 public patch made BaseNetworkable.prefabID a property over an
encrypted value that only Unity's deserialisation fills (from
serializedPrefabID). The swap's AddComponent never deserialises, so every
RunicNPC NPC on public Rust has had prefab id 0 (ShortPrefabName empty) on
Oxide and Carbon. The swap now sets npc.prefabID = stock.prefabID after the
field copy (D398). The same lines are on edge, so the wipe-day cutover merges
cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t
2026-11-30 23:09:44 -06:00
53e32a0ba4 Merge pull request 'chore(release): RunicNPC cutover for the 2026-11-05 wipe, Rust 547616323393184824' (#29) from edge into main
All checks were successful
Release plugin / release (push) Successful in 28s
Wipe-day cutover / cutover (push) Successful in 21s
Staging drill / drill (push) Successful in 36m29s
2026-11-06 14:13:36 +00:00
27ff34e689 Merge pull request 'ci(cutover): main's cutover.yml is edge's again, so the cutover PR merges (D397)' (#30) from ci/cutover-yml-match-edge into main
All checks were successful
Release plugin / release (push) Successful in 8s
Wipe-day cutover / cutover (push) Successful in 32m49s
Reviewed-on: #30
2026-11-06 13:26:05 +00:00
8a9e8fa4b1 ci(cutover): main's cutover.yml is edge's again, so the cutover PR merges (D397)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 21s
runicnpc-rust#28 changed edge's copy of cutover.yml (gate 1 reads Steam; the
staging static half is gone). main's copy was added by its own commit (#26), so
the two now conflict (add/add) and the cutover PR #29 cannot merge, though all
its gates passed. This makes main's copy byte-for-byte edge's. It changes no
commit on edge, so the gates kept for edge 761a9b67 stand and the next hourly
run only re-checks the PR and merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HJEmgsXtLR5kLfh7f9y8P
2026-11-06 06:59:53 -06:00
c57456264d Merge pull request 'ci(cutover): the wipe-day cutover's trigger on main (D332)' (#26) from ci/cutover-trigger into main
Some checks failed
Release plugin / release (push) Successful in 10s
Staging drill / drill (push) Successful in 9s
Wipe-day cutover / cutover (push) Failing after 2m46s
Reviewed-on: #26
2026-11-02 15:39:01 +00:00
567b7671ad ci(cutover): the wipe-day cutover's trigger on main (D332)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 11s
Gitea fires a schedule only from the default branch, so the cutover's
workflow file reaches main once, alone. It is the same file as on edge
(the trigger and the step wiring); every step checks out edge and runs
edge's scripts, so nothing else of edge comes with it: the field list stays
on edge until the cutover merges it. A ci: commit cuts no release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-11-02 07:09:11 -06:00
2 changed files with 15 additions and 10 deletions

View File

@@ -98,7 +98,7 @@ The API version moves when a call or a raised hook changes shape, not on every r
## After a Rust update: the swap's field list
Our NPC is Rust's scientist with two components swapped, and the swap copies a fixed list of fields (D232),
generated from Rust's unmodified assembly. `rnpc.status` reports it as `swap fields: npc=51/51 brain=31/31
generated from Rust's unmodified assembly. `rnpc.status` reports it as `swap fields: npc=58/58 brain=32/32
missing=- added=-`. On Carbon, where the assembly is unmodified, `added` names any field Rust has added since
the list was made. To regenerate it:
@@ -121,14 +121,13 @@ shows it, so the drill's live half and `rnpc.status` are what catch it.
| Rust type | What RunicNPC depends on | Where (`plugin/RunicNPC.cs`) | Caught by |
|---|---|---|---|
| `ScientistNPC` (prefabs `scientistnpc_*`) | Subclassed by `RunicNpcPlayer`; the swap replaces the prefab's component before spawn and copies `SwapNpcFields` (51 fields up its chain to `BaseNetworkable`) | `#region The swap`, `CreateNpc` | compile; field list |
| `ScientistBrain` | Subclassed by `RunicNpcBrain`; the swap copies `SwapBrainFields` (31 fields of `BaseAIBrain`) | `#region The swap` | compile; field list |
| `ScientistNPC` (prefabs `scientistnpc_*`) | Subclassed by `RunicNpcPlayer`; the swap replaces the prefab's component before spawn and copies `SwapNpcFields` (58 fields up its chain to `BaseNetworkable`) | `#region The swap`, `CreateNpc` | compile; field list |
| `ScientistBrain` | Subclassed by `RunicNpcBrain`; the swap copies `SwapBrainFields` (32 fields of `BaseAIBrain`) | `#region The swap` | compile; field list |
| `ScientistNPC` / `HumanNPC` virtuals | `displayName`, `AttackerInfo(PlayerLifeStory.DeathInfo)`, `ShotTest(float)`, `TriggerDown()`, `Hurt(HitInfo)`, `OnDied(HitInfo)` overridden | `RunicNpcPlayer` | compile |
| `IAIAttack`, `IAISenses` | Re-implemented on `RunicNpcPlayer`: `IsTargetInRange`, `EngagementRange`, `GetBestTarget`, `AttackTick`, `IsTarget`, `IsThreat`, `IsFriendly`. Rust's `HumanNPC.IsTarget` is not virtual, which is why | `RunicNpcPlayer` | compile; a changed meaning only at run time |
| `BaseAIBrain` | `AddStates()` and `Think(float)` overridden; `states`, `CurrentState`, `Navigator`, `Senses`, `Events` used; `AIState` values `Roam`, `Chase`, `Combat`, `TakeCover`, `Cover`, `MoveTowards`, `MoveToVector3`, `FollowPath`, `NavigateHome`, `Flee`, `Blinded` replaced or held | `RunicNpcBrain` | compile; a state Rust stops adding only at run time |
| `BaseAIBrain.BasicAIState` | Subclassed six times (`WanderState`, `RnRoamState`, `RnGuardState`, `RouteState`, `PursueState`, `HoldState`): `StateEnter`, `StateThink`, `StateLeave` | `#region The NPC` | compile |
| `BaseNetworkable.prefabID` | A property backed by an encrypted value that only Unity's deserialisation fills, so the swap sets it on our component by hand after the copy (#32) | `CreateNpc` | run time (a wrong id: our NPC's `ShortPrefabName` is empty) |
| `BaseNavigator` | `SetDestination`, `Stop`, `Moving`, `Agent`, `NavigationSpeed` | the states | compile |
| `BaseNavigator` | `SetDestination`, `Stop`, `Moving`, `Agent`, `IsOnNavMeshLink`, `NavigationSpeed` | the states | compile |
| `AIMemory` / `AIBrainSenses` | `Memory.Targets`, `SetKnown`, `IsLOS`, `Entity`; `DelaySenseUpdate` | the states, the fight | compile |
| `BaseCombatEntity.faction` | Our NPC's target is set to `Faction.Horror` for the length of our own shot, because `BaseProjectile.ServerUse` drops NPC-on-NPC hits otherwise (stage 5) | `RunicNpcPlayer.Mark` | run time (the drill's fight checks) |
| `NPCAutoTurret` | Harmony prefixes on the private `Ignore(BasePlayer)` and `IsEntityHostile(BaseCombatEntity)`, found by reflection (D267) | `#region Factions`, `SentryPatch` | run time: `rnpc.status` says whether the patch applied |

View File

@@ -921,7 +921,7 @@ namespace Oxide.Plugins
#region The swap (D223, D232)
// <fieldlist>
// Generated by tools/fieldlist from Rust's Assembly-CSharp.dll, module b2ee98e0-1091-4c90-b0c6-c52f7a4aac74.
// Generated by tools/fieldlist from Rust's Assembly-CSharp.dll, module 5c6eb1c7-ffa2-4b1e-a218-0a66bcc56f9e.
// Do not edit by hand: regenerate after a Rust update (D232).
private static readonly string[] SwapNpcFields =
{
@@ -944,9 +944,15 @@ namespace Oxide.Plugins
"NPCPlayer.damageScale",
"NPCPlayer.shortRange",
"NPCPlayer.attackLengthMaxShortRangeScale",
"BasePlayer.debugCommandedNpcs",
"BasePlayer.GestureViewModel",
"BasePlayer.lastPlayerVisibility",
"BasePlayer.timeSinceAiming",
"BasePlayer.eyeHistory",
"BasePlayer.tickHistory",
"BasePlayer.fallDamageEffect",
"BasePlayer.drownEffect",
"BasePlayer.Belt",
"BaseCombatEntity.spawnDeployableCorpseOnDeath",
"BaseCombatEntity.deployableCorpsePrefab",
"BaseCombatEntity.skeletonProperties",
@@ -961,6 +967,7 @@ namespace Oxide.Plugins
"BaseCombatEntity.sendsMeleeHitNotification",
"BaseCombatEntity.markAttackerHostile",
"BaseCombatEntity.faction",
"BaseEntity.faces",
"BaseEntity.bounds",
"BaseEntity.impactEffect",
"BaseEntity.enableSaving",
@@ -970,7 +977,7 @@ namespace Oxide.Plugins
"BaseEntity.HasBrain",
"BaseEntity.ServerPreProcessed",
"BaseNetworkable.postNetworkUpdateComponents",
"BaseNetworkable.serializedPrefabID",
"BaseNetworkable.prefabID",
"BaseNetworkable.globalBroadcast",
"BaseNetworkable.globalNetworkBehavior",
"BaseNetworkable.globalBuildingBlock",
@@ -984,6 +991,7 @@ namespace Oxide.Plugins
"BaseAIBrain.AllowedToSleep",
"BaseAIBrain.DefaultDesignSO",
"BaseAIBrain.Designs",
"BaseAIBrain.InstanceSpecificDesign",
"BaseAIBrain.SenseRange",
"BaseAIBrain.AttackRangeMultiplier",
"BaseAIBrain.TargetLostRange",
@@ -1560,9 +1568,7 @@ namespace Oxide.Plugins
{
_nextCheck = now + 2f;
_playerNear = npc.Profile.SleepDistance <= 0f || PlayerWithin(npc.transform.position, npc.Profile.SleepDistance);
// Rust's AI has no off-mesh links any more (staging 27024215, #32): nothing is ever
// mid-link, so there is no traversal left to wait out.
if (!Sentry)
if (!Sentry && !Navigator.IsOnNavMeshLink)
Reground(npc);
_self?.CheckEscort(npc);