A simple Jumpdrive for minetest
Take your buildings with you on your journey
- Github: https://github.com/thomasrudin-mt/jumpdrive
- Forum topic: https://forum.minetest.net/viewtopic.php?f=9&t=20073
- Place a 'jumpdrive:engine' into the center of your creation.
- Connect the engine to a technic HV network
- Let the engine charge
- Choose your target coordinates (should be air or ignore blocks)
- Select your cube-radius
- Click "show" and check the green (source) and red (target) destination markers if everything is in range
- Click "jump"
Example setup with technic:
Optional dependencies:
- Mesecon interaction (execute jump on signal)
- Technic rechargeable (HV)
- Travelnet box (gets rewired after jump)
- Elevator (on_place gets called after jump)
- Locator (gets removed and added after each jump)
- Pipeworks teleport tubes (with a patch to pipeworks)
- Beds (thx to @tuedel)
- Ropes (thx to @tuedel)
- Mission-wand as coordinate bookmark (thx to @SwissalpS)
- Compass as coordinate bookmark (thx to @SwissalpS)
- Areas
- Drawers
The engine can be connected to a technic HV network or fuelled with power items. Power items are one of the following
default:mese_crystal_fragment
default:mese_crystal
default:mese
The energy requirements formula looks like this: 10 x radius x distance
For example:
- Distance: 100 blocks
- Radius: 5 blocks
- Required energy: 10 x 5 x 100 = 5000
If the technic
mod is installed the following items can be used in the upgrade slot:
technic:red_energy_crystal
increases power storagetechnic:green_energy_crystal
increases power storagetechnic:blue_energy_crystal
increases power storagetechnic:control_logic_unit
increases power recharge rate
The source and destination areas are checked for protection so you can't remove and jump into someone else's buildings.
Interface:
Example:
You can place empty books into the drive inventory and write the coordinates to them with the "Write to book" button. The "Read from bookmark" button reads the coordinates from the next valid bookmark item in the inventory. From right to left. A used bookmark item is placed in the first free slot from the left. Bookmark items are:
- Written books saved by jumpdrive (or correctly by hand)
- Mission position wands
- Compasses
- See: Digilines
Settings in minetest.conf:
- jumpdrive.max_radius max radius of the jumpdrive (default: 15)
- jumpdrive.max_area_radius max radius of the area jumpdrive (default: 25)
- jumpdrive.powerstorage power storage of the drive (default: 1000000)
- jumpdrive.power_requirement power requirement for charging (default: 2500)
The preflight check can be overriden to execute additional checks:
jumpdrive.preflight_check = function(source, destination, radius, player)
-- check for height limit, only space travel allowed
if destination.y < 1000 then
return { success=false, message="Atmospheric travel not allowed!" }
end
-- everything ok
return { success=true }
end
The default fuel calc can be overwritten by a depending mod:
-- calculates the power requirements for a jump
jumpdrive.calculate_power = function(radius, distance, sourcePos, targetPos)
return 10 * distance * radius
end
Nodes can be made aware of a changing position if they implement a on_movenode
function
on the node-definition:
-- example with an override
minetest.override_item("travelnet:travelnet", {
on_movenode = function(from_pos, to_pos, additional_info)
-- additional_info = { edge = { x=0, y=0, z=0 } }
-- magic!
end
})
additional_info.edge
is the vector to the nearest edge if any
-- register a callback that is called upon jump completion
-- can also be used if the `on_movenode` above needs a kind of "commit" to write the changed state to files
jumpdrive.register_after_jump(function(from_area, to_area)
-- from_area/to_area = { pos1, pos2 }
end)
- jumprive_engine.ogg: https://freesound.org/people/kaboose102/sounds/340257/
- @tuedel
- @SwissalpS
- @Panquesito7
- @OgelGames
- @S-S-X
- Jeremy#2233
- Purple#2916
- Code:
MIT
- Textures
CC BY-SA 4.0
textures/jumpdrive.png
/textures/jumpdrive_backbone.png
/textures/jumpdrive_fleet_controller.png
/textures/jumpdrive_warpdevice.png
- Jeremy#2233 / Purple#2916