Mindustry icon indicating copy to clipboard operation
Mindustry copied to clipboard

Logic sensor

Open Redstonneur1256 opened this issue 7 months ago • 4 comments

Add some logic sensors

  • buildX/buildY: The position of the build currently being placed/broken by a unit/build turret
  • building/breaking: On unit & build turret: the current block being placed/broken or null; on blocks being constructed: the type of block being constructed
  • selectedBlock: The current block selected by a player
  • [x] I have read the contribution guidelines.
  • [x] I have ensured that my code compiles, if applicable.
  • [x] I have ensured that any new features in this PR function correctly in-game, if applicable.

Redstonneur1256 avatar May 11 '25 16:05 Redstonneur1256

I would reccomend making buildX and buildY return null instead of -1 when not building (Double.NaN instead of -1)

1ue999 avatar May 11 '25 19:05 1ue999

Would it be better to have building and breaking be exclusive and return the currently placed/broken build or keep it as is with building returning any building from a builder unit and breaking allowing to test if it's being broken?

Redstonneur1256 avatar May 11 '25 20:05 Redstonneur1256

no idea tbh. i would choose the variation where it uses the same thing and then reverses it

1ue999 avatar May 11 '25 21:05 1ue999

also the way its right now kinda feels weird

1ue999 avatar May 11 '25 21:05 1ue999