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

Refactor MTECable to update MTE without block swap #3826

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

Conversation

mak8427
Copy link
Contributor

@mak8427 mak8427 commented Jan 19, 2025

Tries to address the problem highlighted here:
#3336

to swap just shift+leftclick
By @NotAPenguin0

@serenibyss serenibyss added the enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. label Jan 19, 2025
@Dream-Master Dream-Master requested a review from a team January 19, 2025 19:48
@serenibyss serenibyss added the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label Jan 19, 2025
@mak8427
Copy link
Contributor Author

mak8427 commented Jan 19, 2025

Currently there are some issues:

  • TODO: remove and add the correct Item in the inventory
  • Waila currently doesn't display the correct tooltip
  • Doesn't save the changes in the savegame

@thisHermit
Copy link

You guys are very fast. I am looking forward to contributing in my semester break as well.

At this point, contributing seems more fun than playing 😆

@mak8427
Copy link
Contributor Author

mak8427 commented Jan 20, 2025

So i would like to implement this feature also for the Pipes @serenibyss should i do that?

@serenibyss serenibyss dismissed Lyfts’s stale review January 25, 2025 06:47

Resolved in latest commits

@mak8427
Copy link
Contributor Author

mak8427 commented Jan 25, 2025

The energy net doesn't seem to properly update on swap. Some examples:

* If you are running ZPM voltage in ZPM cables, then swap from ZPM -> LuV cable, the LuV cable will not burn and continue to work as before until the net is forced to recalculate somehow (can place another cable to force it)

* If you upgrade the cable to a higher voltage or amperage, the cable will still burn using the numbers of the previous cable. For example:
  
  * Upgrading LV -> MV, the cable will burn with MV voltage if the source is updated to a new voltage
  * Upgrading 4A -> 16A, the cable will burn with >4A

so i should call an update to the net maybe

@serenibyss
Copy link
Member

so i should call an update to the net maybe

Yeah I think that should be the fix. I'm not sure exactly what that code would look like, but some way to force the net to update is definitely required

@mak8427
Copy link
Contributor Author

mak8427 commented Jan 28, 2025

Todo:

  • recompute nodes in the cables when a part is swapped
  • fix multiplayer server compatibility

@mak8427 mak8427 requested review from serenibyss and Lyfts January 31, 2025 13:59
@miozune
Copy link
Member

miozune commented Feb 1, 2025

Btw now you can safely check control key on server if you want. Example implementation: GTNewHorizons/ae2stuff#27
I'm not sure which way is better for players though.

@serenibyss
Copy link
Member

Attempting to swap a cable in this configuration:
2025-02-01_08 24 14

Gave me this error:
image

Setup:

  • UHV 64A energy hatch on the right
  • Debug Power Generator set to 32EU/t 16A
  • Connections only between the two machines
  • Swapped from 16x Tin Cable -> 1x Red Alloy Cable

@serenibyss
Copy link
Member

Btw now you can safely check control key on server if you want. Example implementation: GTNewHorizons/ae2stuff#27 I'm not sure which way is better for players though.

Honestly I think I prefer shift + lclick here over ctrl + shift + rclick

@mak8427
Copy link
Contributor Author

mak8427 commented Feb 1, 2025

Attempting to swap a cable in this configuration: 2025-02-01_08 24 14

Gave me this error: image

Setup:

* UHV 64A energy hatch on the right

* Debug Power Generator set to 32EU/t 16A

* Connections only between the two machines

* Swapped from 16x Tin Cable -> 1x Red Alloy Cable

This is deliberate i expect that after the cable being swapped it won't connect right away to the machine, you have to reconnect it manually.

@mak8427
Copy link
Contributor Author

mak8427 commented Feb 1, 2025

maybe i should change the output message

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.

6 participants