Browse Source

Make the maximal speed configurable using minetest.conf

pull/22/head
SmallJoker 5 years ago
parent
commit
b80d3aed4c
  1. 3
      README.txt
  2. 13
      init.lua
  3. 6
      settingtypes.txt

3
README.txt

@ -7,7 +7,8 @@ Target: Run smoothly as possible even on laggy server
Features
----------
- A fast cart for your railway or roller coaster (up to 10 m/s!)
- A fast cart for your railway or roller coaster
- Easily configurable cart speed using the Advanced Settings
- Boost and brake rails
- By mesecons controlled Start-Stop rails
- Detector rails that send a mesecons signal when the cart drives over them

13
init.lua

@ -2,10 +2,19 @@
boost_cart = {}
boost_cart.modpath = minetest.get_modpath("boost_cart")
-- Settings glue for <= 0.4.15
local setting_getter = minetest.setting_get
if minetest.settings then
setting_getter = function (key)
return minetest.settings:get(key)
end
end
-- Maximal speed of the cart in m/s
boost_cart.speed_max = 10
boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10
-- Set to -1 to disable punching the cart from inside
boost_cart.punch_speed_max = 7
boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7
if not boost_cart.modpath then

6
settingtypes.txt

@ -0,0 +1,6 @@
# Maximal speed of the cart in m/s (min=1, max=100)
boost_cart.speed_max (Maximal speed) int 10 1 100
# Maximal speed to which the driving player can accelerate the cart by punching
# from inside the cart. -1 will disable this feature. (min=-1, max=100)
boost_cart.punch_speed_max (Maximal punch speed) int 7 -1 100
Loading…
Cancel
Save