SA2 Mod Loader SADX Mod Loader [hr] After seven days of work (mostly on the mods) the first version of SA2 Mod Loader is done. It's rather similar to SonicGMI/CPKREDIR, except while those are designed to replace data files, the SA2 Mod Loader is designed to inject custom C++ code into the game. It does this by replacing Data_DLL.dll with a custom DLL, requiring no modification to the sonic2app.exe file. In fact, it should work even with the original encrypted exe from Steam. Download SA2 Mod Loader. The archive should be extracted to your SA2 install folder. In the root folder you'll find SA2ModManager.exe (and some additional files for debugging and stuff). When you run it, it looks something like this: This allows you to enable and disable mods, change the order they're loaded in, install or uninstall the loader dll, and play the game. You can also enable a console window, which will print the build version and date, the list of mods loaded, any mods that failed to load, and anything a mod writes to stdout, for example with printf or cout. You may replace SA2's Launcher.exe with this if you have no need to configure SA2 (you should probably back it up though). The archive also contains a folder named "mods", which is where mods will go, each in their own folder with a "mod.ini" file and at least one DLL. It also contains SA2ModLoader.dll which is copied to SA2's Data_DLL.dll when you install. If I update the loader you can replace this copy of the dll and the manager will detect the change and ask if you want to copy it over the currently installed version. Finally there's a "programming" folder, which contains the header files that define the mod API, several important variables, functions, structures and enums in SA2, and a couple convenience functions and macros. You will also find a copy of the Character Randomizer mod's source code as an example. There are currently three mods, all made by me: Character Randomizer, which causes the game to load a random character instead of the one you select in each level. Item Box Randomizer, which randomizes the contents of all item boxes and balloons. It seems to crash sometimes if a mech's lockon shot hits a balloon. An updated version of my character select mod (more info in the SA2 hacking thread).
Woah, awesome work dude! I'll give it a try the next time I play SA2. We really need a dedicated database for SA2 and SG mods...
Update: Mods can now specify overrides for data exported from Data_DLL.dll in the ModInfo structure via a list of structures containing the string name of the export to override, and the data to replace it with. File redirection is now possible. Any time SA2 reads from the resource\gd_PC folder, all mod folders will be searched for a matching file in a gd_PC subfolder. For example, if SA2 loads resource\gd_PC\PRS\missiontex_am.pak, and your mod contains a file mods\modfolder\gd_PC\PRS\missiontex_am.pak, it will load the file from your mod's folder instead of SA2's folder. There is now an option to reactivate SA2's removed debug printing function, allowing you to see its messages in the console.
I noticed a little bit of what might be an issue. I tried using it, and it seems to work perfectly, and then I went to the Chao Garden using the chao key after playing as Tails instead of Eggman. Weeeelp.
So I've converted the main functions of the SA2 mod loader for SADX, and I'm releasing it now, without any mods and hardly anything in the .h file because it has some unique features: Fixes the window size to match the selected resolution. Disables the CD check. Allows you to enter a custom resolution (be warned, many nonstandard resolutions cause SADX to abruptly exit). Download SADX Mod Loader. You should note that, like everything else I do for SADXPC, this only works with the 2004 US version. Edit: And I should inform you, that the SADX mod loader's file redirection function does not work for music or videos, as those are handled by Windows Media Player, which I have tried and failed to override. This has been fixed. Edit 2: I forgot to mention, it also makes SADX check the depth buffer settings in order from highest to lowest, rather than lowest to highest like it normally does.
So, the mod loader should fix the quirk with SADX where the window stretches beyond the specified resolution? If so, then it's not working for me. I've tried different versions of the .exe as well. I'd definitely like to try and get it working, since on my widescreen monitor the game is horizontally stretched to a rather ugly degree unless I switch to fullscreen.
Nope. To be specific, I set the resolution to be 640x480. While it matches the width, the height of the window ends up being just a few measley pixels, so I can't see anything. I can tell the game is running fine though since I can make out the fading transitions.
Yeah, that's the one I'm trying to use. My OS is Windows XP with Service Pack 3, and everything I can conceivably update has been updated for a while.
I have now made the first loader compatible SADX mod. It's a remake of an older mod, which allowed me to test some things with model exporting and replacement.
Update for the SADX mod loader which allows mods to overwrite read-only data, and a new mod which required such functionality: A Metal Sonic mod. It replaces Sonic with Metal Sonic everywhere but in cutscenes and the Perfect Chaos fight (that'll come later). It also includes his missing voice clips from the GC version in case you don't have them, and it imports his physics data from Sonic Adventure 2 Battle. http://youtu.be/JFwH-7m1Jec
Apparently SADX isn't the only one with music issues, for some reason SA2 uses the full path for music, video and voice files. The loader has been updated to accommodate this, and also makes the read-only data writable.
Would it be possible to get his animations in from Sa2? That's one thing that always bothered me, he pretty much copies Sonic's for everything. It just felt like a cheap reskin instead of an actual extra character in DX.
Clarification: It's technically the same 'system', but sa2 is a superset of sa1. Then again it's like that for nearly the entire game, not just the animation system.