Hello,
So i started modding Eco and after some modding i started with the creation of a new ore. I got everything worked out from the code to the models but after being able to actually get rubble when mining a block the rubble stays non intractable. not even my green pointer can point at it let stand interact. I tried different settings and some work-arounds without succes. Here are some pictures to see the difference and some of my code for those who could figure it out or know how to create a working min-able block.
[TABLE=noborder,nobackground,centered,collapse]
[tr][td]Limestone rubble
Custom ore rubble
[/TABLE]
"Ore code"
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.DynamicValues;
using Eco.Gameplay.Items;
using Eco.Gameplay.Objects;
using Eco.Gameplay.Players;
using Eco.Gameplay.Skills;
using Eco.Gameplay.Systems;
using Eco.Gameplay.Systems.TextLinks;
using Eco.Shared.Localization;
using Eco.Shared.Serialization;
using Eco.Shared.Utils;
using Eco.World;
using Eco.World.Blocks;
using Eco.Gameplay.Pipes;
using Eco.Gameplay.Interactions;
using Eco.Gameplay.Systems.Chat;
[Serialized]
[Solid, Wall, Minable(2)]
public partial class SulphurBlock :
Block
, IRepresentsItem
{
public Type RepresentedItemType { get { return typeof(SulphurItem); } }
}
[Serialized]
[MaxStackSize(20)]
[Weight(30000)]
[ResourcePile]
[Currency]
public partial class SulphurItem :
BlockItem<SulphurBlock>
{
public override LocString DisplayName { get { return Localizer.DoStr("Sulphur"); } }
public override LocString DisplayNamePlural { get { return Localizer.DoStr("Sulphur"); } }
public override LocString DisplayDescription { get { return Localizer.DoStr("Sulphur"); } }
public override bool CanStickToWalls { get { return false; } }
private static Type[] blockTypes = new Type[] {
typeof(SulphurStacked1Block),
typeof(SulphurStacked2Block),
typeof(SulphurStacked3Block),
typeof(SulphurStacked4Block)
};
public override Type[] BlockTypes { get { return blockTypes; } }
}
[Serialized, Solid] public class SulphurStacked1Block : PickupableBlock { }
[Serialized, Solid] public class SulphurStacked2Block : PickupableBlock { }
[Serialized, Solid] public class SulphurStacked3Block : PickupableBlock { }
[Serialized, Solid, Wall] public class SulphurStacked4Block : PickupableBlock { }
}
Alles anzeigen
"Ore Rubble code"
C#
namespace Eco.Mods.TechTree
{
using Eco.Shared.Serialization;
using Eco.Gameplay.Objects;
using Eco.World;
using Eco.World.Blocks;
using Eco.Gameplay.Interactions;
using Eco.Gameplay.Items;
using Eco.Gameplay.Players;
using Eco.Shared.Math;
using Eco.Gameplay.Systems.Chat;
[BecomesRubble(typeof(SulphurRubbleSet1Chunk1Object), typeof(SulphurRubbleSet1Chunk2Object), typeof(SulphurRubbleSet1Chunk3Object))]
//[BecomesRubble(typeof(SulphurRubbleSet2Chunk1Object), typeof(SulphurRubbleSet2Chunk2Object), typeof(SulphurRubbleSet2Chunk3Object), typeof(SulphurRubbleSet2Chunk4Object))]
public partial class SulphurBlock : Block { }
[Serialized]
public partial class SulphurRubbleSet1Chunk1Object : RubbleObject<SulphurItem>
{
public override Vector3 SpawnOffset { get { return new Vector3(0.26f, 0.25f, 0); } }
}
[Serialized]
public partial class SulphurRubbleSet1Chunk2Object : RubbleObject<SulphurItem>
{
public override Vector3 SpawnOffset { get { return new Vector3(-0.26f, 0.25f, 0); } }
}
[BecomesRubble(typeof(SulphurRubbleSet1Chunk3Split1Object), typeof(SulphurRubbleSet1Chunk3Split2Object))]
[Serialized]
public partial class SulphurRubbleSet1Chunk3Object : RubbleObject<SulphurItem>
{
public override Vector3 SpawnOffset { get { return new Vector3(0, -0.25f, 0); } }
}
[Serialized]
public partial class SulphurRubbleSet1Chunk3Split1Object : RubbleObject<SulphurItem>
{
public override Vector3 SpawnOffset { get { return new Vector3(0.26f, -0.25f, 0); } }
}
[Serialized]
public partial class SulphurRubbleSet1Chunk3Split2Object : RubbleObject<SulphurItem>
{
public override Vector3 SpawnOffset { get { return new Vector3(-0.26f, -0.25f, 0); } }
}
//[Serialized, Diggable] public partial class SulphurRubbleSet2Chunk1Object : RubbleObject<SulphurItem> { }
//[Serialized, Diggable] public partial class SulphurRubbleSet2Chunk2Object : RubbleObject<SulphurItem> { }
//[Serialized, Diggable] public partial class SulphurRubbleSet2Chunk3Object : RubbleObject<SulphurItem> { }
//[Serialized, Diggable] public partial class SulphurRubbleSet2Chunk4Object : RubbleObject<SulphurItem> { }
}
Alles anzeigen