Patch bike mod so stepheight can be customized
This commit is contained in:
parent
516734e77c
commit
4793e9ad5d
@ -631,7 +631,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[patch.atm]: https://github.com/AntumMT/mod-atm/tree/2ab0e78
|
||||
[patch.away]: https://github.com/AntumMT/mod-away/tree/3b0bf9e
|
||||
[patch.boats2]: https://github.com/AntumMT/mod-boats2/tree/9b2bcb7
|
||||
[patch.bike]: https://gitlab.com/AntumMT/mod-bike/tree/6059134
|
||||
[patch.bike]: https://gitlab.com/AntumMT/mod-bike/tree/68afadd
|
||||
[patch.bridges]: https://github.com/AntumMT/mod-bridges/tree/ba8f71a
|
||||
[patch.castle_weapons]: https://github.com/AntumMT/mod-castle_weapons/tree/6ec6f46
|
||||
[patch.christmas]: https://github.com/AntumMT/mod-christmas/tree/50bda80
|
||||
|
@ -2416,6 +2416,66 @@ torches_enable_ceiling = false
|
||||
## TRANSPORT ##
|
||||
###############
|
||||
|
||||
[*bike]
|
||||
|
||||
## The maximum speed of a bike in m/s
|
||||
# type: float
|
||||
# default: 6.9
|
||||
#bike_max_speed = 6.9
|
||||
|
||||
## The acceleration of a bike in m/s^2
|
||||
# type: float
|
||||
# default: 3.16
|
||||
#bike_acceleration = 3.16
|
||||
|
||||
## The decceleration of a bike caused by braking in m/s^2
|
||||
# type: float
|
||||
# default: 7.9
|
||||
#bike_decceleration = 7.9
|
||||
|
||||
## The decceleration of a bike caused by friciton in m/s^2
|
||||
# type: float
|
||||
# default: 0.79
|
||||
#bike_friction = 0.79
|
||||
|
||||
## The turning speed of a stopped bike in rad/s
|
||||
# type: float
|
||||
# default: 1.58
|
||||
#bike_turn_speed = 1.58
|
||||
|
||||
## The speed in m/s bellow which the bike accelerates linearily
|
||||
# type: float
|
||||
# default: 0.4
|
||||
#bike_friction_cone = 0.4
|
||||
|
||||
## How many nodes can be climbed/jumped
|
||||
# type: float
|
||||
# min: 0
|
||||
# default: 0.6
|
||||
#bike_stepheight = 0.6
|
||||
|
||||
## How many nodes can be climbed/jumped with wheely
|
||||
# type: float
|
||||
# min: 0
|
||||
# default: 0.6
|
||||
#bike_wheely_stepheight = 0.6
|
||||
|
||||
## The factor by which the turning speed is increased by wheely
|
||||
# type: float
|
||||
# default: 2.0
|
||||
#bike_wheely_factor = 2.0
|
||||
|
||||
## The factor by which the bike slows down per second in water
|
||||
# type: float
|
||||
# default: 13.8
|
||||
#bike_water_friction = 13.8
|
||||
|
||||
## The factor by which the bike slows down per second offroad
|
||||
# type: float
|
||||
# default: 1.62
|
||||
#bike_offroad_friction = 1.62
|
||||
|
||||
|
||||
# *** helicopter ***
|
||||
|
||||
## If enabled, places helicopter in inventory instead of destroying it
|
||||
|
@ -13,6 +13,8 @@ local setting_turn_speed = tonumber(minetest.settings:get("bike_turn_speed")) or
|
||||
local setting_friction_cone = tonumber(minetest.settings:get("bike_friction_cone")) or 0.4
|
||||
local agility_factor = 1/math.sqrt(setting_friction_cone)
|
||||
local setting_wheely_factor = tonumber(minetest.settings:get("bike_wheely_factor")) or 2.0
|
||||
local setting_stepheight = tonumber(minetest.settings:get("bike_stepheight")) or 0.6
|
||||
local setting_wheely_stepheight = tonumber(minetest.settings:get("bike_wheely_stepheight")) or 0.6
|
||||
local setting_water_friction = tonumber(minetest.settings:get("bike_water_friction")) or 13.8
|
||||
local setting_offroad_friction = tonumber(minetest.settings:get("bike_offroad_friction")) or 1.62
|
||||
local setting_turn_look = minetest.settings:get_bool("mount_turn_player_look", false) -- general setting for any mount
|
||||
@ -185,7 +187,7 @@ local bike = {
|
||||
visual = "mesh",
|
||||
mesh = "bike.b3d",
|
||||
textures = default_tex("#FFFFFF", 150),
|
||||
stepheight = 0.6,
|
||||
stepheight = setting_stepheight,
|
||||
driver = nil,
|
||||
color = "#FFFFFF",
|
||||
alpha = 150,
|
||||
@ -554,6 +556,14 @@ function bike.on_step(self, dtime)
|
||||
-- Are we doing a wheely?
|
||||
if ctrl.jump then
|
||||
turn_speed = setting_wheely_factor * setting_turn_speed
|
||||
|
||||
if self.stepheight ~= setting_wheely_stepheight then
|
||||
self.object:set_properties({stepheight=setting_wheely_stepheight})
|
||||
self.stepheight = setting_wheely_stepheight
|
||||
end
|
||||
elseif self.stepheight ~= setting_stepheight then
|
||||
self.object:set_properties({stepheight=setting_stepheight})
|
||||
self.stepheight = setting_stepheight
|
||||
end
|
||||
|
||||
-- Turning
|
||||
|
@ -13,9 +13,15 @@ bike_friction (Friction) float 0.79
|
||||
# The turning speed of a stopped bike in rad/s
|
||||
bike_turn_speed (Turn speed) float 1.58
|
||||
|
||||
# The speed in m/s bellow which the bike accelerates linearily
|
||||
# The speed in m/s bellow which the bike accelerates linearily
|
||||
bike_friction_cone (Friction cone) float 0.4
|
||||
|
||||
# How many nodes can be climbed/jumped
|
||||
bike_stepheight (Step height) float 0.6 0
|
||||
|
||||
# How many nodes can be climbed/jumped with wheely
|
||||
bike_wheely_stepheight (Wheely step height) float 0.6 0
|
||||
|
||||
# The factor by which the turning speed is increased by wheely
|
||||
bike_wheely_factor (Wheely factor) float 2.0
|
||||
|
||||
|
@ -359,6 +359,12 @@ bike_turn_speed (Turn speed) float 1.58
|
||||
# The speed in m/s bellow which the bike accelerates linearily
|
||||
bike_friction_cone (Friction cone) float 0.4
|
||||
|
||||
# How many nodes can be climbed/jumped
|
||||
bike_stepheight (Step height) float 0.6 0
|
||||
|
||||
# How many nodes can be climbed/jumped with wheely
|
||||
bike_wheely_stepheight (Wheely step height) float 0.6 0
|
||||
|
||||
# The factor by which the turning speed is increased by wheely
|
||||
bike_wheely_factor (Wheely factor) float 2.0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user