Jump to content

lafeiyatis

Member
  • Posts

    16
  • Joined

  • Last visited

Everything posted by lafeiyatis

  1. Okay, I'll give it a try. Does your new version fix the storage adapter offset issue for the pump jack's output oil drum?
  2. OK, while I'm not sure if this floating island uses "new rust rock", I think a raycast-based ground detection would be better. The pre-made terrain information is inaccurate or even outdated, and there are also player constructions, terrain decorations, floating islands, and so on up there. I suggest you cast a ray downward to find a walkable surface instead.
  3. 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 }; }
  4. 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.
  5. 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. 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) 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.
  6. I think I didn't explain clearly. I want to be able to install a Storage Adapter on the Mining Quarry so it can transport the mined items out. I also want the Pump Jack to be able to install a Storage Adapter, but it seems you've already implemented that.
  7. Your idea is great, but I have a question — can your mining machine support a Industrial system? If it could automatically export products using a Industrial system, like an oil pumping unit does, that would meet my needs.

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.8m
Total downloads
Customers
11.7k
Customers served
Files Sold
166.7k
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.