Modding:Setting up your Development Environment: Difference between revisions

From Vintage Story Wiki
(7 intermediate revisions by 3 users not shown)
Line 14: Line 14:
== Install Development Tool ==
== Install Development Tool ==


VintageStory is developed in C#. Choose one of the above IDEs or other alternatives. We suggest '''Visual Studio Community''' on Windows and on Linux you may want to use '''MonoDevelop''' or '''Visual Studio Code'''.
VintageStory is developed in C#. Choose one of the above IDEs or other alternatives. We suggest using '''Visual Studio Community''' for Windows. For Linux you may want to use '''MonoDevelop''' or '''Visual Studio Code'''.


=== Installation Guide on Linux with MonoDevelop ===
=== Installation Guide on Linux with MonoDevelop ===
Line 35: Line 35:


2. You can now either get the mod template project or manually set up a mod project. The mod template offers a convenience tool to set up multiple mod projects and to quickly pack up and have a ready-to-ship mod
2. You can now either get the mod template project or manually set up a mod project. The mod template offers a convenience tool to set up multiple mod projects and to quickly pack up and have a ready-to-ship mod


== Setup using Mod template ==
== Setup using Mod template ==
Line 97: Line 96:
Packs all mods in your workspace at once.
Packs all mods in your workspace at once.


=== Project Setup (Compiled Zip) ====
=== Project Setup (Compiled Zip) ===


Both dll and zip mods have their advantages and disadvantages, so why not combine them together? This project setup is very similar to zip. Instead of adding the source code to the zip file, it uses the compiled dll. This allows you to have all the dll benefits while still having the zip mod asset structure.
Both dll and zip mods have their advantages and disadvantages, so why not combine them together? This project setup is very similar to zip. Instead of adding the source code to the zip file, it uses the compiled dll. This allows you to have all the dll benefits while still having the zip mod asset structure.
Line 141: Line 140:
* If you compile to a .dll file, set up a ModInfo attribute in your AssemblyInfo.cs ([https://github.com/anegostudios/vsmodexamples/blob/master/Properties/AssemblyInfo.cs example])
* If you compile to a .dll file, set up a ModInfo attribute in your AssemblyInfo.cs ([https://github.com/anegostudios/vsmodexamples/blob/master/Properties/AssemblyInfo.cs example])
** Add the following command line arguments: <code>-openWorld="modsamplestest" -p3 --addModPath="C:\path\to\your\bin\folder" --addOrigin="C:\path\to\your\assets\folder\if\you\have\any"</code>
** Add the following command line arguments: <code>-openWorld="modsamplestest" -p3 --addModPath="C:\path\to\your\bin\folder" --addOrigin="C:\path\to\your\assets\folder\if\you\have\any"</code>
* If want to ship a source mod, set up a modinfo.json ([https://github.com/copygirl/CarryCapacity/blob/master/resources/modinfo.json example]). Make sure your folders are set up in a way that the modPath contains the modinfo.json and a folder named "src" containg your source files
* If want to ship a source mod or mod with assets, set up a modinfo.json ([https://github.com/copygirl/CarryCapacity/blob/master/resources/modinfo.json example]). Make sure your folders are set up in a way that the modPath contains the modinfo.json and a folder named "src" containg your source files. Optionally it can also contain an assets folder for your assets.
** Add the following command line arguments: <code>-openWorld="modsamplestest" -p3 --addModPath="C:\path\to\your\modPath"</code>
** Add the following command line arguments: <code>-openWorld="modsamplestest" -p3 --addModPath="C:\path\to\your\modPath"</code>
* I recommend adding the [https://github.com/anegostudios/vsmodexamples/blob/master/RedirectLogs.cs RedirectLogs.cs] file to your project, so that you can see the log output in your visual studio output window. You should not ship your mod with it though.  
* I recommend adding the [https://github.com/anegostudios/vsmodexamples/blob/master/RedirectLogs.cs RedirectLogs.cs] file to your project, so that you can see the log output in your visual studio output window. You should not ship your mod with it though.  
* Run the project and hope for the best :D
* Run the project and hope for the best :D
* To ship a mod have a look at [[Mod Packaging]]


If you are having troubles the vsmodexamples you might be able to learn from the [https://github.com/anegostudios/vsmodexamples vsmodexamples project]
If you are having troubles the vsmodexamples you might be able to learn from the [https://github.com/anegostudios/vsmodexamples vsmodexamples project]
= Moving Forward =
If you've successfully managed to setup your development environment and can run Vintage Story through the '''VSMods''' project in your IDE then it's time to get started on your first code mod. At this point there are many options you can choose from as code mods can alter almost any aspect of the game. However, the best place to start is likely one again with Blocks and Items (since you should be familiar with making them using JSONS by this point).
Head over to the '''[[Modding:Advanced Blocks | Advanced Blocks]]''' page to make your first advanced code block.
Or head over to the '''[[Modding:Advanced Items | Advanced Items]]''' page to make your first advanced code item.
{{Navbox/modding|Vintage Story}}
219

edits