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

Stocking hatch & bus disabling #4013

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RecursivePineapple
Copy link
Contributor

This PR allows you to control whether stocking hatches work with machine controller covers.

From my understanding, here's how stocking hatches work:

When the multi does a recipe check, the stocking hatch will update its available stacks. It does a simulated extraction on the AE system, then stores the resulting stack in an array (right group in the UI), along with its amount (in another array). These arrays match 1:1 with the configured stacks (left group). When a multi scans the hatch, it 'consumes' these fake stacks. At the end of the recipe check, the stocking hatch will determine what was consumed by subtracting the starting counts from the ending counts, then extracting & deleting those stacks from the AE system. If this extraction fails, the stocking hatch shuts down the multi with a critical failure.

My change intercepts the initial simulated extraction. If the hatch is disabled, the hatch will function like the AE system had no matching stacks in it - the multi won't see any stacks and will not consume them in its recipe check. This should be a relatively simple change, but I'd like to test this relatively well in the nightlies first.

Code changes:

  • Add onEnableWorking to MTEs
  • Update justHadNewXYZ in onEnableWorking if recipe checks are expedited
  • Prevent changes in disabled hatches from doing an expedited recipe check (see justUpdated())
  • Clear shadow stacks when the hatch is disabled
  • Add Disabled/Enabled info to status text widget (only shows up when the hatch is online)

Testing done:

  • Hatches work fine when not disabled
  • Disabling hatches prevents shadow stack population visually (via recipe checks & adding new stacks to the configs)
  • Machines don't consume stacks from stocking hatches when the hatches are disabled
  • Expedited recipe checks works properly still
  • Recipe checks aren't expedited when the option is disabled or unavailable
  • Enabling a stocking hatch will immediately cause a recipe check

@RecursivePineapple RecursivePineapple added the enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. label Mar 1, 2025
@RecursivePineapple RecursivePineapple requested review from S4mpsa and a team March 1, 2025 20:05
@Dream-Master Dream-Master added the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta enhancement Improve an existing mechanic. Please explain the change with a before/after comparison.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants