HatterTeam-ScopePartitioningLibrary icon

ScopePartitioningLibrary

A library for mod developers: splits R.E.P.O.'s player lookups into scopes (enemies, hazards, truck, UI...) so mods can add proxy players that only some of the game sees. Changes nothing on its own.

CHANGELOG

Changelog

1.0.0

  • First release (in development). Scans the game's player lookups at startup, puts each in a scope (Enemies, Hazards, Valuables, NPCs, Items, LevelFlow, CameraAndUI, VoiceAndEyes, Network, Mods, or None), and patches them so a scope can see proxy players; with no proxies every lookup gets the game's own list. Startup report, config overrides, public API (PlayerScope, ScopedPlayers, ScopeReport, PlayerLookup).
  • Proxy players (ProxyPlayer, ProxySettings, ProxyDamage): hollow players visible only in chosen scopes, standing on a mod's object; hits and heals arrive as events on the host; optional physics body used as the tumble body; CreateNetworked builds them on every game (late joiners included); safe removal (dead first, destroyed after a delay); network calls on proxies dropped; [Debug] TestProxyKey test proxy.
  • Proxies can be seen and hit: their hit colliders (ProxySettings.HitColliders, default: the body's) count as a player's body for enemy sight, enemy attacks and SemiFunc's sight checks; SemiFunc.PlayerEyesOverride is skipped on proxies (it froze the Animal); the test key turns the item you look at into a proxy body.
  • Proxies are added to every enemy's per-player tables (Enemy.PlayerAdded, as for a joining player), so enemy sight no longer stops for good after seeing one; EnemyOnScreen (needs a real camera) left out of the Enemies scope; the log says when an enemy first sees a proxy.
  • Proxies without a body get a switched-off stand-in body, so grabbing enemies (Hidden, Oogly, Gambler/Spinny...) no longer throw errors on them.
  • Test capsule moved to the Player layer (enemy wall checks treat Default as a wall); docs say to keep proxy hit colliders off Default.
  • Proxies carry a player trigger (like a player's PlayerTrigger), so enemies whose attack starts from a trigger (the Head's bite, the Snatcher's tongue) can attack them.
  • The eye point game code reads is always the proxy's own (a mod's VisionPoint is copied into it), so it never dangles when the mod's object is destroyed (it broke an enemy's player-distance check); the log says when a proxy is first recognised through its colliders and how long it lived.
  • A proxy body's root object (where its rigidbody is) counts as part of the proxy: Unity reports a ray hit on an item's collider as a hit on the item's rigidbody object, so enemy sight never recognised proxy bodies; test proxy probe (Probe: log lines) shows what each nearby enemy's sight ray hits.
  • Quieter log for release: the full lookup table is off by default ([Report] LogFullReport), routine proxy lines only with [Debug] VerboseLog.
  • Added LLM_GUIDE.md: the API in one file for AI coding assistants.