Open MarshMello0 opened 6 days ago
This was my simple test which I used to confirm that they where not working in my Mod Loader. But working on the BepIn 6.0.0-pre1 which uses HarmonyX 2.10.1 instead of 2.13.0 The game its for is VTOL VR
[HarmonyPatch(typeof(AirportManager), nameof(AirportManager.RequestLanding2))]
public static class TranspilerTest
{
[HarmonyTranspiler]
static IEnumerable<CodeInstruction> StringReplacer(IEnumerable<CodeInstruction> instructions)
{
Debug.Log("Start of Harmony Transpiler");
var codes = new List<CodeInstruction>(instructions);
foreach (var codeInstruction in codes)
{
if (codeInstruction.opcode != OpCodes.Ldstr)
continue;
var oldText = codeInstruction.operand as string;
Debug.Log($"Replacing '{oldText}'");
codeInstruction.operand = "haha I've changed the text on this string";
}
Debug.Log("end of Harmony Transpiler");
return codes.AsEnumerable();
}
}
What unity version does the game use? Did you hit this issue in any other games (ideally not VR only)?
VTOL VR is using Unity 2020.3.48f1
Did you hit this issue in any other games (ideally not VR only)?
I've just managed to reproduce it with Muck, it is using Unity 2019.4.19f1 and I see a netstandard.dll
in its managed folder
I downloaded the latest release of doorstop and created a simple DLL which tries the similar patch.
Here is a zip of my test that also threw a System.Reflection.Emit.ILGeneration is not supported on this platform.
but instead in the doorstop log (this is using the verbose one)
MuckTranspilers.zip
Using the latest release of HarmonyX, it keeps throwing not supported on this platform when using Transpilers. They work fine in BepInEx 6.0.0-pre.1. but the version of Harmony BepInEx uses is 2.10.1. I wanted to try also use this same version but its missing
HarmonyPatchCategory
so I couldn't compile my mod loader.I remember in the past for .NET Standard (Unity) games we needed to add a version of
mscorlib.dll
that was not stripped down to remove runtime code generation. However I thought after Harmony started using MonoMod, this was no longer the case? Anyways putting that old patch in didn't solve the problem, so I assume this is something new.Looking at BepInEx's assemblies it loads there was some differences between mine.
I need to add
To load HarmonyX, otherwise I get this error message from Doorstop
Has anyone used the version 2.13.0 and got Transpilers to work?