Modding:Creating A Code Mod: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 10: | Line 10: | ||
=== Recommended Knowledge === | === Recommended Knowledge === | ||
Before continuing, it is highly advisable to have some knowledge of Visual Studio and the C# programming language. These topics are out of the scope of this tutorial, however if you can understand the following tutorials, you should be okay: | |||
* [https://www.youtube.com/watch?v=iC3CJcYxkl0 Starting with Visual Studio (YouTube)] | * [https://www.youtube.com/watch?v=iC3CJcYxkl0 Starting with Visual Studio (YouTube)] | ||
* [https://learn.microsoft.com/en-gb/dotnet/core/tutorials/with-visual-studio?pivots=dotnet-7-0 Create a .NET console application using Visual Studio (Microsoft.com)] | * [https://learn.microsoft.com/en-gb/dotnet/core/tutorials/with-visual-studio?pivots=dotnet-7-0 Create a .NET console application using Visual Studio (Microsoft.com)] | ||
== Creating a New Mod == | |||
To create a new code mod, launch Visual Studio, and select 'Create a new project'. In the create menu, select Vintage Story from the dropdown furthest to the right. This will filter the list of templates, to only show ones with the "Vintage Story" project type. | |||
[[File:VisualStudioVSBasicTemplateSelect.png|center|frameless|558x558px]] | |||
Select the 'Vintage Story Basic Mod Template'. This will load a new menu asking for a project name, location, and solution name. | |||
Your project name should follow these requirements: | |||
* Not contain any spaces or punctuation. | |||
* Be formatted in ''[https://www.theserverside.com/definition/Pascal-case PascalCase].'' | |||
* Not be abbreviated (''MyFirstMod'' instead of ''MFM''). | |||
Your project name will also determine your Mod ID, however this ''can'' be altered later. Your mod id will be converted to all lower case. | |||
</translate> | </translate> | ||
{{Navbox/codemodding}} | {{Navbox/codemodding}} |
Revision as of 17:21, 22 May 2024
This page was last verified for Vintage Story version 1.19.8.
Prerequisites
Before creating a code mod, you need to have completed the Preparing For Code Mods tutorial. This will show you how to setup your development environment, install dotnet, and install the modding template. If you have done that, you can carry on with this tutorial.
This tutorial is suitable for modders using Visual Studio. If you have chose to use a different IDE, please refer to the older Setting up your Development Environment tutorial.
Recommended Knowledge
Before continuing, it is highly advisable to have some knowledge of Visual Studio and the C# programming language. These topics are out of the scope of this tutorial, however if you can understand the following tutorials, you should be okay:
- Starting with Visual Studio (YouTube)
- Create a .NET console application using Visual Studio (Microsoft.com)
Creating a New Mod
To create a new code mod, launch Visual Studio, and select 'Create a new project'. In the create menu, select Vintage Story from the dropdown furthest to the right. This will filter the list of templates, to only show ones with the "Vintage Story" project type.
Select the 'Vintage Story Basic Mod Template'. This will load a new menu asking for a project name, location, and solution name.
Your project name should follow these requirements:
- Not contain any spaces or punctuation.
- Be formatted in PascalCase.
- Not be abbreviated (MyFirstMod instead of MFM).
Your project name will also determine your Mod ID, however this can be altered later. Your mod id will be converted to all lower case.
Code Modding | |||||||
---|---|---|---|---|---|---|---|
Basics | Code Mods • Preparing For Code Mods • Creating A Code Mod | ||||||
Tutorials |
|
||||||
Advanced | Server-Client Considerations • Setting up your Development Environment • Advanced Blocks • Advanced Items • Block and Item Interactions • Block Behavior • Block Entity • Particle Effects • World Access • Inventory Handling • Commands • GUIs • Network API • Monkey patching (Harmony) | ||||||
Data Management | Savegame Data Storage • ModConfig File • Chunk Data Storage • TreeAttribute | ||||||
Worldgen | WorldGen API • NatFloat • EvolvingNatFloat | ||||||
Rendering | Shaders and Renderers |
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials • Content Mod Concepts |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |