Mods / Vintage Story Mod Template (.NET Framework)

Category: #Other #QoL #Utility
Author: Apache
Side: Both
Created: Jul 1st at 3:37 PM
Last modified: Jul 1st at 6:03 PM
Downloads: 50
Follow Unfollow 1

Vintage Story Mod Template (.NET Framework)

Support the Mod Author.

A project template for creating a C# Code Mod, for Vintage Story. This template should target .NET Framework 4.6.1, and should be placed within a sub-folder of the solution's root directory.

First Time Users

RUN VISUAL STUDIO AS ADMINISTRATOR

Upon your first time using the mod template, when you have just set up your Environment Variables within the wizard, you will likely see a number of errors, and the mod will not run. This is because Visual Studio needs to be restarted, in order for the Environment Variables to be refreshed. Once you reopen your solutions, these error messages will disappear, and you'll be good to go.

What's Included?

Environment Variables

The first time you run the template, it will ask you to set up your environment variables for the game directories. These will default as follows:

Install Directory: %VINTAGE_STORY%

DataDirectory: %VINTAGE_STORY_DATA%

You can also change the keys, if for instance, you wish to set variables for a specific version of the game for the mod you are creating. Each subsequent run of the template will skip this step if the above keys are found, with an option to go back, and set them again.

Mod Information

You will also be given a chance to customise your mod by giving it a title, description, default domain, app-side, and author. These values can always be fine-tuned later on, within the included `modinfo.json` file.

Sample Client-Side ModSystem

Within the sample `ModSystem`, there is a client-side command, as a basic example of how the mod works. Once logged in, you should be able to type `.hello` in chat, and see the result, `"Hello World!"`, displayed as a chat notification. You can delete this file, once you have verified that the game can load the mod, and run the command.

Hot Reload

The mod is set up ready for Hot Reload. From the moment your new mod is created, and set as the _Startup Project_, you should be able to press `F5`, and launch directly into Vintage Story. You should be able to see your new mod within the Mods List, and when you log into a new or existing world, you should be able to use the new `.hello` command. It's a good idea to test all of this, before starting to write your mod, to make sure that everything is working correctly.

Mod Packager

When you build your mod, it is automatically packaged into a `.zip` file, along with all the files needed for it to run. The archive is named, including a version taken from the `modinfo.json` file, and it is placed within the `.release` folder, within the solution's root directory. This zip file will be ready to upload to ModDB.

Finishing Steps

There are a number of optional completion steps that you may wish to take.

Includes Folder - Every file that is placed within the `_Includes` folder will be copied into the mod, when the project is built.
Use this folder to add assets, a mod icon, other forms of documentation, etc.

Assets - An `assets` folder has been included, with empty folders for each of the different asset categories.
Use, or delete these folders, as needed. An English language file has also been included, to show the
basic principle of translatable strings.

Mod Info - A minimal `modinfo.json` file has been included; but you should check to make sure all information is correct,
and add any missing records that your mod will need, in order to run.

Readme File - A basic `README.md` file has been included, which will be shipped along with your mod.
You should expand this file, and give information about your mod, and how to use it. You can also use this
as a template to add to the ModDB page, when you upload your mod.

Licensing - The mod has come packaged with a standard MIT License, from https://opensource.org/licenses/MIT.
Feel free to open `LICENSE.md`, and change the licensing text, as per your needs.

Version For Game version Downloads Release date Changelog Download
v1.5.1
48 Jul 1st at 6:03 PM Show Vintage Story Mod Template (.NET Framework).vsix

2 Comments (oldest first | newest first)

Apache, Jul 5th at 3:53 AM

jakecool19, thank you. This was overlooked, because I always run Visual Studio as Admin, by deafult.  :P

I've added it in big, red, bold, caps-locked letters, in the blurb above. :)

jakecool19, Jul 3rd at 3:38 PM

Thank you for this tool! Messing around with it, I have encountered one, very minor issue, with a simple fix. After putting in the directories and creating the solution, it will give the error that System.Security.SecurityException: Requested registry access is not allowed. Easily fixed by running Visual Studio in admin for the first time when creating it.

delete edit