Modding:Setting up your Development Environment: Difference between revisions

From Vintage Story Wiki
m
Typos, minor grammar
m (Typos, minor grammar)
Line 1: Line 1:
When you are ready to begin coding mods for Vintage Story, you probably would want to set up a development environment that simplifies the process of coding and testing your creations. But if you feel hardcore, you can even create your code mods with your most basic text editor. The game engine will compile your raw source files when it finds them in your mod folder. Otherwise continue to read this tutorial.
When you are ready to begin coding mods for Vintage Story, you probably would want to set up a development environment that simplifies the process of coding and testing your creations. But if you feel hardcore, you can even create your code mods with your most basic text editor. The game engine will compile your raw source files when it finds them in your mod folder. Otherwise, continue to read this tutorial.


= Software Installation =
= Software Installation =
Line 13: Line 13:
=== Windows ===
=== Windows ===


VintageStory is developed using VisualStudio. You can get VisualStudio Community for free [https://www.visualstudio.com/de/vs/community/ here]. Installation should be simple and straight forward to do, but depending on your internet connection it may take a while.
VintageStory is developed using VisualStudio. You can get VisualStudio Community for free [https://www.visualstudio.com/de/vs/community/ here]. Installation should be simple and straightforward to do, but depending on your internet connection it may take a while.


=== Linux ===
=== Linux ===
Line 33: Line 33:
=== Mac OS ===
=== Mac OS ===


Download and install '''VisualStudio for Mac''' [https://www.visualstudio.com/vs/mac/ here]. Unfortunately nobody in our team has a mac, so we don't know for sure if the following tutorials work on mac without any problems.
Download and install '''VisualStudio for Mac''' [https://www.visualstudio.com/vs/mac/ here]. Unfortunately, nobody in our team has a mac so we don't know for sure if the following tutorials work on mac without any problems.


= Project Setup (SRC) =
= Project Setup (SRC) =


The source mod system lets you build mods that ship with source code that is compiled during run-time by the modloader engine. This has the great advantage of being open and easy to modify on the run but also comes with 2 major disadvantages. Up until game version 1.6.x you only have a hardcoded list of library references available to you (System.dll, System.Core.dll, System.Drawing.dll, System.Xml.dll, System.Net.Http.dll, VintagestoryAPI.dll, Newtonsoft.Json.dll, protobuf-net.dll, Tavis.JsonPatch.dll, cairo-sharp.dll), any other reference will not get loaded and thus your mod would fail to compile. The second major disadvantage, affecting all game versions, is that the inbuilt source code compiler can only compile code only up until C# 6.0, so newer language feature are not supported. If either of these disadvantages are a showstopper to you, we advice you to build a compiled mod.
The source mod system lets you build mods that ship with source code that is compiled during run-time by the modloader engine. This has the great advantage of being open and easy to modify on the run but also comes with 2 major disadvantages. Up until game version 1.6.x you only have a hardcoded list of library references available to you (System.dll, System.Core.dll, System.Drawing.dll, System.Xml.dll, System.Net.Http.dll, VintagestoryAPI.dll, Newtonsoft.Json.dll, protobuf-net.dll, Tavis.JsonPatch.dll, cairo-sharp.dll), any other reference will not get loaded and thus your mod would fail to compile. The second major disadvantage, affecting all game versions, is that the inbuilt source code compiler can only compile code only up until C# 6.0, so newer language features are not supported. If either of these disadvantages are a showstopper to you, we advise you to build a compiled mod.
== Get the Modtemplate ==
== Get the Modtemplate ==


Line 46: Line 46:
Navigate to <code>VSMods</code> and double click <code>VSMods.sln</code> (only works if VisualStudio is installed). Alternatively you can also start VisualStudio hit <code>Open Project/ Solution</code>, navigate to the extracted folder and select <code>VSMods.sln</code>.
Navigate to <code>VSMods</code> and double click <code>VSMods.sln</code> (only works if VisualStudio is installed). Alternatively you can also start VisualStudio hit <code>Open Project/ Solution</code>, navigate to the extracted folder and select <code>VSMods.sln</code>.


But before you can start to work, you have to setup the ModTools first.
But before you can start to work, you have to set up the ModTools first.


== Run ModTools ==
== Run ModTools ==
14

edits