aboutsummaryrefslogtreecommitdiff
path: root/advtrains_train_steam/init.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-12-22 18:55:10 +0100
committerorwell96 <mono96.mml@gmail.com>2016-12-22 18:55:10 +0100
commitd08e202346192c50072450a3eaa3b28cad852b84 (patch)
treefcb449a63df2c21178fba742d2121cb98c0ff6ab /advtrains_train_steam/init.lua
parentf806ed9eee8c13eb0b4868641311d25257c63f46 (diff)
downloadadvtrains-d08e202346192c50072450a3eaa3b28cad852b84.tar.gz
advtrains-d08e202346192c50072450a3eaa3b28cad852b84.tar.bz2
advtrains-d08e202346192c50072450a3eaa3b28cad852b84.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.lua18
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,