aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-09-12 13:02:14 +0200
committerorwell96 <mono96.mml@gmail.com>2016-09-12 13:02:14 +0200
commit0343b7680aa3fa7bc81e2dc7c76ca43c9c27a559 (patch)
tree4ae9c8b0908f9e4744a079fa4d0c7698c134d343
parentd49c30643110a0384d8a506ef21dd39c007cd18b (diff)
downloadadvtrains-0343b7680aa3fa7bc81e2dc7c76ca43c9c27a559.tar.gz
advtrains-0343b7680aa3fa7bc81e2dc7c76ca43c9c27a559.tar.bz2
advtrains-0343b7680aa3fa7bc81e2dc7c76ca43c9c27a559.zip
add bumpers
-rw-r--r--models/advtrains_dtrack_bumper.b3dbin0 -> 32927 bytes
-rw-r--r--models/advtrains_dtrack_bumper_30.b3dbin0 -> 48546 bytes
-rw-r--r--models/advtrains_dtrack_bumper_45.b3dbin0 -> 32926 bytes
-rw-r--r--models/advtrains_dtrack_bumper_60.b3dbin0 -> 48546 bytes
-rw-r--r--models/blender/mbb/modern_locomotive.blendbin0 -> 732124 bytes
-rw-r--r--models/blender/mbb/modern_wagong.blendbin0 -> 694664 bytes
-rw-r--r--models/blender/mbb/prellbock.blendbin0 -> 745176 bytes
-rw-r--r--models/blender/mbb/prellbock.blend1bin0 -> 485416 bytes
-rw-r--r--models/blender/mbb/prellbock.uv.pngbin0 -> 4034 bytes
-rw-r--r--models/blender/mbb/regio-lokomotive.blendbin0 -> 704160 bytes
-rw-r--r--models/blender/mbb/regio-waron.blendbin0 -> 545620 bytes
-rw-r--r--models/blender/mbb/signal(2)_hoch.blendbin0 -> 472092 bytes
-rw-r--r--models/blender/mbb/signal(2)_unten.blendbin0 -> 472092 bytes
-rw-r--r--models/blender/mbb/signal.blendbin0 -> 485524 bytes
-rw-r--r--models/blender/mbb/weichenhebel1.blendbin0 -> 493028 bytes
-rw-r--r--models/blender/mbb/weichenhebel2.blendbin0 -> 492996 bytes
-rw-r--r--textures/advtrains_dtrack_rail.pngbin2616 -> 2810 bytes
-rw-r--r--tracks.lua76
18 files changed, 75 insertions, 1 deletions
diff --git a/models/advtrains_dtrack_bumper.b3d b/models/advtrains_dtrack_bumper.b3d
new file mode 100644
index 0000000..a6d9745
--- /dev/null
+++ b/models/advtrains_dtrack_bumper.b3d
Binary files differ
diff --git a/models/advtrains_dtrack_bumper_30.b3d b/models/advtrains_dtrack_bumper_30.b3d
new file mode 100644
index 0000000..5f5b3f4
--- /dev/null
+++ b/models/advtrains_dtrack_bumper_30.b3d
Binary files differ
diff --git a/models/advtrains_dtrack_bumper_45.b3d b/models/advtrains_dtrack_bumper_45.b3d
new file mode 100644
index 0000000..f13ae75
--- /dev/null
+++ b/models/advtrains_dtrack_bumper_45.b3d
Binary files differ
diff --git a/models/advtrains_dtrack_bumper_60.b3d b/models/advtrains_dtrack_bumper_60.b3d
new file mode 100644
index 0000000..59a2285
--- /dev/null
+++ b/models/advtrains_dtrack_bumper_60.b3d
Binary files differ
diff --git a/models/blender/mbb/modern_locomotive.blend b/models/blender/mbb/modern_locomotive.blend
new file mode 100644
index 0000000..8e72233
--- /dev/null
+++ b/models/blender/mbb/modern_locomotive.blend
Binary files differ
diff --git a/models/blender/mbb/modern_wagong.blend b/models/blender/mbb/modern_wagong.blend
new file mode 100644
index 0000000..d85e841
--- /dev/null
+++ b/models/blender/mbb/modern_wagong.blend
Binary files differ
diff --git a/models/blender/mbb/prellbock.blend b/models/blender/mbb/prellbock.blend
new file mode 100644
index 0000000..1c20ab2
--- /dev/null
+++ b/models/blender/mbb/prellbock.blend
Binary files differ
diff --git a/models/blender/mbb/prellbock.blend1 b/models/blender/mbb/prellbock.blend1
new file mode 100644
index 0000000..981538e
--- /dev/null
+++ b/models/blender/mbb/prellbock.blend1
Binary files differ
diff --git a/models/blender/mbb/prellbock.uv.png b/models/blender/mbb/prellbock.uv.png
new file mode 100644
index 0000000..7730753
--- /dev/null
+++ b/models/blender/mbb/prellbock.uv.png
Binary files differ
diff --git a/models/blender/mbb/regio-lokomotive.blend b/models/blender/mbb/regio-lokomotive.blend
new file mode 100644
index 0000000..210e60e
--- /dev/null
+++ b/models/blender/mbb/regio-lokomotive.blend
Binary files differ
diff --git a/models/blender/mbb/regio-waron.blend b/models/blender/mbb/regio-waron.blend
new file mode 100644
index 0000000..19b07ce
--- /dev/null
+++ b/models/blender/mbb/regio-waron.blend
Binary files differ
diff --git a/models/blender/mbb/signal(2)_hoch.blend b/models/blender/mbb/signal(2)_hoch.blend
new file mode 100644
index 0000000..70391f6
--- /dev/null
+++ b/models/blender/mbb/signal(2)_hoch.blend
Binary files differ
diff --git a/models/blender/mbb/signal(2)_unten.blend b/models/blender/mbb/signal(2)_unten.blend
new file mode 100644
index 0000000..4e917bc
--- /dev/null
+++ b/models/blender/mbb/signal(2)_unten.blend
Binary files differ
diff --git a/models/blender/mbb/signal.blend b/models/blender/mbb/signal.blend
new file mode 100644
index 0000000..ae49ab6
--- /dev/null
+++ b/models/blender/mbb/signal.blend
Binary files differ
diff --git a/models/blender/mbb/weichenhebel1.blend b/models/blender/mbb/weichenhebel1.blend
new file mode 100644
index 0000000..70b997d
--- /dev/null
+++ b/models/blender/mbb/weichenhebel1.blend
Binary files differ
diff --git a/models/blender/mbb/weichenhebel2.blend b/models/blender/mbb/weichenhebel2.blend
new file mode 100644
index 0000000..c1c3aac
--- /dev/null
+++ b/models/blender/mbb/weichenhebel2.blend
Binary files differ
diff --git a/textures/advtrains_dtrack_rail.png b/textures/advtrains_dtrack_rail.png
index 8478cf6..5fb0c67 100644
--- a/textures/advtrains_dtrack_rail.png
+++ b/textures/advtrains_dtrack_rail.png
Binary files differ
diff --git a/tracks.lua b/tracks.lua
index d64f6d8..1ed3d6e 100644
--- a/tracks.lua
+++ b/tracks.lua
@@ -81,7 +81,7 @@ local t_30deg={
["swlst"]="swrst",
},
rotation={"", "_30", "_45", "_60"},
- increativeinv={vst1=true, vst2=true}
+ increativeinv={vst1=true, vst2=true},
}
local t_45deg={
regstep=2,
@@ -305,6 +305,80 @@ advtrains.register_tracks("default", {
formats={vst1={true}, vst2={true}},
}, t_30deg)
+--bumpers. temporary registration. later: integrate to register_tracks.
+function advtrains.register_bumpers(tracktype, def, preset)
+ local common_def=advtrains.merge_tables({
+ description = def.description,
+ drawtype = "mesh",
+ paramtype="light",
+ paramtype2="facedir",
+ walkable = false,
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
+ },
+ rely1=0,
+ rely2=0,
+ railheight=0,
+ drop="advtrains:placetrack_"..tracktype,
+ can_dig=function(pos)
+ return not advtrains.is_train_at_pos(pos)
+ end,
+ after_dig_node=function(pos)
+ advtrains.invalidate_all_paths()
+ advtrains.reset_trackdb_position(pos)
+ end,
+ after_place_node=function(pos)
+ advtrains.reset_trackdb_position(pos)
+ end,
+ }, def.common or {})
+ local function cycle_conns(conns, rotid)
+ local add=(rotid-1)*preset.regstep
+ return {
+ conn1=(conns.conn1+add)%16,
+ conn2=(conns.conn2+add)%16,
+ rely1=conns.rely1 or 0,
+ rely2=conns.rely2 or 0,
+ railheight=conns.railheight or 0,
+ }
+ end
+ for rotid, rotation in ipairs(preset.rotation) do
+ local img_suffix="bumper"..rotation
+ minetest.register_node(def.nodename_prefix.."_".."bumper"..rotation, advtrains.merge_tables(
+ common_def,
+ {
+ mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix),
+ tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png")},
+ --inventory_image = def.texture_prefix.."_"..img_suffix..".png",
+ --wield_image = def.texture_prefix.."_"..img_suffix..".png",
+ description=def.description.."(".."bumper"..rotation..")",
+ on_rightclick=switchfunc,
+ groups = {
+ attached_node=1,
+ --["advtrains_track_"..tracktype]=1, not a rail...
+ dig_immediate=2,
+ },
+ }
+ ))
+
+ advtrains.trackplacer.add_single_conn(def.nodename_prefix, "bumper", rotation, cycle_conns({conn1=0, conn2=8}, rotid))
+ advtrains.trackplacer.add_worked(def.nodename_prefix, "bumper", rotation, preset.trackworker[suffix])
+ end
+end
+
+advtrains.register_bumpers("default", {
+ nodename_prefix="advtrains:dtrack",
+ texture_prefix="advtrains_dtrack",
+ models_prefix="advtrains_dtrack",
+ models_suffix=".b3d",
+ shared_texture="advtrains_dtrack_rail.png",
+ description="New Default Train Track",
+ formats={vst1={true}, vst2={true}},
+}, t_30deg)
+
+
+
+
--TODO legacy
--I know lbms are better for this purpose
for name,rep in pairs({swl_st="swlst", swr_st="swrst", swl_cr="swlcr", swr_cr="swrcr", }) do