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 /advtrains_train_steam/init.lua | |
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
Diffstat (limited to 'advtrains_train_steam/init.lua')
-rw-r--r-- | advtrains_train_steam/init.lua | 18 |
1 files changed, 12 insertions, 6 deletions
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, |