From 0343b7680aa3fa7bc81e2dc7c76ca43c9c27a559 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 12 Sep 2016 13:02:14 +0200 Subject: add bumpers --- models/advtrains_dtrack_bumper.b3d | Bin 0 -> 32927 bytes models/advtrains_dtrack_bumper_30.b3d | Bin 0 -> 48546 bytes models/advtrains_dtrack_bumper_45.b3d | Bin 0 -> 32926 bytes models/advtrains_dtrack_bumper_60.b3d | Bin 0 -> 48546 bytes models/blender/mbb/modern_locomotive.blend | Bin 0 -> 732124 bytes models/blender/mbb/modern_wagong.blend | Bin 0 -> 694664 bytes models/blender/mbb/prellbock.blend | Bin 0 -> 745176 bytes models/blender/mbb/prellbock.blend1 | Bin 0 -> 485416 bytes models/blender/mbb/prellbock.uv.png | Bin 0 -> 4034 bytes models/blender/mbb/regio-lokomotive.blend | Bin 0 -> 704160 bytes models/blender/mbb/regio-waron.blend | Bin 0 -> 545620 bytes models/blender/mbb/signal(2)_hoch.blend | Bin 0 -> 472092 bytes models/blender/mbb/signal(2)_unten.blend | Bin 0 -> 472092 bytes models/blender/mbb/signal.blend | Bin 0 -> 485524 bytes models/blender/mbb/weichenhebel1.blend | Bin 0 -> 493028 bytes models/blender/mbb/weichenhebel2.blend | Bin 0 -> 492996 bytes textures/advtrains_dtrack_rail.png | Bin 2616 -> 2810 bytes tracks.lua | 76 ++++++++++++++++++++++++++++- 18 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 models/advtrains_dtrack_bumper.b3d create mode 100644 models/advtrains_dtrack_bumper_30.b3d create mode 100644 models/advtrains_dtrack_bumper_45.b3d create mode 100644 models/advtrains_dtrack_bumper_60.b3d create mode 100644 models/blender/mbb/modern_locomotive.blend create mode 100644 models/blender/mbb/modern_wagong.blend create mode 100644 models/blender/mbb/prellbock.blend create mode 100644 models/blender/mbb/prellbock.blend1 create mode 100644 models/blender/mbb/prellbock.uv.png create mode 100644 models/blender/mbb/regio-lokomotive.blend create mode 100644 models/blender/mbb/regio-waron.blend create mode 100644 models/blender/mbb/signal(2)_hoch.blend create mode 100644 models/blender/mbb/signal(2)_unten.blend create mode 100644 models/blender/mbb/signal.blend create mode 100644 models/blender/mbb/weichenhebel1.blend create mode 100644 models/blender/mbb/weichenhebel2.blend diff --git a/models/advtrains_dtrack_bumper.b3d b/models/advtrains_dtrack_bumper.b3d new file mode 100644 index 0000000..a6d9745 Binary files /dev/null and b/models/advtrains_dtrack_bumper.b3d differ diff --git a/models/advtrains_dtrack_bumper_30.b3d b/models/advtrains_dtrack_bumper_30.b3d new file mode 100644 index 0000000..5f5b3f4 Binary files /dev/null and b/models/advtrains_dtrack_bumper_30.b3d differ diff --git a/models/advtrains_dtrack_bumper_45.b3d b/models/advtrains_dtrack_bumper_45.b3d new file mode 100644 index 0000000..f13ae75 Binary files /dev/null and b/models/advtrains_dtrack_bumper_45.b3d differ diff --git a/models/advtrains_dtrack_bumper_60.b3d b/models/advtrains_dtrack_bumper_60.b3d new file mode 100644 index 0000000..59a2285 Binary files /dev/null and b/models/advtrains_dtrack_bumper_60.b3d differ diff --git a/models/blender/mbb/modern_locomotive.blend b/models/blender/mbb/modern_locomotive.blend new file mode 100644 index 0000000..8e72233 Binary files /dev/null and b/models/blender/mbb/modern_locomotive.blend differ diff --git a/models/blender/mbb/modern_wagong.blend b/models/blender/mbb/modern_wagong.blend new file mode 100644 index 0000000..d85e841 Binary files /dev/null and b/models/blender/mbb/modern_wagong.blend differ diff --git a/models/blender/mbb/prellbock.blend b/models/blender/mbb/prellbock.blend new file mode 100644 index 0000000..1c20ab2 Binary files /dev/null and b/models/blender/mbb/prellbock.blend differ diff --git a/models/blender/mbb/prellbock.blend1 b/models/blender/mbb/prellbock.blend1 new file mode 100644 index 0000000..981538e Binary files /dev/null and b/models/blender/mbb/prellbock.blend1 differ diff --git a/models/blender/mbb/prellbock.uv.png b/models/blender/mbb/prellbock.uv.png new file mode 100644 index 0000000..7730753 Binary files /dev/null and b/models/blender/mbb/prellbock.uv.png differ diff --git a/models/blender/mbb/regio-lokomotive.blend b/models/blender/mbb/regio-lokomotive.blend new file mode 100644 index 0000000..210e60e Binary files /dev/null and b/models/blender/mbb/regio-lokomotive.blend differ diff --git a/models/blender/mbb/regio-waron.blend b/models/blender/mbb/regio-waron.blend new file mode 100644 index 0000000..19b07ce Binary files /dev/null and b/models/blender/mbb/regio-waron.blend 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 Binary files /dev/null and b/models/blender/mbb/signal(2)_hoch.blend 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 Binary files /dev/null and b/models/blender/mbb/signal(2)_unten.blend differ diff --git a/models/blender/mbb/signal.blend b/models/blender/mbb/signal.blend new file mode 100644 index 0000000..ae49ab6 Binary files /dev/null and b/models/blender/mbb/signal.blend differ diff --git a/models/blender/mbb/weichenhebel1.blend b/models/blender/mbb/weichenhebel1.blend new file mode 100644 index 0000000..70b997d Binary files /dev/null and b/models/blender/mbb/weichenhebel1.blend differ diff --git a/models/blender/mbb/weichenhebel2.blend b/models/blender/mbb/weichenhebel2.blend new file mode 100644 index 0000000..c1c3aac Binary files /dev/null and b/models/blender/mbb/weichenhebel2.blend differ diff --git a/textures/advtrains_dtrack_rail.png b/textures/advtrains_dtrack_rail.png index 8478cf6..5fb0c67 100644 Binary files a/textures/advtrains_dtrack_rail.png and b/textures/advtrains_dtrack_rail.png 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 -- cgit v1.2.3