Cosmoteer: 星舰设计师

Cosmoteer: 星舰设计师

评价数不足
Yet Another Mod Loader
   
奖励
收藏
已收藏
取消收藏
标签: Mods
文件大小
发表于
更新日期
2.389 MB
9 月 30 日 上午 7:23
10 月 4 日 上午 8:39
2 项改动说明 ( 查看 )

订阅以下载
Yet Another Mod Loader

描述
Yet Another Mod Loader
This is a mod loader for C# mods. It requires additional installation, doesn't do anything on its own. If installed correctly, you'll see 'with YAML' in the version string in the lower left corner of the title screen.

Installation

This mod requires additional installation steps!

You need to go to the mod folder, which is located in the steam folder
Steam\steamapps\workshop\content\799600\3577650065
You can switch to it directrly or from a Cosmoteer folder (right click -> Browse Local Files) by going two folders up, and then into the workshop folder. You can then copy the files manually, or launch an installer script.

On Windows

Launch installer.bat or copy files ModLoader.dll and winmm.dll into the Cosmoteer Bin folder.

On Linux/steamdeck

Launch installer.sh (usually you can right click -> Launch as executable), or copy the files Modloader.dll and unmanaged.dll into the Cosmoteer Bin folder, rename the Cosmoteer.dll in the Cosmoteer Bin folder to Cosmoteer_o.dll, and then copy Cosmoteer.dll from mod folder into the Cosmoteer Bin folder.

This installation method also works on windows, and can be used there. The two methods are functionally identical. The downside of the second method is that it replaces the game file, which steam will restore every time the game updates, or the game files are validated. The installation procedure needs to be repeated. The first method uses dll-hijacking, so if you are uncomfortable with that, you can use the second method.

Troubleshooting

Make sure that all the required mod files are in the Bin folder. Then, look in the log files, located in the user folder
C:\users\<user name>\Saved Games\Cosmoteer\<your steam id>\Logs
on linux this folder can be found in
~/.local/share/Steam/steamapps/compatdata/799600/pfx/drive_c/users/steamuser/Saved Games/Cosmoteer/<your steam id>/Logs
If the mod has loaded correctly, an additional log file should be created with the name ending with "_modloader".

If the file was not created, that means the mod was not loaded, earlier logs are required. On windows, copy the winmm.dll from the mod folder from subfolder debug. It will create a log file in the Cosmoteer Bin folder. On linux change the launch options of the cosmoteer by setting it to
PROTON_LOG=1 %command%
this will create a file called steam-799600.log in the home folder ~/. Look for the line "unhandled exception" there.

Mod Development
Look at the readme at github[github.com]. Open issue in case of questions.

Why should I choose this over EML?
As a user, you probably don't care. This mod has better logging, so you have better chances to find the problem if the mod doesn't work. If you use linux, you don't have much choice, as EML doesn't support linux.

As a mod developer, you might want this mod instead of EML because it allows for earlier assembly loads. If you want to reference your types in the .rules files, or patch the startup code, EML won't help you with that. With this mod you could even patch the GameApp constructor, as the libs are loaded before the game even starts. This mod doesn't require you to ship runtimeconfig json, which makes things easier. Also, it supports linux, so it's more universal.

What is inside the dlls?
  • ModLoader.dll is the main file. It looks into the mod folders looking for dlls and loads them into the game context. It also looks for harmony lib, which is a library used by modders to modify the code in runtime. If harmony cannot be found the mods will not be loaded. In the end the library passes the control to Cosmoteer.dll
  • 0Harmony.dll is the harmony lib. It is required for most of the mods to function. Games with official mod support usually ship it themselves.
  • Cosmoteer.dll poses as a game's Cosmoteer.dll. Intercepts the game loading and passes control to ModLoader.dll. Manually loads Cosmoteer_o.dll into the game context.
  • winmm.dll system library used for dll-hijacking. Intercepts the game loading and substitues ModLoader.dll instead of Cosmoteer.dll
  • unmanaged.dll simple lib that only has one dummy method. Needed for EML compatibility. The same method is implemented in winmm.dll, so on windows it is not needed.

But still, how do I know it's not a virus?
Well, you don't. But you are welcome to compile the libs yourself, if you want.

Code available on github[github.com], under LGPL-2.1 license. Based on Unity doorstop[github.com] and EML mod[github.com].
6 条留言
Morse  [作者] 10 月 25 日 上午 5:05 
@YellowKnight let's hope it'll be the only YAML cosmoteer ever gets. https://noyaml.com/
YellowKnight 10 月 25 日 上午 1:10 
Ain't no way we got YAML Ain't Markup Language in Cosmoteer before crew boarding
Alice (She/Her) 10 月 18 日 下午 12:06 
Only thing I could think of when I saw this was Yet Another Mech Lab lol
Morse  [作者] 10 月 16 日 上午 10:22 
@scarlet flame. well, it doesn't contradict the phrase "it doesn't do anything on its own" :) but yes, it must be enabled in the mod menu in order to work. It won't locate the harmony lib otherwise, which is in the mod folder.
Scarlet flame 10 月 16 日 上午 8:49 
Your my saviour dude, it really does work, tho you may want to change the "it doesnt do anything on its own" cause you do have to have it active for it to work, aside of doing the dll installation stuff.
Scarlet flame 10 月 16 日 上午 8:28 
Holy peak