Modding:Load Order: Difference between revisions
Mirotworez (talk | contribs) m (add translate tag) |
Mirotworez (talk | contribs) (Marked this version for translation) |
||
Line 1: | Line 1: | ||
<languages/><translate> | <languages/><translate> | ||
<!--T:1--> | |||
{{GameVersion|?.??}} | {{GameVersion|?.??}} | ||
<!--T:2--> | |||
Most code mods will work fine when loaded by the game at the default time. | Most code mods will work fine when loaded by the game at the default time. | ||
<!--T:3--> | |||
However, ModSystems can specify a particular place in the pipeline when they should be loaded by the game, by overriding the method <code>ModSystem.ExecuteOrder()</code> and returning a value between 0.0 and 1.0, inclusive. | However, ModSystems can specify a particular place in the pipeline when they should be loaded by the game, by overriding the method <code>ModSystem.ExecuteOrder()</code> and returning a value between 0.0 and 1.0, inclusive. | ||
<!--T:4--> | |||
The following are some example mod systems from the base game and when they are loaded (from the API comments on [https://github.com/anegostudios/vsapi/blob/master/Common/API/ModSystem.cs#L45 ModSystem.ExecuteOrder]): | The following are some example mod systems from the base game and when they are loaded (from the API comments on [https://github.com/anegostudios/vsapi/blob/master/Common/API/ModSystem.cs#L45 ModSystem.ExecuteOrder]): | ||
<!--T:5--> | |||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
/// <summary> | /// <summary> | ||
Line 32: | Line 37: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:6--> | |||
To provide a concrete example, if you would like your ModSystem to be loaded as early as possible in the game's pipeline, you could configure your code similar to the following: | To provide a concrete example, if you would like your ModSystem to be loaded as early as possible in the game's pipeline, you could configure your code similar to the following: | ||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
Line 41: | Line 47: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:7--> | |||
{{Navbox/modding|Vintage Story}} | {{Navbox/modding|Vintage Story}} | ||
</translate> | </translate> |
Latest revision as of 21:01, 20 February 2022
This page was last verified for Vintage Story version ?.??.
Most code mods will work fine when loaded by the game at the default time.
However, ModSystems can specify a particular place in the pipeline when they should be loaded by the game, by overriding the method ModSystem.ExecuteOrder()
and returning a value between 0.0 and 1.0, inclusive.
The following are some example mod systems from the base game and when they are loaded (from the API comments on ModSystem.ExecuteOrder):
/// <summary>
/// If you need mods to be executed in a certain order, adjust this methods return value.
/// The server will call each Mods StartPre() & Start() methods in ascending order of each mods execute order value. And thus, as long as every mod registers it's event handlers in the Start() method, all event handlers will be called in the same execution order.
/// Default execute order of some survival mod parts
/// Worldgen:
/// - GenTerra: 0
/// - RockStrata: 0.1
/// - Deposits: 0.2
/// - Caves: 0.3
/// - Blocklayers: 0.4
/// Asset Loading
/// - Json Overrides loader: 0.05
/// - Load hardcoded mantle block: 0.1
/// - Block and Item Loader: 0.2
/// - Recipes (Smithing, Knapping, Clayforming, Grid recipes, Alloys) Loader: 1
/// </summary>
/// <returns></returns>
public virtual double ExecuteOrder()
{
return 0.1;
}
To provide a concrete example, if you would like your ModSystem to be loaded as early as possible in the game's pipeline, you could configure your code similar to the following:
public class ExampleMod : ModSystem
{
public override double ExecuteOrder() => 0;
//...
}
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 |