diff options
Diffstat (limited to 'boost_cart')
-rw-r--r-- | boost_cart/README.txt | 3 | ||||
-rw-r--r-- | boost_cart/init.lua | 13 | ||||
-rw-r--r-- | boost_cart/settingtypes.txt | 6 |
3 files changed, 19 insertions, 3 deletions
diff --git a/boost_cart/README.txt b/boost_cart/README.txt index 7565ee8..9442926 100644 --- a/boost_cart/README.txt +++ b/boost_cart/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 diff --git a/boost_cart/init.lua b/boost_cart/init.lua index bfae5d9..b9e0c67 100644 --- a/boost_cart/init.lua +++ b/boost_cart/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 diff --git a/boost_cart/settingtypes.txt b/boost_cart/settingtypes.txt new file mode 100644 index 0000000..d64d88a --- /dev/null +++ b/boost_cart/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
\ No newline at end of file |