Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug-Report] Full heating oil tank only gets converted to heat tank when placed manually #70

Open
yaSebastian opened this issue Nov 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@yaSebastian
Copy link
Contributor

yaSebastian commented Nov 10, 2024

Bug Report

  • Old graphite fuel setting not enabled.
Old Bug Report

Describe the bug

A full heating oil tank only gets converted when it was placed by hand, not by a robot.

How to reproduce

Place a heating oil tank via a robot, let it fill, then place them manually and let them fill.
You can convert many manually placed tanks into heating tanks over a long period of time while the first one, placed by a robot never gets converted.

Your Idea on how to fix it

None so far. Maybe there are different events that need to be hooked for different ways of playing entities.

Having spent some more time playing, I think my initial impression was wrong, so here's another attempt:

Describe the bug

A full heating oil tank regularly does not get converted just by waiting.
Often, placing an empty tank close to a full tank (1 tile gap) without connecting them converts the full tanks right away.

How to reproduce

Place a heating oil tank manually or via a robot, let it fill and wait. Sometimes/Often, it does not converted, no matter how long I wait.
Placing an empty tank next to it converts the tanks right away.

Your Idea on how to fix it

Unfortunately not. I have the vague impression that the chances for non-conversion increase with the amount of tanks or the size of the connected fluid system.

@yaSebastian yaSebastian added the bug Something isn't working label Nov 10, 2024
@Xman1109
Copy link
Owner

Some time ago the script was triggered every few seconds, but that was to UPS-Intensive, so now its just triggered every time a player places something on the ground.

I don't have a nicer way of doing this without impacting the UPS too much, if you have found a better way, then let me know.

@yaSebastian
Copy link
Contributor Author

Issue

Thanks for explaining; it aligns better with my understanding now.

However, there’s still an issue: Sometimes fully filled tanks don’t convert, and I haven’t found a reliable way to trigger the conversion. In the example below, adding a pipe at the bottom (marked by a 1x1 stone brick tile) caused the top-left tank to convert. However, I couldn’t get the other tanks to convert, even after removing or rebuilding parts and moving the fluid around.

image

Concept Enhancement and Suggestions

I love the idea of filling tanks in-world. With a reliable conversion method, I think your concept could be expanded further.

Immediate Suggestion

Since we can freely build and dismantle the heat tank once converted, a recipe-based approach might work well here. For instance, creating a recipe that requires 25k of heat oil and an empty heat oil tank.

Potential Fix

  • Set up a global array for heat oil tanks.
  • When a heat oil tank is built, add it to this array.
  • Check this array every few seconds (say, every 5 seconds).
  • Full tanks would convert automatically and be removed from the array.

This approach could also allow the mined heat tank to yield an empty heat oil tank. The only caveat here is that the heat oil would be lost on mining.

Since this array is usually empty, checking it every few seconds or even just every minute shouldn’t impact UPS much.

Concept Improvements

To take the idea further, here’s how the concept could evolve:

The heat tank:

  • Looks and behaves exactly like the heat oil tank.
  • Is inaccessible to players directly.
  • Has a heat interface in addition to the fluid box.

Scripting:

  • Two global array for heat oil tanks and heat tanks.
  • When a heat oil tank is built, it’s added to the heat oil tank array.
  • The heat oil tank array is checked periodically; full heat oil tanks are then:
    • Removed from the array and the game world.
    • Replaced with a heat tank that gets stored in the heat tank array.
    • If possible, 8 heat pipes could be added below the heat tank (currently, it does not look as if it connects to a heat pipe).
  • The heat tank array is checked periodically:
    • If a heat tank isn’t full, it reverts back to a heat oil tank.
  • Tanks removed, mined, or destroyed are removed from their respective arrays.

Additional Note

A friend and I implemented a similar feature in Nullius a few years back, where we added a hidden accumulator to each power pole as it was built and removed it when mined. If you’d like, I can try to find the code or rewrite it.

Let me know if this works or if you’d like any further adjustments!

@Xman1109
Copy link
Owner

Thats a pretty solid idea, I'll definitely take a look at what's possible and how to improve the already existing system.

If you want them you can help me via PR's, because you seem to have more experience in modding than me ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants