Jump to content

Storage adapter has issues on pump jack and mining quarry

Pending 1.5.7

lafeiyatis

Posted (edited)

image.png.1300bf22ba7d8506d774c3144049e648.png

As shown in the picture, you can see that after I stood here and hit the Storage Adapter of this mining quarry with a hammer, I didn't move, yet the distance already exceeded 30 meters, which means I practically can't connect it from anywhere.

 

image.png.4685104d3a55c6809d16297739604d2d.png

I placed the Mining Quarry on a floating island, taking advantage of the fact that you ignored the ground load-bearing mechanic. These are my coordinates. All Storage Adapters on the Mining Quarry and Pump Jack have a similar issue. ("Mining Quarry or Pump Jack: Disable stability control during spawning. Default false": true)

 

image.png.4fbb9b4c355daeecc4b54ab367742da2.png

But there is one exception: the Storage Adapter placed on the output bucket of the Pump Jack. It seems to not exist at all — it cannot be hit with a hammer (the hammer's striking sound is not a metal hit, and it doesn't produce the "connectable for 3 minutes" prompt after striking), and when aiming at it with the mouse, it shows "打开" — that is, the prompt to press E to open the UI for taking items out of the bucket.  You can see from the first image that, under normal circumstances, what should be displayed here is "拾取" meaning that holding E would remove this Storage Adapter and put it back into your inventory.

Edited by lafeiyatis
Scalbox

Posted

Hi

I need you to make a complete video, from when you hit the quarry storage adapter until you go to connect the target storage adapter

Scalbox

Posted

You have to hit the storage adapter from the side if the front doesn't work

Scalbox

Posted

I think the problem is the height. Did you build these quarries high up?!

Send me a complete video showing where you built these quarries and the connection.

lafeiyatis

Posted (edited)

image.png.63944e14282678f78941143d9235302a.png

 

I think I know what the issue is with this function.

You always want the pipe to go "down" to the ground, then run along the ground, then go "up" to the container — instead of going in a straight line.

You're using TerrainMeta.HeightMap.GetHeight(startWorld) to find the ground, but this doesn't account for floating islands created by other plugins.

This results in the pipe projecting dozens of meters downward from the floating island just to reach the game's base terrain.

Maybe you did this for visual aesthetics? But I don't think it's necessary — just drawing a straight line between the two points would be fine. I'm going to modify your code and test it out.

Edited by lafeiyatis
lafeiyatis

Posted

image.png.27ab1a65d80075437c108f69095309f2.png

Success, this works. The only issue is the pipe direction isn't rendering correctly, but that's a minor problem.

Here's the code I modified:

private static float GetPipeLength(IOEntity from, int outputSlot, IOEntity to, int inputSlot)
{
    if (from == null || to == null) return -1f;
    if (from.ioType != IOEntity.IOType.Industrial || to.ioType != IOEntity.IOType.Industrial) return -1f;
    if (outputSlot < 0 || outputSlot >= from.outputs.Length) return -1f;
    if (inputSlot < 0 || inputSlot >= to.inputs.Length) return -1f;

    var startWorld = from.transform.TransformPoint(from.outputs[outputSlot].handlePosition);
    var endWorld = to.transform.TransformPoint(to.inputs[inputSlot].handlePosition);
    var groundStart = new Vector3(startWorld.x, TerrainMeta.HeightMap.GetHeight(startWorld), startWorld.z);
    var groundEnd = new Vector3(endWorld.x, TerrainMeta.HeightMap.GetHeight(endWorld), endWorld.z);

    //return Vector3.Distance(startWorld, groundStart)
    //       + Vector3.Distance(groundStart, groundEnd)
    //       + Vector3.Distance(groundEnd, endWorld);
    return Vector3.Distance(startWorld, endWorld);
}

private static float GetPipeLengthToPlayer(IOEntity from, int outputSlot, Vector3 playerPosition)
{
    if (from == null) return -1f;
    if (from.ioType != IOEntity.IOType.Industrial) return -1f;
    if (outputSlot < 0 || outputSlot >= from.outputs.Length) return -1f;

    var startWorld = from.transform.TransformPoint(from.outputs[outputSlot].handlePosition);
    var groundStart = new Vector3(startWorld.x, TerrainMeta.HeightMap.GetHeight(startWorld), startWorld.z);
    var groundEnd = new Vector3(playerPosition.x, TerrainMeta.HeightMap.GetHeight(playerPosition), playerPosition.z);

    //return Vector3.Distance(startWorld, groundStart)
    //       + Vector3.Distance(groundStart, groundEnd)
    //       + Vector3.Distance(groundEnd, playerPosition);
    return Vector3.Distance(startWorld, playerPosition);
}

    
private static void SetPipeLinePoints(IOEntity from, int outputSlot, IOEntity to, int inputSlot)
{
    if (from == null || to == null) return;
    if (from.ioType != IOEntity.IOType.Industrial || to.ioType != IOEntity.IOType.Industrial) return;
    var slot = from.outputs[outputSlot];

    var startWorld = from.transform.TransformPoint(slot.handlePosition);
    var endWorld = to.transform.TransformPoint(to.inputs[inputSlot].handlePosition);

    // Ground height under the two sockets
    var groundYStart = TerrainMeta.HeightMap.GetHeight(startWorld);
    var groundYEnd = TerrainMeta.HeightMap.GetHeight(endWorld);

    // Ground point under the start socket
    var groundStart = new Vector3(startWorld.x, groundYStart, startWorld.z);

    // Ground point under the end socket
    var groundEnd = new Vector3(endWorld.x, groundYEnd, endWorld.z);

    // All points in 'from' local space
    slot.linePoints = new[]
    {
        from.transform.InverseTransformPoint(startWorld), // [0] socket output
        //from.transform.InverseTransformPoint(groundStart), // [1] goes down to ground under 'from'
        //from.transform.InverseTransformPoint(groundEnd), // [2] travels along the ground to 'to'
        from.transform.InverseTransformPoint(endWorld), // [3] goes up to the input socket
    };
}

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.7m
Total downloads
Customers
11.6k
Customers served
Files Sold
165.5k
Total sales
Payments
3.6m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.