BattletechModders / ModTek

Mod system for HBS's PC game BattleTech.
GNU Lesser General Public License v2.1
121 stars 34 forks source link

Linux support #77

Closed mclang closed 6 years ago

mclang commented 6 years ago

I'd like to use some Quality of Life mods like Firing Line Improvements.

I skimmed through some MacOS issues, but does anybody know how to make mods work with Battletech Linux Beta?

EDIT - Found This: https://github.com/Mpstark/BattleTechModLoader/issues/9#issuecomment-392360999

It seems to work, at least with Solus and Linux Beta 1.2.1, meaning the game version in lower left corner is followed with /W MODTEK, but I haven't yet tried any mods.

mclang commented 6 years ago

Okay, had time to try some mods.

Something is wrong:

BTModLoader -- 10/6/2018 9:49:02 PM
9:49:02 PM - ModTek.dll: Found and called entry point "Void Init()" in type "ModTek.ModTek"
9:49:02 PM - ModTek.dll: While loading a dll, an exception occured:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Language'.
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetPseudoCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoMethod.GetCustomAttributes (System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at Harmony.PatchTools+<>c__2`1[Harmony.HarmonyPrepare].<GetPatchMethod>b__2_0 (System.Reflection.MethodInfo m) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.First[MethodInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.FirstOrDefault[MethodInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0 
  at Harmony.PatchTools.GetPatchMethod[HarmonyPrepare] (System.Type patchType, System.String name, System.Type[] parameters) [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor.RunMethod[HarmonyPrepare,Boolean] (Boolean defaultIfNotExisting, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor.PrepareType () [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor..ctor (Harmony.HarmonyInstance instance, System.Type type, Harmony.HarmonyMethod attributes) [0x00000] in <filename unknown>:0 
  at Harmony.HarmonyInstance.<PatchAll>b__7_0 (System.Type type) [0x00000] in <filename unknown>:0 
  at Harmony.CollectionExtensions.Do[Type] (IEnumerable`1 sequence, System.Action`1 action) [0x00000] in <filename unknown>:0 
  at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0 
  at ModTek.ModTek.Init () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at BattleTechModLoader.BTModLoader.LoadDLL (System.String path, System.String methodName, System.String typeName, System.Object[] prms, BindingFlags bFlags) [0x00000] in <filename unknown>:0 

Took 0.2222463 seconds to load mods

Could the reason be that I'm using Linux beta?

Is there anything I should try, except windows that is?

mclang commented 6 years ago

Okay, had time to try some mods.

Something is wrong:

BTModLoader -- 10/6/2018 9:49:02 PM
9:49:02 PM - ModTek.dll: Found and called entry point "Void Init()" in type "ModTek.ModTek"
9:49:02 PM - ModTek.dll: While loading a dll, an exception occured:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Language'.
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetPseudoCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoMethod.GetCustomAttributes (System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at Harmony.PatchTools+<>c__2`1[Harmony.HarmonyPrepare].<GetPatchMethod>b__2_0 (System.Reflection.MethodInfo m) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.First[MethodInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.FirstOrDefault[MethodInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0 
  at Harmony.PatchTools.GetPatchMethod[HarmonyPrepare] (System.Type patchType, System.String name, System.Type[] parameters) [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor.RunMethod[HarmonyPrepare,Boolean] (Boolean defaultIfNotExisting, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor.PrepareType () [0x00000] in <filename unknown>:0 
  at Harmony.PatchProcessor..ctor (Harmony.HarmonyInstance instance, System.Type type, Harmony.HarmonyMethod attributes) [0x00000] in <filename unknown>:0 
  at Harmony.HarmonyInstance.<PatchAll>b__7_0 (System.Type type) [0x00000] in <filename unknown>:0 
  at Harmony.CollectionExtensions.Do[Type] (IEnumerable`1 sequence, System.Action`1 action) [0x00000] in <filename unknown>:0 
  at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0 
  at ModTek.ModTek.Init () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at BattleTechModLoader.BTModLoader.LoadDLL (System.String path, System.String methodName, System.String typeName, System.Object[] prms, BindingFlags bFlags) [0x00000] in <filename unknown>:0 

Took 0.2222463 seconds to load mods

Could the reason be that I'm using Linux beta?

Is there anything I should try, except windows that is?

mclang commented 6 years ago

Moved using more recent version of BTML and ModTek: https://github.com/janxious/BattleTechModLoader https://github.com/janxious/ModTek