Better Placed

Rexzooly

Copper
Mod Dev
Messages
85
Likes
21
#1
Here I will post working objects better placed this does mean some are .cs file editing at times.
1520365461936.png

1520365904764.png

This one is the Oil Refinery, removed the need for pipes and added a fuel as well as power needs, I know a fuel system, can also provide power but I added this just like a car, some things that use systems what are not manual fuelled, it was also a way to help my server remove the buggy pipe system.
C#:
namespace Eco.Mods.TechTree
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using Eco.Gameplay.Blocks;
    using Eco.Gameplay.Components;
    using Eco.Gameplay.Components.Auth;
    using Eco.Gameplay.DynamicValues;
    using Eco.Gameplay.Economy;
    using Eco.Gameplay.Housing;
    using Eco.Gameplay.Interactions;
    using Eco.Gameplay.Items;
    using Eco.Gameplay.Minimap;
    using Eco.Gameplay.Objects;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Property;
    using Eco.Gameplay.Skills;
    using Eco.Gameplay.Systems.TextLinks;
    using Eco.Gameplay.Pipes.LiquidComponents;
    using Eco.Gameplay.Pipes.Gases;
    using Eco.Gameplay.Systems.Tooltip;
    using Eco.Shared;
    using Eco.Shared.Math;
    using Eco.Shared.Serialization;
    using Eco.Shared.Utils;
    using Eco.Shared.View;
    using Eco.Shared.Items;
    using Eco.World.Blocks;
  
    [Serialized]     
    [RequireComponent(typeof(AttachmentComponent))]
    [RequireComponent(typeof(PropertyAuthComponent))]
    [RequireComponent(typeof(PowerGridComponent))]           
    [RequireComponent(typeof(PowerConsumptionComponent))]
    [RequireComponent(typeof(MinimapComponent))]             
    [RequireComponent(typeof(LinkComponent))]                 
    [RequireComponent(typeof(CraftingComponent))]             
    [RequireComponent(typeof(FuelSupplyComponent))]                   
    [RequireComponent(typeof(FuelConsumptionComponent))]               
    [RequireComponent(typeof(HousingComponent))]                           
    public partial class OilRefineryObject : WorldObject
    {
        public override string FriendlyName { get { return "Oil Refinery"; } }

        private static Type[] fuelTypeList = new Type[]
        {
            typeof(LogItem),
            typeof(LumberItem),
            typeof(CharcoalItem),
            typeof(ArrowItem),
            typeof(BoardItem),
            typeof(CoalItem),
        };

        protected override void Initialize()
        {
            this.GetComponent<MinimapComponent>().Initialize("Crafting");                               
            this.GetComponent<FuelSupplyComponent>().Initialize(2, fuelTypeList);                         
            this.GetComponent<FuelConsumptionComponent>().Initialize(50);                             
            this.GetComponent<PowerConsumptionComponent>().Initialize(250);                   
            this.GetComponent<PowerGridComponent>().Initialize(10, new ElectricPower());             
            this.GetComponent<HousingComponent>().Set(OilRefineryItem.HousingVal);                             
        }

        public override void Destroy()
        {
            base.Destroy();
        }
    
    }

    [Serialized]
    public partial class OilRefineryItem : WorldObjectItem<OilRefineryObject>
    {
        public override string FriendlyName { get { return "Oil Refinery"; } }
        public override string Description { get { return "Sets of pipes and tanks which refine crude petroleum into usable products."; } }

        static OilRefineryItem()
        {
          
          
          
          
        }
      
        [TooltipChildren] public static HousingValue HousingVal { get { return new HousingValue()
                                                {
                                                    Category = "Industrial",
                                                    Val = 0,
                                                    TypeForRoomLimit = "",
                                                    DiminishingReturnPercent = 0
                                                };}}     
    }


    [RequiresSkill(typeof(MechanicalEngineeringSkill), 4)]
    public partial class OilRefineryRecipe : Recipe
    {
        public OilRefineryRecipe()
        {
            this.Products = new CraftingElement[]
            {
                new CraftingElement<OilRefineryItem>(),
            };

            this.Ingredients = new CraftingElement[]
            {
                new CraftingElement<BrickItem>(typeof(MechanicsAssemblyEfficiencySkill), 10, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy),
                new CraftingElement<GearItem>(typeof(MechanicsAssemblyEfficiencySkill), 10, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy),
                new CraftingElement<IronIngotItem>(typeof(MechanicsAssemblyEfficiencySkill), 20, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy), 
            };
            SkillModifiedValue value = new SkillModifiedValue(50, MechanicsAssemblySpeedSkill.MultiplicativeStrategy, typeof(MechanicsAssemblySpeedSkill), "craft time");
            SkillModifiedValueManager.AddBenefitForObject(typeof(OilRefineryRecipe), Item.Get<OilRefineryItem>().UILink(), value);
            SkillModifiedValueManager.AddSkillBenefit(Item.Get<OilRefineryItem>().UILink(), value);
            this.CraftMinutes = value;
            this.Initialize("Oil Refinery", typeof(OilRefineryRecipe));
            CraftingComponent.AddRecipe(typeof(MachineShopObject), this);
        }
    }
}
In my view removing the room for this object was better I never seen something like this indoors and I have no idea why eco dev's made it that way

