Coder Social home page Coder Social logo

eco_kepler62_mods's Introduction

List of the updated mods who runs on Kepler-62 (Server for the game Eco)

Put any user custom code in this folder. It will be compiled together with other Mods source files. You can use this directory for existing classes customization (with partial method implementations) or for new objects.

For example, you want to change the Computer Lab recipe.

  1. Create a file ComputerLab.cs
  2. Copy namespace, "using" part and partial class name from the original file
  3. Place changes for the recipe and other parameters under the ModsPreInitialize()method

Or just copy the original file and delete everything except namespace, using and ModsPreInitialize().

Then you need to overwrite the original recipe. You have a bunch of ways to do that:

  • Overwrite a recipe's ingredients
namespace Eco.Mods.TechTree
{
    using Eco.Gameplay.Items;

    public partial class ComputerLabRecipe
    {
        partial void ModsPreInitialize()
        {
            var ingredients = this.Recipes[0].Ingredients;
            ingredients.Clear();
            ingredients.AddRange(
                new IngredientElement[]
                {
                new IngredientElement(typeof(FramedGlassItem), 7500, true), 
                new IngredientElement(typeof(DendrologyResearchPaperBasicItem), 3000, true),
                new IngredientElement(typeof(ModernUpgradeLvl4Item), 250, true)
                });
            this.LaborInCalories = CreateLaborInCaloriesValue(50000, typeof(ElectronicsSkill));
            this.CraftMinutes = CreateCraftTimeValue(1440);
        }
    }
}
  • Make a new recipe (do not forget to add it to the recipes list)
namespace Eco.Mods.TechTree
{
    using System.Collections.Generic;
    using Eco.Gameplay.Items; 
    using Eco.Shared.Localization;	

    public partial class ComputerLabRecipe
    {
        partial void ModsPreInitialize()
        {
            var product = new Recipe(
                "ComputerLab",
                Localizer.DoStr("Computer Lab"),
                new IngredientElement[]
                {
                 new IngredientElement(typeof(FramedGlassItem), 7500, true),
                 new IngredientElement(typeof(DendrologyResearchPaperBasicItem), 3000, true),
                 new IngredientElement(typeof(ModernUpgradeLvl4Item), 250, true),
                },
                new CraftingElement<ComputerLabItem>()
             );
              this.Recipes = new List<Recipe> { product };
              this.LaborInCalories = CreateLaborInCaloriesValue(50000, typeof(ElectronicsSkill));
              this.CraftMinutes = CreateCraftTimeValue(1440);
        }
    }
}
  • Create and add a recipe to the list at the same time
namespace Eco.Mods.TechTree
{
    using System.Collections.Generic;
    using Eco.Gameplay.Items; 
    using Eco.Shared.Localization;	

    public partial class ComputerLabRecipe
    {
        partial void ModsPreInitialize()
        {
            this.Recipes = new List<Recipe>
            {
                new Recipe(
                    "ComputerLab",
                    Localizer.DoStr("ComputerLab"),
                    new IngredientElement[]
                    {
                        new IngredientElement(typeof(FramedGlassItem), 7500, true),
                        new IngredientElement(typeof(DendrologyResearchPaperBasicItem), 3000, true),
                        new IngredientElement(typeof(ModernUpgradeLvl4Item), 250, true),
                    },
                    new CraftingElement<ComputerLabItem>()
                )
            };
            this.LaborInCalories = CreateLaborInCaloriesValue(50000, typeof(ElectronicsSkill));
            this.CraftMinutes = CreateCraftTimeValue(1440);
        }
    }
}

If you need to completely override definition from __core__ then you need to create file with same path and add suffix .override to it's name (before .cs). In example for core file: __core__\AutoGen\Blocks\AsphaltBlock.cs you may create override file: UserCode\AutoGen\Blocks\AsphaltBlock.override.cs with will be loaded instead of original file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.