sheep-y / modnix Goto Github PK
View Code? Open in Web Editor NEWMod loader and manager for Phoenix Point (Game).
Home Page: https://www.nexusmods.com/phoenixpoint/mods/43
License: MIT License
Mod loader and manager for Phoenix Point (Game).
Home Page: https://www.nexusmods.com/phoenixpoint/mods/43
License: MIT License
Reported by Sangvis Ferri on Discord.
System.TypeLoadException: Could not resolve the signature of a virtual method
at (wrapper managed-to-native) System.RuntimeType.GetMethodsByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,bool)
at System.RuntimeType.GetMethodsByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean ignoreCase, System.RuntimeType reflectedType) [0x0001b] in :0
at System.RuntimeType.GetMethodCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in :0
at System.RuntimeType.GetMethods (System.Reflection.BindingFlags bindingAttr) [0x00000] in :0
at Sheepy.Modnix.ModLoader.CallInit (Sheepy.Modnix.ModEntry mod, System.Reflection.Assembly dll, System.String typeName, System.String methodName) [0x00053] in <42da46d68492440ca687016167ebcc10>:0
GUI
Common
JetBrains.Annotations.dll
if exists.Loader
Api
Example:
api( "data sheepy.config" ); // Get a shared data
api( "data sheepy.config", ModConfig ); // Set a shared data
api( "data lock", "harmony" ); // Get "harmony" lock
api( "data rlock", "harmony" ); // Get "harmony" read lock, disposable style
api( "data wlock", "harmony" ); // Get "harmony" write lock, disposable style
// api( "data def PhoenixFacilityDef", "08a852ce-a6b6-3d84-cae6-302032199fca" ); // Access Lift Facility
Adding Retrievable Items mod does not add it to the mod list.
File exists. Modnix fails to detect it.
Mod injector can test only known classes to speed up injection discovery. The chance of PPML being updated to mod another class is low.
Also test multi-thread cecil scanning. If success, speed can be gained without losing forward compatibility.
A quick update to solve some pressing needs before the code is changed beyond recognition.
Well, there are more "pressing needs" than expected. More efficient to finish them and test.
Some more issues during testing:
Planned for Modnix 3 (#23).
RunAction
).Expected: mod should show up on step 3.
Hi,
So to install mods on Phoenix Point: Year One Edition on Linux using Steam, I worked out some instructions:
(Obviously make sure you run the game once before doing this. Also, use proton 5.21-GE-1 or proton 6.0-GE-1 to run it. Later versions might work as well.)
Managed
folder in the 7z file (3 DLLs + 1 EXE) to steamapps/common/Phoenix Point/PhoenixPointWin64_Data/Managed
(no files are replaced)Modnix.exe
to steamapps/compatdata/839770/pfx/drive_c/users/steamuser/My Documents/My Games/Phoenix Point/Mods
(you need to create some of those folders)mono
and basic assemblies, version does not mattersteamapps/common/Phoenix Point/PhoenixPointWin64_Data/Managed
mv System.dll System.bak
mono ModnixInjector.exe
mv System.bak System.dll
steamapps/compatdata/839770/pfx/drive_c/users/steamuser/My Documents/My Games/Phoenix Point/Mods
This works for me. I'm posting these same instructions to protondb.com now, and linking to this ticket. People will probably come here for help.
Also need to check refresh mod.
I'm using assorted adjustments and some things appear to be broken. Base building and aircrafts now have 'NEED TEXT' popups on them.
Modnix Log 2021-02-03 07-16-10Z.txt
I'm trying with Modnix v3b2, both the installer and manual setup produce the issue. The log is from the manual one. This is a fresh install, no mods installed/loaded.
Game version is Orryx 1.10 EGS. I have tried the troubleshooting guide (restart, verify/reinstall the game, disable antivirus, run everything as admin).
OS is Windows 10 Version 20H2 (OS Build 19042.746), with the latest stable channel updates.
After launching as Administrator, the Status is stuck at busy, and I get this exception (full log attached):
07:16:06.9035 Thread4┊Loader┊GameVer1: opcode 2 <> 8
07:16:06.9045 Thread4┊System.ArgumentNullException: Value cannot be null.
Parameter name: input
at System.Version.Parse(String input)
at Sheepy.Modnix.MainGUI.AppControl.CheckGameVersion()
at Sheepy.Modnix.MainGUI.AppControl.CheckStatus()
07:16:07.1762 Thread4┊Creating sandbox
After this nothing happens, waited ~10 minutes.
System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.Substring(Int32 startIndex, Int32 length)
at Sheepy.Modnix.MainGUI.SevenZipArchiveReader.<>c.b__4_1(String e)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at Sheepy.Modnix.MainGUI.SevenZipArchiveReader.ListFiles()
Version 0.90, no game detected
Reported by Sangvis Ferri on Discord.
It seems that pp-raw-recruit is detected but its initialisation method is not being called.
If the mod class is static, it will not be scanned.
Whenever I try to launch the game through Modnix I get this error
System.ComponentModel.Win32Exception (0x80004005): The requested operation requires elevation
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Sheepy.Modnix.MainGUI.AppControl.LaunchGame(String type)
How do I fix this?
When ModnixInjector.exe is executed at the wrong folder, such as in unzipped manual setup package, it just flash quit without showing any error.
Must Dos
High Priority
Medium Priority
Low Priority
If a mod is placed in a subfolder, delete mod only deletes the dll or the mod_info.
In the later case, the dlls may still be detected and loaded in the info's place.
Modnix should detect this case and prompt for folder deletion or file deletion.
Reported by JulianSkies on NexusMods.
Logs:
ribi2TeM.txt
yDK9SMpK.txt
Translated:
Could not load file or assembly 'file: /// C: \ Users \ Oran First Ignition \ Documents \ My Games \ Phoenix Point \ Mods \ Modnix.exe' or one of its dependencies. Unsupported operation. (Exception from HRESULT: 0x80131515)
Filename: 'file: /// C: \ Users \ Oran First Ignition \ Documents \ My Games \ Phoenix Point \ Mods \ Modnix.exe' ---> System.NotSupportedException: Attempt to load an assembly from a location network that would make the assembly safe in previous versions of the .NET Framework. This version of the .NET Framework does not enable CAS policy by default, so loading it can be dangerous. If he does not intend to place the assembly in a restricted area, enable the loadFromRemoteSources option. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
em System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
em System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
em System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
em System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)
em System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
em System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
em System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
em System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
em Sheepy.Modnix.MainGUI.Sandbox.CreateSandbox()
Skip scanning abstract class for mod initialisers. Just in case.
Hi Sheep-y,
Nice to see you around PP too (know some stuff of you for HBS Battletech :-))
I believe Modnix is only meant to be used with Epic but as the Year One Edition for GOG just released, i had to try (PP really needs some UI-issues fixed..) However i get the following error when trying to patch:
05:43:22.2000 Thread6┊Running at E:\GOG Galaxy\Games\Phoenix Point Year One Edition\PhoenixPointWin64_Data\Managed : E:\GOG Galaxy\Games\Phoenix Point Year One Edition\PhoenixPointWin64_Data\Managed\ModnixInjector.exe /y
05:43:22.5204 Thread6┊Standard out: Modnix Injector 2.5.3.0
----------------------------
Cinemachine.dll backed up to Cinemachine.dll.orig
Injecting Cinemachine.dll with Sheepy.Modnix.ModLoader.Init at Cinemachine.CinemachineBrain.OnEnable
Found 36 IL instructions in OnEnable.
Injecting before last op IL_0086: ret
Writing back to Cinemachine.dll...
ERROR: An exception occured: System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
I'm not really understanding your injector code, so i thought maybe you're still active and can update for the GOG-version, too?
Thx a lot, best regards, Mad
For usablity it would be nice if existing Comments would be displayed in the Config-Tab too.
To help users understand settings or divide a big config into sections.
Best regards, Mad
When multiple mods of same id exists and all but one must be disabled, their LoadIndex would be compared first, instead of Version first.
When config save fails, such as blocked by an anti-virus, Modnix will crash exit.
Config is saved for many operations, so it should be fixed.
I use the excellent option to have a class in my Assembly that Modnix parses to provide the configuration view for editable settings.
I had many posts on nexus on how to configure "Assorted Adjustments", it seems that quite a lot of users need to "unblock" Modnix for the Config-Tab to be shown at all.
It's fixable on the users side following this guide: https://stackoverflow.com/questions/28339116/not-allowed-to-load-assembly-from-network-location
but if possible would be better to workaround/fix on programs side as fiddling with .NET settings isn't really reliable for the end-users.
I can't provide more details, unfortunately, as i never had the issue myself. I'll point people to this issue though, if you're fine with that?
Thx alot and best regards, Mad
Backport to 2.x:
Must Do, Beta 1:
Must Do, Beta 2:
Must Do, Gold:
May be:
Gave up, too many changes:
Tweaks:
Currently, api returns null on any and every error, making it impossible to tell what was wrong.
The api should gives mod a way to get the exception.
This will also allow the GUI to display config reading / writing errors.
Sometimes the sandbox throws error and cause the config to fail to show up.
I am guessing this is a sandbox lifecycle / gc issue.
03:51:39.1630 GUI┊Showing conf. Editing
03:51:39.1630 GUI┊Sandbox loading 1 dlls.
03:51:39.1832 GUI┊System.Runtime.Remoting.RemotingException: Object '/178f7676_0ee1_4998_9f58_e95738c68d81/qpgavjdyi8hj_emh0tfyutup_3.rem' has been disconnected or does not exist at the server.
at Sheepy.Modnix.MainGUI.Sandbox.LoadDlls(String[] paths)
at Sheepy.Modnix.MainGUI.GridModItem.GetConfigFromSandbox()
03:51:39.1832 GUI┊System.Runtime.Remoting.RemotingException: Object '/178f7676_0ee1_4998_9f58_e95738c68d81/qpgavjdyi8hj_emh0tfyutup_3.rem' has been disconnected or does not exist at the server.
at Sheepy.Modnix.MainGUI.Sandbox.get_Domain()
at Sheepy.Modnix.MainGUI.GridModItem.GetConfigFromSandbox()
at Sheepy.Modnix.MainGUI.GridModItem.BuildConfig(FlowDocument doc)
at Sheepy.Modnix.MainGUI.GridModItem.BuildDocument(ModDoc type, FlowDocument doc)
at Sheepy.Modnix.MainGUI.MainWindow.RefreshModInfo()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.