---- Automatically Merged Double Post ----

Update:
Same as before but without housing stats
C#:
namespace Eco.Mods.TechTree
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using Eco.Gameplay.Blocks;
    using Eco.Gameplay.Components;
    using Eco.Gameplay.Components.Auth;
    using Eco.Gameplay.DynamicValues;
    using Eco.Gameplay.Economy;
    using Eco.Gameplay.Interactions;
    using Eco.Gameplay.Items;
    using Eco.Gameplay.Minimap;
    using Eco.Gameplay.Objects;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Property;
    using Eco.Gameplay.Skills;
    using Eco.Gameplay.Systems.TextLinks;
    using Eco.Gameplay.Pipes.LiquidComponents;
    using Eco.Gameplay.Systems.Tooltip;
    using Eco.Shared;
    using Eco.Shared.Math;
    using Eco.Shared.Serialization;
    using Eco.Shared.Utils;
    using Eco.Shared.View;
    using Eco.Shared.Items;
    using Eco.World.Blocks;
   
    [Serialized]      
    [RequireComponent(typeof(AttachmentComponent))]
    [RequireComponent(typeof(PropertyAuthComponent))]
    [RequireComponent(typeof(PowerGridComponent))]            
    [RequireComponent(typeof(PowerConsumptionComponent))]
    [RequireComponent(typeof(MinimapComponent))]              
    [RequireComponent(typeof(LinkComponent))]                  
    [RequireComponent(typeof(CraftingComponent))]              
    [RequireComponent(typeof(FuelSupplyComponent))]                    
    [RequireComponent(typeof(FuelConsumptionComponent))]                                              
    public partial class OilRefineryObject : WorldObject
    {
        public override string FriendlyName { get { return "Oil Refinery"; } }

        private static Type[] fuelTypeList = new Type[]
        {
            typeof(LogItem),
            typeof(LumberItem),
            typeof(CharcoalItem),
            typeof(ArrowItem),
            typeof(BoardItem),
            typeof(CoalItem),
        };

        protected override void Initialize()
        {
            this.GetComponent<MinimapComponent>().Initialize("Crafting");                                
            this.GetComponent<FuelSupplyComponent>().Initialize(2, fuelTypeList);                          
            this.GetComponent<FuelConsumptionComponent>().Initialize(50);                              
            this.GetComponent<PowerConsumptionComponent>().Initialize(250);                    
            this.GetComponent<PowerGridComponent>().Initialize(10, new ElectricPower());                                            
        }

        public override void Destroy()
        {
            base.Destroy();
        }
     
    }

    [Serialized]
    public partial class OilRefineryItem : WorldObjectItem<OilRefineryObject>
    {
        public override string FriendlyName { get { return "Oil Refinery"; } }
        public override string Description { get { return "Sets of pipes and tanks which refine crude petroleum into usable products."; } }

        static OilRefineryItem()
        {}    
    }


    [RequiresSkill(typeof(MechanicalEngineeringSkill), 4)]
    public partial class OilRefineryRecipe : Recipe
    {
        public OilRefineryRecipe()
        {
            this.Products = new CraftingElement[]
            {
                new CraftingElement<OilRefineryItem>(),
            };

            this.Ingredients = new CraftingElement[]
            {
                new CraftingElement<BrickItem>(typeof(MechanicsAssemblyEfficiencySkill), 10, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy),
                new CraftingElement<GearItem>(typeof(MechanicsAssemblyEfficiencySkill), 10, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy),
                new CraftingElement<IronIngotItem>(typeof(MechanicsAssemblyEfficiencySkill), 20, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy),  
            };
            SkillModifiedValue value = new SkillModifiedValue(50, MechanicsAssemblySpeedSkill.MultiplicativeStrategy, typeof(MechanicsAssemblySpeedSkill), "craft time");
            SkillModifiedValueManager.AddBenefitForObject(typeof(OilRefineryRecipe), Item.Get<OilRefineryItem>().UILink(), value);
            SkillModifiedValueManager.AddSkillBenefit(Item.Get<OilRefineryItem>().UILink(), value);
            this.CraftMinutes = value;
            this.Initialize("Oil Refinery", typeof(OilRefineryRecipe));
            CraftingComponent.AddRecipe(typeof(MachineShopObject), this);
        }
    }
}
 
Last edited:
OP
OP
Rexzooly

Rexzooly

Copper
Mod Dev
Messages
85
Likes
21
#3
Update:
I've been working on balancing all house values. Soon we will have a balanced industrial building.
This is one thing I do like about eco been able to set our servers how we want in these kinds of things but I removing the need for pipes at the moment until they fix it up, and any item I set to be a outdoor item will no longer have house values :p
 
Top Bottom