Sure thing. You can decompile a mod just like you can demcompile the entire game. You just need to grab the assembly from .tmod file using TModLoader's built-in extractor, then throw that into ILSpy along with all the dependencies terraria has. Export the whole thing, fix the directory structure, and recreate the .csproj and build.txt files.So i had to factory reset due to some things and i forgot to backup my mod while doing so and i am wondering if there is any way i can decompile a tmod file with the code i still have all the images and sounds though.
Ok thanks!Sure thing. You can decompile a mod just like you can demcompile the entire game. You just need to grab the assembly from .tmod file using TModLoader's built-in extractor, then throw that into ILSpy along with all the dependencies terraria has. Export the whole thing, fix the directory structure, and recreate the .csproj and build.txt files.
This might be a bit too late but some of the code is kinda messed up and im wondering if there is any way to fix it or i have to fix it manually.No problem. Feel free to ask if you need any additional help with this.
ummm. had the same problem, how do i do that?Sure thing. You can decompile a mod just like you can demcompile the entire game. You just need to grab the assembly from .tmod file using TModLoader's built-in extractor, then throw that into ILSpy along with all the dependencies terraria has. Export the whole thing, fix the directory structure, and recreate the .csproj and build.txt files.
If tModLoader doesn't give you the assembly, that means the mod author decided to hide it. There are still ways to get it out, it's not that hard to figure out, if you know what you're doing. I won't tell you how to do it here though, for reasons that I hope are obvious...How would I be able to get the assembly if TML wont get it?
That is most likely happening because ILSpy didn't find a reference assembly. It doesn't know thatThis might be a bit too late but some of the code is kinda messed up and im wondering if there is any way to fix it or i have to fix it manually.
View attachment 278741
projectile
is a property, so just assumes get_projectile
is a regular method. To get source code that isn't garbled, I'd recommend manually dragging tModLoader.exe and all the assemblies from %userprofile%/My Games/Terraria/ModLoader/References
into ILSpy before exporting.