Modding:C Sharp Scripting: Difference between revisions

Jump to navigation Jump to search
Added quick guide to using VIsual Studio with the decompiled code
(modding -> script modding)
(Added quick guide to using VIsual Studio with the decompiled code)
Line 33: Line 33:
#* You can replace '~/Qud_Code' with any other directory, if you have a certain place you want to put it
#* You can replace '~/Qud_Code' with any other directory, if you have a certain place you want to put it
# Open Visual Studio, then open the csproj file a ~/Qud_Code/Assembly-CSharp.csproj
# Open Visual Studio, then open the csproj file a ~/Qud_Code/Assembly-CSharp.csproj
'''Modding Using Visual Studio'''
Follow these steps in order to get Visual Studio to correctly parse and include the decompiled code while you are writing your mod code (there are other methods, but this is the one I used):
# Using ILSpy, decompile Assembly-CSharp.dll as described above.
# Right click on the "Assembly-CSharp" folder in the sidebar and select "Save Code", and then save it as a Visual Studio Project wherever you want, ideally outside of your mod code or the base game files, as otherwise things could get confused quick.
# In Visual Studio, create a new project from existing code, and select the folder that contains your mod.
# Once that project is open, go to File > Add > Existing Project and select the Visual Studio Project you saved your disassembled code as. You should now have both the disassembled code and your mod folder open as projects in a single solution.
# Go to Project > Project Dependencies and add the decompiled code project as a dependency of your mod project
# Right click on your mod project in the Solution Explorer, and select Add > Reference, and then go to "Projects" in the sidebar and select the disassembled code, before clicking "OK"
# Congrats, Visual Studio should now correctly parse your mod scripts against the existing game scripts. 


==Detailed Scripting Topics==
==Detailed Scripting Topics==
Anonymous user

Navigation menu