From 6a0186f0424d1aad8a43029aebceffb6081b6822 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sun, 6 Nov 2016 23:21:03 +0100 Subject: integrate mbb's new train models and correct some wagon_spans, wagon/engine scalings and file names issue with collisions needs to be fixed. --- models/advtrains_engine_industrial.b3d | Bin 0 -> 143659 bytes models/advtrains_engine_japan.b3d | Bin 165233 -> 165287 bytes models/advtrains_wagon.b3d | Bin 0 -> 107352 bytes models/advtrains_wagon_japan.b3d | Bin 172028 -> 171991 bytes models/advtrains_wagon_tank.b3d | Bin 0 -> 223975 bytes models/advtrains_wagon_wood.b3d | Bin 0 -> 193975 bytes models/blender/industrial/industry_loc.blend | Bin 0 -> 652640 bytes models/blender/industrial/industry_loc.blend1 | Bin 0 -> 652640 bytes models/blender/industrial/industry_loc.blend11 | Bin 0 -> 659096 bytes .../blender/industrial/industry_oil_ wagong.blend | Bin 0 -> 693488 bytes .../blender/industrial/industry_oil_ wagong.blend1 | Bin 0 -> 693488 bytes .../blender/industrial/industry_tree_wagong.blend | Bin 0 -> 640056 bytes .../blender/industrial/industry_tree_wagong.blend1 | Bin 0 -> 640056 bytes models/blender/industrial/industry_tree_wagong.png | Bin 0 -> 316 bytes models/blender/mbb/modern_japanlocomotive.blend | Bin 715116 -> 715116 bytes models/blender/mbb/modern_japanlocomotive.blend1 | Bin 568696 -> 715116 bytes models/wagon.b3d | Bin 107352 -> 0 bytes textures/advtrains_engine_industrial.png | Bin 0 -> 59019 bytes textures/advtrains_engine_industrial_inv.png | Bin 0 -> 381 bytes textures/advtrains_wagon_box_inv.png | Bin 0 -> 347 bytes textures/advtrains_wagon_tank.png | Bin 0 -> 8975 bytes textures/advtrains_wagon_tank_inv.png | Bin 0 -> 408 bytes textures/advtrains_wagon_wood.png | Bin 0 -> 5974 bytes textures/advtrains_wagon_wood_inv.png | Bin 0 -> 316 bytes trainlogic.lua | 8 +- wagons.lua | 88 ++++++++++++++++----- 26 files changed, 74 insertions(+), 22 deletions(-) create mode 100644 models/advtrains_engine_industrial.b3d create mode 100644 models/advtrains_wagon.b3d create mode 100644 models/advtrains_wagon_tank.b3d create mode 100644 models/advtrains_wagon_wood.b3d create mode 100644 models/blender/industrial/industry_loc.blend create mode 100644 models/blender/industrial/industry_loc.blend1 create mode 100644 models/blender/industrial/industry_loc.blend11 create mode 100644 models/blender/industrial/industry_oil_ wagong.blend create mode 100644 models/blender/industrial/industry_oil_ wagong.blend1 create mode 100644 models/blender/industrial/industry_tree_wagong.blend create mode 100644 models/blender/industrial/industry_tree_wagong.blend1 create mode 100644 models/blender/industrial/industry_tree_wagong.png delete mode 100644 models/wagon.b3d create mode 100644 textures/advtrains_engine_industrial.png create mode 100644 textures/advtrains_engine_industrial_inv.png create mode 100644 textures/advtrains_wagon_box_inv.png create mode 100644 textures/advtrains_wagon_tank.png create mode 100644 textures/advtrains_wagon_tank_inv.png create mode 100644 textures/advtrains_wagon_wood.png create mode 100644 textures/advtrains_wagon_wood_inv.png diff --git a/models/advtrains_engine_industrial.b3d b/models/advtrains_engine_industrial.b3d new file mode 100644 index 0000000..071da18 Binary files /dev/null and b/models/advtrains_engine_industrial.b3d differ diff --git a/models/advtrains_engine_japan.b3d b/models/advtrains_engine_japan.b3d index 5b97349..a925b42 100644 Binary files a/models/advtrains_engine_japan.b3d and b/models/advtrains_engine_japan.b3d differ diff --git a/models/advtrains_wagon.b3d b/models/advtrains_wagon.b3d new file mode 100644 index 0000000..5c8214c Binary files /dev/null and b/models/advtrains_wagon.b3d differ diff --git a/models/advtrains_wagon_japan.b3d b/models/advtrains_wagon_japan.b3d index 9e5ac52..7970438 100644 Binary files a/models/advtrains_wagon_japan.b3d and b/models/advtrains_wagon_japan.b3d differ diff --git a/models/advtrains_wagon_tank.b3d b/models/advtrains_wagon_tank.b3d new file mode 100644 index 0000000..af2604b Binary files /dev/null and b/models/advtrains_wagon_tank.b3d differ diff --git a/models/advtrains_wagon_wood.b3d b/models/advtrains_wagon_wood.b3d new file mode 100644 index 0000000..0e7fb4b Binary files /dev/null and b/models/advtrains_wagon_wood.b3d differ diff --git a/models/blender/industrial/industry_loc.blend b/models/blender/industrial/industry_loc.blend new file mode 100644 index 0000000..af54c3f Binary files /dev/null and b/models/blender/industrial/industry_loc.blend differ diff --git a/models/blender/industrial/industry_loc.blend1 b/models/blender/industrial/industry_loc.blend1 new file mode 100644 index 0000000..a694c88 Binary files /dev/null and b/models/blender/industrial/industry_loc.blend1 differ diff --git a/models/blender/industrial/industry_loc.blend11 b/models/blender/industrial/industry_loc.blend11 new file mode 100644 index 0000000..a089a65 Binary files /dev/null and b/models/blender/industrial/industry_loc.blend11 differ diff --git a/models/blender/industrial/industry_oil_ wagong.blend b/models/blender/industrial/industry_oil_ wagong.blend new file mode 100644 index 0000000..30bde51 Binary files /dev/null and b/models/blender/industrial/industry_oil_ wagong.blend differ diff --git a/models/blender/industrial/industry_oil_ wagong.blend1 b/models/blender/industrial/industry_oil_ wagong.blend1 new file mode 100644 index 0000000..849971d Binary files /dev/null and b/models/blender/industrial/industry_oil_ wagong.blend1 differ diff --git a/models/blender/industrial/industry_tree_wagong.blend b/models/blender/industrial/industry_tree_wagong.blend new file mode 100644 index 0000000..23de208 Binary files /dev/null and b/models/blender/industrial/industry_tree_wagong.blend differ diff --git a/models/blender/industrial/industry_tree_wagong.blend1 b/models/blender/industrial/industry_tree_wagong.blend1 new file mode 100644 index 0000000..bf2c9ed Binary files /dev/null and b/models/blender/industrial/industry_tree_wagong.blend1 differ diff --git a/models/blender/industrial/industry_tree_wagong.png b/models/blender/industrial/industry_tree_wagong.png new file mode 100644 index 0000000..87109dd Binary files /dev/null and b/models/blender/industrial/industry_tree_wagong.png differ diff --git a/models/blender/mbb/modern_japanlocomotive.blend b/models/blender/mbb/modern_japanlocomotive.blend index f0b2714..a2e745d 100644 Binary files a/models/blender/mbb/modern_japanlocomotive.blend and b/models/blender/mbb/modern_japanlocomotive.blend differ diff --git a/models/blender/mbb/modern_japanlocomotive.blend1 b/models/blender/mbb/modern_japanlocomotive.blend1 index 4f75626..f0b2714 100644 Binary files a/models/blender/mbb/modern_japanlocomotive.blend1 and b/models/blender/mbb/modern_japanlocomotive.blend1 differ diff --git a/models/wagon.b3d b/models/wagon.b3d deleted file mode 100644 index 5c8214c..0000000 Binary files a/models/wagon.b3d and /dev/null differ diff --git a/textures/advtrains_engine_industrial.png b/textures/advtrains_engine_industrial.png new file mode 100644 index 0000000..38a872f Binary files /dev/null and b/textures/advtrains_engine_industrial.png differ diff --git a/textures/advtrains_engine_industrial_inv.png b/textures/advtrains_engine_industrial_inv.png new file mode 100644 index 0000000..be4e80f Binary files /dev/null and b/textures/advtrains_engine_industrial_inv.png differ diff --git a/textures/advtrains_wagon_box_inv.png b/textures/advtrains_wagon_box_inv.png new file mode 100644 index 0000000..480f245 Binary files /dev/null and b/textures/advtrains_wagon_box_inv.png differ diff --git a/textures/advtrains_wagon_tank.png b/textures/advtrains_wagon_tank.png new file mode 100644 index 0000000..79b1316 Binary files /dev/null and b/textures/advtrains_wagon_tank.png differ diff --git a/textures/advtrains_wagon_tank_inv.png b/textures/advtrains_wagon_tank_inv.png new file mode 100644 index 0000000..03401be Binary files /dev/null and b/textures/advtrains_wagon_tank_inv.png differ diff --git a/textures/advtrains_wagon_wood.png b/textures/advtrains_wagon_wood.png new file mode 100644 index 0000000..acc6f72 Binary files /dev/null and b/textures/advtrains_wagon_wood.png differ diff --git a/textures/advtrains_wagon_wood_inv.png b/textures/advtrains_wagon_wood_inv.png new file mode 100644 index 0000000..87109dd Binary files /dev/null and b/textures/advtrains_wagon_wood_inv.png differ diff --git a/trainlogic.lua b/trainlogic.lua index 5db366e..37d7b86 100644 --- a/trainlogic.lua +++ b/trainlogic.lua @@ -325,11 +325,12 @@ function advtrains.train_step(id, train, dtime) end --move + --TODO 3,5 + 0.7 train.index=train.index and train.index+((train.velocity/(train.path_dist[math.floor(train.index)] or 1))*dtime) or 0 end ---the 'leader' concept has been overthrown, we won't rely on MT's "buggy object management" + --structure of train table: --[[ trains={ @@ -501,6 +502,7 @@ function advtrains.add_wagon_to_train(wagon, train_id, index) --this is not the usual case!!! --we may set initialized because the wagon has no chance to step() wagon.initialized=true + --TODO is this art or can we throw it away? advtrains.update_trainpart_properties(train_id) end function advtrains.update_trainpart_properties(train_id, invert_flipstate) @@ -788,6 +790,10 @@ end local nonblocknodes={ "default:fence_wood", + "default:fence_acacia_wood", + "default:fence_aspen_wood", + "default:fence_pine_wood", + "default:fence_junglewood", "default:torch", "default:sign_wall", diff --git a/wagons.lua b/wagons.lua index aff443e..398f42d 100644 --- a/wagons.lua +++ b/wagons.lua @@ -625,7 +625,7 @@ advtrains.register_wagon("newlocomotive", "steam",{ drops={"default:steelblock 4"}, }, "Steam Engine", "advtrains_newlocomotive_inv.png") advtrains.register_wagon("wagon_default", "steam",{ - mesh="wagon.b3d", + mesh="advtrains_wagon.b3d", textures = {"advtrains_wagon.png"}, seats = { { @@ -640,7 +640,7 @@ advtrains.register_wagon("wagon_default", "steam",{ drops={"default:steelblock 4"}, }, "Passenger Wagon", "advtrains_wagon_inv.png") advtrains.register_wagon("wagon_box", "steam",{ - mesh="wagon.b3d", + mesh="advtrains_wagon.b3d", textures = {"advtrains_wagon_box.png"}, seats = {}, visual_size = {x=1, y=1}, @@ -657,7 +657,7 @@ advtrains.register_wagon("wagon_box", "steam",{ inventory_list_sizes = { box=8*6, }, -}, "Box Wagon", "advtrains_wagon_inv.png") +}, "Box Wagon", "advtrains_wagon_box_inv.png") advtrains.register_train_type("electric", {"regular", "default"}, 20) @@ -673,7 +673,7 @@ advtrains.register_wagon("engine_japan", "electric",{ }, }, visual_size = {x=1, y=1}, - wagon_span=2, + wagon_span=2.4, is_locomotive=true, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, drops={"default:steelblock 4"}, @@ -690,11 +690,72 @@ advtrains.register_wagon("wagon_japan", "electric",{ }, }, visual_size = {x=1, y=1}, - wagon_span=2, + wagon_span=2.4, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, drops={"default:steelblock 4"}, }, "Japanese Train Wagon", "blue.png") +advtrains.register_wagon("engine_industrial", "electric",{ + mesh="advtrains_engine_industrial.b3d", + textures = {"advtrains_engine_industrial.png"}, + seats = { + { + name="Driver Stand (left)", + attach_offset={x=-5, y=10, z=-10}, + view_offset={x=0, y=10, z=0}, + driving_ctrl_access=true, + }, + { + name="Driver Stand (right)", + attach_offset={x=5, y=10, z=-10}, + view_offset={x=0, y=10, z=0}, + driving_ctrl_access=true, + }, + }, + visual_size = {x=1, y=1}, + wagon_span=2.6, + is_locomotive=true, + collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, + drops={"default:steelblock 4"}, +}, "Industrial Train Engine", "advtrains_engine_industrial_inv.png") +advtrains.register_wagon("wagon_tank", "electric",{ + mesh="advtrains_wagon_tank.b3d", + textures = {"advtrains_wagon_tank.png"}, + seats = {}, + visual_size = {x=1, y=1}, + wagon_span=1.8, + collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, + drops={"default:steelblock 4"}, + has_inventory = true, + get_inventory_formspec = function(self) + return "size[8,11]".. + "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. + "list[current_player;main;0,7;8,4;]".. + "listring[]" + end, + inventory_list_sizes = { + box=8*6, + }, +}, "Industrial tank wagon", "advtrains_wagon_tank_inv.png") +advtrains.register_wagon("wagon_wood", "electric",{ + mesh="advtrains_wagon_wood.b3d", + textures = {"advtrains_wagon_wood.png"}, + seats = {}, + visual_size = {x=1, y=1}, + wagon_span=1.8, + collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, + drops={"default:steelblock 4"}, + has_inventory = true, + get_inventory_formspec = function(self) + return "size[8,11]".. + "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. + "list[current_player;main;0,7;8,4;]".. + "listring[]" + end, + inventory_list_sizes = { + box=8*6, + }, +}, "Industrial wood wagon", "advtrains_wagon_wood_inv.png") advtrains.register_train_type("subway", {"default"}, 15) @@ -715,21 +776,6 @@ advtrains.register_wagon("subway_wagon", "subway",{ is_locomotive=true, drops={"default:steelblock 4"}, }, "Subway Passenger Wagon", "advtrains_subway_train_inv.png") ---[[ -advtrains.register_wagon("wagontype1",{on_rightclick=function(self, clicker) - if clicker:get_player_control().sneak then - advtrains.disconnect_train_before_wagon(self) - return - end - --just debugging. look for first active wagon and attach to it. - for _,v in pairs(minetest.luaentities) do - if v.is_wagon and v.unique_id and v.unique_id~=self.unique_id then - self.train_id=v.unique_id - end - end - if not self.train_id then minetest.chat_send_all("not found") return end - minetest.chat_send_all(self.train_id.." found and attached.") -end}) -]] + -- cgit v1.2.3