mt-mods / jumpdrive

Minetest jumpdrive mod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specify bounds instead of radius

crabctrl opened this issue · comments

It would be handy to be able to specify the exact area of the ship in XYZ instead of just the radius, as this would allow you to fit oblong ships together or against docking ports much more nicely.

Hmm, i thought there was already an issue open about this... 😕

Yes, this would be nice, the ground-work is already there:

jumpdrive/move.lua

Lines 6 to 8 in a8bf7ad

-- moves the source to the target area
-- no protection- or overlap checking is done here
jumpdrive.move = function(source_pos1, source_pos2, target_pos1, target_pos2)

The api already supports this but the interface is just not there yet...

I wasn't sure if i would mutilatemodify the existing jumpdrive:engine node or create another one with the additional functionality but i guess multiple engines with various shapes would be the sane option here.

Optimally it would look like this:

  • jumpdrive:engine default engine, can jump an area with given radius
  • jumpdrive:engine_custom customized cubic jump-area configurable with 2 coordinates
  • jumpdrive:area_engine can be linked to an area, if the areas mod is available
  • ... others?

The linking with the jumdrive:backbone to a fleet should still be possible then (given there are no overlaps)

commented

Linked issue with few comments about what could be done to make this work nicely, proposed solution requires breaking changes to public functions jumpdrive.execute_jump and jumpdrive.simulate_jump.
Goal for these changes is to make jumpdrive API more generic and allow a lot more use cases while still providing a lot of similar consistency checks and other validation stuff hidden behind API functions.

It is possible to keep backwards compatibility for those but probably not really required, any known mods actually using those 2 functions?

It is possible to keep backwards compatibility for those but probably not really required, any known mods actually using those 2 functions?

I don't think they are used outside the mod, they were never "official" (and there is no documented api 😋)