Modding:Load Order

From Vintage Story Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Other languages:

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;
        //...
    }
Icon Sign.png

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.