From e2eb4c6db3f54b9247e583724883f0338de9f7c3 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 29 Jan 2017 11:41:02 -0700 Subject: [PATCH] add settings for rope lengths --- init.lua | 14 ++++++++++++-- settingtypes.txt | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 settingtypes.txt diff --git a/init.lua b/init.lua index b2c5a94..e5a7a4c 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,19 @@ vines = { name = 'vines', - ropeLadderLength = 50, - ropeLength = 50, } +local rope_length = minetest.setting_get("vines_rope_length") +if not rope_length then + rope_length = 50 +end +vines.ropeLength = rope_length + +local rope_ladder_length = minetest.setting_get("vines_rope_ladder_length") +if not rope_ladder_length then + rope_ladder_length = 50 +end +vines.ropeLadderLength = rope_ladder_length + dofile( minetest.get_modpath( vines.name ) .. "/functions.lua" ) dofile( minetest.get_modpath( vines.name ) .. "/aliases.lua" ) dofile( minetest.get_modpath( vines.name ) .. "/crafts.lua" ) diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..9e267c1 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,8 @@ +#The shortest rope will extend for this many meters. Longer ropes come in +#multiples of this length. +#Changing this value will not affect ropes that already exist in-world. +vines_rope_length (Rope length) int 50 1 30000 + +#Rope ladders will extend this far at maximum. +#Changing this value will not affect rope ladders that already exist in-world. +vines_rope_ladder_length (Rope ladder length) int 50 1 30000