Debugging with an API referenced by your mod
Debugging with an API referenced by your mod is simple, you’ll be able to get more detailed error messages in the mscModLoader Console with detailed error line locations.
I'm going to work through the process i found works with the api, 'ModAPI' Do:
- If you haven’t already, make sure you enable debugging for mscModLoader and set up Visual Studios for debugging My Summer Car. Check out piotrulos wiki page for debugging mods
- First, build/compile your api in debug mode.
- From your project’s bin/debug folder, copy the api, '.dll' and the api’s debug '.pdb’ files to your msc mods folder
- Run "Debug.bat"
- The program should have created a new unity debug file '*.mdb'
- Delete the api’s program debug '*.pdb' file from your mods folder.
- From your mods folder MOVE the api, '.dll' and the api’s unity debug file '.mdb' to "Mods/References":
- Delete the api’s program debug '*.pdb' file from your mods folder.
- The program should have created a new unity debug file '*.mdb'
- You should be able to debug your mod with Visual Studios and debug the api by setting break points, break conditions, view values, etc.
UPDATE: Here's an visual studio build event script to automate this process:
if "$(ConfigurationName)" == "Debug" (
copy "$(TargetPath)" "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods" /y
copy "$(TargetDir)$(TargetName).pdb" "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods" /y
cd "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods"
call "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\debug.bat"
copy "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\$(TargetName).dll.mdb" "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\References" /y
copy "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\$(TargetName).dll" "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\References" /y
del "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\$(TargetName).pdb" /q
del "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\$(TargetName).dll.mdb" /q
del "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\$(TargetName).dll" /q
) ELSE (
copy "$(TargetPath)" "D:\Games\SteamApps\steamapps\common\My Summer Car\Mods\References" /y
)
Obviously replace mod folder locations with your own. Copy and paste the script into your post build event section.
if debug configuration:
copies api.dll to mods folder copes api.pdb to mods folder calls debug.bat (creates api.dll.mdb file) copies api.dll to mods/references folder copies api.dll.mdb to mods/references folder deletes api.dll from mods folder. deletes api.pdb from mods folder. deletes api.dll.mdb from mods folder.
if release configuration:
copies api.dll to mods/references folder> 1. *
- How to install MSCLoader using MSCPatcher
- MSCPatcher explained
- How to install mods
- Official experimental linux support
- Unofficial tutorial for linux (wine/proton)
- Install Visual Studio for MSCLoader
- Install template for Visual Studio
- How to use templates
- Debugging your mods in Visual Studio
- Enable DevMode to help with debugging
- Uploading and creating Self update feature for your mod or reference
- All Playmaker Global Variables and Events
- How to create and use Asset Bundles