R.E.P.O.
Install

Details

Last Updated
First Uploaded
Downloads
250
Likes
0
Size
16KB
Dependency string
TheMorningStar-GameAPI_Compat_Shim-1.1.0
Dependants

GameAPI Compat Shim

Restores game methods a R.E.P.O. update removed, so mods built against the old signatures work again.

What it does

A R.E.P.O. update added a trailing parameter to several game methods. Mods compiled against the old signatures now throw MissingMethodException on every call. That can leave a modded enemy dealing no damage, and it fills the log with errors. This is a BepInEx preloader patch. It edits the game assembly in memory at load and re-adds the removed overloads as thin forwarders that call the current versions with the new parameter's default.

Restored overloads:

Method Forwards with
PlayerHealth.HurtOther, 4-arg hurtByHeal = false
EnemyNavMeshAgent.Warp, 1-arg force = false
Sound.PlayLoop, 4-arg volumeMultiplier = 1.0
PhysGrabber.OverrideGrabRelease, 0-arg viewID = -1, releaseTime = 0.5

Installation

  1. Install BepInEx.
  2. Put GameApiCompatShim.dll in BepInEx/patchers/, not plugins/. In the wrong folder it does nothing. A mod manager puts it in the right place.

Confirmed working with

  • OrtonLongGaming-FreddyEnemy: Freddy's attacks deal damage again and the error storm stops
  • Rosayy-Echohold: the plasma gun stops throwing OverrideGrabRelease errors every frame
For developers - detailed breakdown

No plugin GUID, this is a preloader patcher. Log source GameApiCompatShim, TargetDLLs = { "Assembly-CSharp.dll" }.

It has to be a preloader because the target is the game assembly, which loads from the Managed folder during preload. Plugin time is too late to add methods, and Harmony cannot patch a method into existence.

For each row in the table, Patch(AssemblyDefinition) uses Mono.Cecil to:

  1. Find the current overload: same name, non-static, with more parameters than the old count. The shortest such overload wins.
  2. Stop if the type is missing, the longer overload is gone, or an overload with the old argument count already exists. Each case is logged. A future game update that reverts the signature makes this a no-op.
  3. Emit a new public instance method with the old parameter list whose body is ldarg.0, load each parameter, push the default constant for the added trailing parameter, call the current overload, pop any non-void return, ret.

The edit happens on the in-memory AssemblyDefinition during BepInEx's preload chain. Nothing on disk changes.

It restores exactly the overloads listed in the table above. A mod that throws MissingMethodException on some other signature is not covered, and the exception text names the method a future version would need. Old callers get the new parameter's default, which is all they could ever have used, since the parameter did not exist when they were compiled.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.