Modding:Setting up your Windows Development Environment
This tutorial is about advanced modding. It should teach you how to setup your development environment and should introduce you into the basics of Visual Studio.
Contents
Install VintageStory
First of all download VintageStory and make sure you have installed the newest version of the game, otherwise errors may occur.
Download & Install Visual Studio
As you might know Vintage Story is programmed in C#. Luckily you can get Visual Studio Community for free here. Installation should be simple to do, but depending on your internet connection will may take a while.
Getting started
To get started download the VSModTemplate solution (here). Now you simply need to extract the zip archive to your desired place:
Navigate to VSMods
and double click VSMods.sln
(only works if VisualStudio is installed). Alternatively you can also start VisualStudio hit Open Project/ Solution
, navigate to the extracted folder and select VSMods.sln
. Once it has loaded you can run your first test by hitting start
. If everything has been done correctly VintageStory should start.
Also make sure you have installed the latest version of VintageStory, otherwise some of the following tutorials might be outdated.
How to create a new mod
The mod launcher is ready, but how can you add your own mods to it? The idea behind it is rather simple, all mods inside mods
(in your extracted folder) will be recognized by VintageStory. Through that way your modding environment is separated from your actual game files. So what you need to do is to create another project to your solution, which is located in the mods folder. Therefore open up VisualStudion navigate to the top left corner and click on File
-> Add
-> New Project...
Now this window should popup ...
Make sure you select ClassLibrary (.NET Standard)
.
- Type in the name of the mod
- Add
\mods
to the path (otherwise your mod won't be loaded)
After you have saved it a new project should appear in your solution. Before you can start to work with it you need to make sure that your mod depends on the mod launcher. In order to add it as an dependency right click your project -> Build Dependencies
-> Project Dependencies
Now enable VSModLauncher ...
Now you can add all kinds of file to your mod, such as the modinfo.json
and assets
The last thing remaining is to add the VintageStoryAPI.dll
to your project. So just start modding and fix the compiling errors:
And there we are ... everything is setup properly and you can start to go crazy with modding.
API Overview
The API interface is mostly documented, but if you feel a need for a reference documentation is is available at http://apidocs.vintagestory.at
Example mods are available on Github: https://github.com/anegostudios/vsmodexamples
Main Page: Modding |
Basics | Mod Types | Asset System | Textures | Items | Recipes | Blocks | Model Creator | Release |
Advanced | Setup(Windows,Linux) | Items (Code, JSON) | Blocks | Item-Block interactions | Block Behaviors | Block Entities | Particles | World Access |
Worldgen | Terrain | Ores | Trees | WorldGen API |
Rendering | Shaders and Renderers |
Property Overview | Item | Block | Block Behaviors | Block Classes | Block Entities | Block Entity Behaviors |