Unusable PumpJack


  • Hello guys,

    There is something missing in the PumpJackObject.cs file because it's unusable for now. When you interact with it, the window is empty.
    I think you changed methods since 5.0 to deals with the object attributes in the interaction windows because if you add the "OnCreate" method on the PumpJackObject class like below, it's works :

    public class PumpJackObject : WorldObject
    {
    public override string FriendlyName { get { return "Pumpjack"; } }
    protected override void OnCreate()
    {
    base.OnCreate();
    this.AddComponent(() => new MinimapComponent());
    this.AddComponent(() => new RoomRequirementsComponent());
    this.AddComponent(() => new PublicStorageComponent(16, 4000));
    this.AddComponent(() => new PrivateStorageComponent(16, 4000));
    this.AddComponent(() => new CraftingComponent());
    }
    //public PumpJackObject()
    //{ }
    }


  • 13
    Posts
    3260
    Views
    Log in to reply


  • PumpJack is not working at the moment ? I just placed one and i can do nothing ?

    @myakatsura Maybe you can upload your fixed PumpJackObject.cs ?

    Is it needed to fix it only serverside or both client and server side ?

    Will this be fixed in Alpha 5.2 ? If yes is there an ETA on alpha 5.2 ?

    with best regards
    Desiderius



  • @Desiderius said:

    PumpJack is not working at the moment ? I just placed one and i can do nothing ?

    @myakatsura Maybe you can upload your fixed PumpJackObject.cs ?

    Is it needed to fix it only serverside or both client and server side ?

    Will this be fixed in Alpha 5.2 ? If yes is there an ETA on alpha 5.2 ?

    with best regards
    Desiderius

    You just have to change the file /Mods/Objects/PumpJackObject.cs in your server directory.
    Change these two lines :
    public PumpJackObject()
    { }
    to :
    protected override void OnCreate()
    {
    base.OnCreate();
    this.AddComponent(() => new MinimapComponent());
    this.AddComponent(() => new RoomRequirementsComponent());
    this.AddComponent(() => new PublicStorageComponent(16, 4000));
    this.AddComponent(() => new PrivateStorageComponent(16, 4000));
    this.AddComponent(() => new CraftingComponent());
    }



  • hmmm.. i updated my file and i looks:

    using System.Runtime.Serialization;
    using Eco.Gameplay.Components;
    using Eco.Gameplay.Items;
    using Eco.Gameplay.Objects;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Property;
    using Eco.Gameplay.Skills;
    using Eco.Mods.TechTree;
    using Eco.Shared.Math;
    using Eco.Shared.Services;
    using Eco.World;
    using Eco.World.Blocks;

    [DataContract]
    public class PumpJackObject : WorldObject
    {
    public override string FriendlyName { get { return "Pumpjack"; } }
    protected override void OnCreate()
    {
    base.OnCreate();
    this.AddComponent(() => new MinimapComponent());
    this.AddComponent(() => new RoomRequirementsComponent());
    this.AddComponent(() => new PublicStorageComponent(16, 4000));
    this.AddComponent(() => new PrivateStorageComponent(16, 4000));
    this.AddComponent(() => new CraftingComponent());
    }
    }

    But after i deconstruct the pumpjack and build it again the server crashes :(

    maybe i make something wrong with the code ?

    But btw many thx for your help.

    Greetings
    Desiderius



  • Same issue here.
    Tried the code but does not work for me in the World.
    Any Updates on that?



  • @Desiderius
    Did you change what is after this class ?
    What is the error message when the server crash ?

    Btw which version ? I didn't test on the 5.1



  • no i just replace it as you say. Yes we use alpha 5.1

    i make an bug report:

    https://github.com/StrangeLoopGames/EcoIssues/issues/976

    with the lack of petroleum and then plastic etc. we can not progress further.

    BTW I didnt test alpha 5.2 because i always wait some days for incoming hotfixes :)

    Greetings
    Desiderius
    www.fh-warzone.de



  • @myakatsura thx for your response

    I'm playing with Desiderius and had modified the PumpJackObject.cs file yesterday.
    The server restarts without any greater problems (no probs and issues in conjunction with the pumpjack) and as soon as we try to build / place the pumpjack the server crashes.

    A NullReferenceException is thrown:
    System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt [Object reference not set to an instance of an Object]
    bei Eco.Gameplay.Objects.OccupancyHelper.ToWorldPositions(Vector3i position, IEnumerable1 occupancy, Quaternion rotation) bei Eco.Gameplay.Objects.WorldObject.get_WorldOccupancy() bei Eco.Gameplay.Components.RoomRequirementsComponent.Tick(Single dtime) bei System.Collections.Generic.List1.ForEach(Action`1 action)
    bei Eco.Gameplay.Objects.WorldObject.Eco.Simulation.ITickable.Tick()
    bei Eco.Simulation.Simulation.TickAll()
    bei Eco.Gameplay.Objects.WorldObjectManager.Run()
    bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    bei System.Threading.ThreadHelper.ThreadStart(Object obj)

    The modified pumJackObject.cs file is attached pumpJackObject.cs

    It seems to be a null parameter is assigned in OccupancyHelper.ToWorldPositions, assuming occupancy. Tried to set up a value with

    static PumpJackItem()
    {
    WorldObject.AddOccupancyFromString(typeof(PumpJackItem), "5,3,3"); // values are guessed
    }

    .. but had no success. Same result.

    The use of AddOccupancyList is not useable.



  • @cattoaster Ho yes sorry I had to change something else, it miss the Occupancy. You're closed to the answer :)

    This is my modified file from 5.0 version :
    PumpJackObject.cs



  • Ah thankes Dude
    Finally it works on my server. You are the best ;)



  • @myakatsura said:

    @cattoaster Ho yes sorry I had to change something else, it miss the Occupancy. You're closed to the answer :)

    This is my modified file from 5.0 version :
    PumpJackObject.cs

    Thanks myakatsura. It works and we can use the pumpjack -- pollution incoming :)



  • I'm using the modified 5.0 version from myakatsura, but when we try to place pumpjack the server crashes.
    Log: Crash 01173247.ecodmp

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • Tinkered with it for a bit and finally got it working for 5.3 at least on our server;

    http://www.filedropper.com/pumpjackobject

    Hopefully it will work for everyone and if there is any issues, do post the crash logs to be able to help you.

    Edit : Do remember that is all that is allowed to be contained in that file, if you have an altered file since previously it might cause issues so be aware.


13
Posts
3260
Views
Log in to reply

Internal error.

Oops! Looks like something went wrong!