How to edit .net with dnSpy?
-
I've seen a few post down dnSpy used to edit a .net mod.
Since Guadmaz doesn't appear to be active here anymore, can dnSpy be used to remove the annoying always active "B" key in his otherwise awesome trucking mod?
I've downloaded the software and will attempt to edit the dll myself (for personal use) in no one else can help, but I don't really know what I'm doing in there yet.
This mod
https://www.gta5-mods.com/scripts/trucking-missions
-
I removed the B key handling, which apparently handles buying property? Not exactly sure that's what you wanted removed. Here is the edited version: https://mega.nz/file/5HYggSrB#4gWG7uwXe3Cv6ed-qqJz6kq6hqNODVNErlH8mJNC0Og
I take no credit for this mod. Guadmaz, if you are not okay with me editing/sharing your mod, please let me or the moderators know.
-
And to answer your question on how to edit the mod:
- Open the .dll in dnSpy.
- Expand TruckingMissions (grey), then TruckingMissions.dll (purple), then "-" (without quotes) (grey).
- Expand TruckingMissions (green).
- Click ProcessKey (orange)
- Find this line:
if ((Game.IsKeyPressed(Keys.B) ...
- Right-click that line and click "Edit IL Instructions..."
- Press N. Or, right-click the highlighted rows and click "NOP Instructions"
- After that, highlight the rows from Index 364 to Index 375.
- Press N. Or, right-click the highlighted rows and click "NOP Instructions"
- Click OK.
- In the toolbar, click File, then click "Save Module..."
- Change the filename if you want, then click OK.
-
Thanks, mate. That's exactly what I wanted, and thanks for the clear instructions as well.