diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-12-22 18:55:10 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-12-22 18:55:10 +0100 |
commit | 901ea26c7749b999cb0cb78e9b2779b2a42528b9 (patch) | |
tree | 3ab52d9fabe7e6bf8098493f6820682256305fb3 | |
parent | 3de00295d59d91c2a53467584207fa8bedf9a901 (diff) | |
download | basic_trains-901ea26c7749b999cb0cb78e9b2779b2a42528b9.tar.gz basic_trains-901ea26c7749b999cb0cb78e9b2779b2a42528b9.tar.bz2 basic_trains-901ea26c7749b999cb0cb78e9b2779b2a42528b9.zip |
remove train type concept and calculate train's capabilities based on used wagons
-rw-r--r-- | advtrains_train_industrial/init.lua | 12 | ||||
-rw-r--r-- | advtrains_train_japan/init.lua | 8 | ||||
-rw-r--r-- | advtrains_train_steam/init.lua | 18 | ||||
-rw-r--r-- | advtrains_train_subway/init.lua | 4 |
4 files changed, 30 insertions, 12 deletions
diff --git a/advtrains_train_industrial/init.lua b/advtrains_train_industrial/init.lua index 93c75af..379832c 100644 --- a/advtrains_train_industrial/init.lua +++ b/advtrains_train_industrial/init.lua @@ -1,6 +1,8 @@ -advtrains.register_wagon("engine_industrial", "electric",{ +advtrains.register_wagon("engine_industrial", { mesh="advtrains_engine_industrial.b3d", textures = {"advtrains_engine_industrial.png"}, + drives_on={default=true}, + max_speed=20, seats = { { name="Driver Stand (left)", @@ -21,10 +23,12 @@ advtrains.register_wagon("engine_industrial", "electric",{ 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",{ +advtrains.register_wagon("wagon_tank", { mesh="advtrains_wagon_tank.b3d", textures = {"advtrains_wagon_tank.png"}, seats = {}, + drives_on={default=true}, + max_speed=20, visual_size = {x=1, y=1}, wagon_span=2.2, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, @@ -40,10 +44,12 @@ advtrains.register_wagon("wagon_tank", "electric",{ box=8*6, }, }, "Industrial tank wagon", "advtrains_wagon_tank_inv.png") -advtrains.register_wagon("wagon_wood", "electric",{ +advtrains.register_wagon("wagon_wood", { mesh="advtrains_wagon_wood.b3d", textures = {"advtrains_wagon_wood.png"}, seats = {}, + drives_on={default=true}, + max_speed=20, visual_size = {x=1, y=1}, wagon_span=1.8, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, diff --git a/advtrains_train_japan/init.lua b/advtrains_train_japan/init.lua index 7cef69c..47f50cf 100644 --- a/advtrains_train_japan/init.lua +++ b/advtrains_train_japan/init.lua @@ -1,6 +1,8 @@ -advtrains.register_wagon("engine_japan", "electric",{ +advtrains.register_wagon("engine_japan", { mesh="advtrains_engine_japan.b3d", textures = {"advtrains_engine_japan.png"}, + drives_on={default=true}, + max_speed=20, seats = { { name="Default Seat (driver stand)", @@ -16,9 +18,11 @@ advtrains.register_wagon("engine_japan", "electric",{ drops={"default:steelblock 4"}, }, "Japanese Train Engine", "advtrains_engine_japan_inv.png") -advtrains.register_wagon("wagon_japan", "electric",{ +advtrains.register_wagon("wagon_japan", { mesh="advtrains_wagon_japan.b3d", textures = {"advtrains_wagon_japan.png"}, + drives_on={default=true}, + max_speed=20, seats = { { name="Default Seat", diff --git a/advtrains_train_steam/init.lua b/advtrains_train_steam/init.lua index 7b66a51..ca52516 100644 --- a/advtrains_train_steam/init.lua +++ b/advtrains_train_steam/init.lua @@ -1,7 +1,9 @@ -advtrains.register_wagon("newlocomotive", "steam",{ +advtrains.register_wagon("newlocomotive", { mesh="advtrains_engine_steam.b3d", textures = {"advtrains_newlocomotive.png"}, is_locomotive=true, + drives_on={default=true}, + max_speed=10, seats = { { name="Driver Stand (left)", @@ -19,12 +21,12 @@ advtrains.register_wagon("newlocomotive", "steam",{ visual_size = {x=1, y=1}, wagon_span=1.85, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - update_animation=function(self, velocity) + --update_animation=function(self, velocity) --if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) + -- self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) --self.old_anim_velocity=advtrains.abs_ceil(velocity) --end - end, + --end, custom_on_activate = function(self, staticdata_table, dtime_s) minetest.add_particlespawner({ amount = 10, @@ -54,9 +56,11 @@ advtrains.register_wagon("newlocomotive", "steam",{ end, drops={"default:steelblock 4"}, }, "Steam Engine", "advtrains_newlocomotive_inv.png") -advtrains.register_wagon("wagon_default", "steam",{ +advtrains.register_wagon("wagon_default", { mesh="advtrains_wagon.b3d", textures = {"advtrains_wagon.png"}, + drives_on={default=true}, + max_speed=10, seats = { { name="Default Seat", @@ -69,9 +73,11 @@ advtrains.register_wagon("wagon_default", "steam",{ collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, drops={"default:steelblock 4"}, }, "Passenger Wagon", "advtrains_wagon_inv.png") -advtrains.register_wagon("wagon_box", "steam",{ +advtrains.register_wagon("wagon_box", { mesh="advtrains_wagon.b3d", textures = {"advtrains_wagon_box.png"}, + drives_on={default=true}, + max_speed=10, seats = {}, visual_size = {x=1, y=1}, wagon_span=1.8, diff --git a/advtrains_train_subway/init.lua b/advtrains_train_subway/init.lua index c933fff..b5bdb18 100644 --- a/advtrains_train_subway/init.lua +++ b/advtrains_train_subway/init.lua @@ -1,7 +1,9 @@ -advtrains.register_wagon("subway_wagon", "subway",{ +advtrains.register_wagon("subway_wagon", { mesh="advtrains_subway_train.b3d", textures = {"advtrains_subway_train.png"}, + drives_on={default=true}, + max_speed=15, seats = { { name="Default Seat (driver stand)", |