aboutsummaryrefslogtreecommitdiff
path: root/wagons.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-08-28 21:58:13 +0200
committerorwell96 <mono96.mml@gmail.com>2016-08-28 21:58:13 +0200
commitd0e1588399d36cb9848f6cfafe375e271a785232 (patch)
tree2c5ec0254d9af4d865bf2c3afe4bf88a1f1aba2d /wagons.lua
parent30dd71ea5a0ec1be65d664941037ab2fd1ba4e4e (diff)
downloadadvtrains-d0e1588399d36cb9848f6cfafe375e271a785232.tar.gz
advtrains-d0e1588399d36cb9848f6cfafe375e271a785232.tar.bz2
advtrains-d0e1588399d36cb9848f6cfafe375e271a785232.zip
Add a subway train (and fix spelling mistake resulting in collision not working
Diffstat (limited to 'wagons.lua')
-rw-r--r--wagons.lua26
1 files changed, 19 insertions, 7 deletions
diff --git a/wagons.lua b/wagons.lua
index 6ad2ffa..6b73e5f 100644
--- a/wagons.lua
+++ b/wagons.lua
@@ -312,14 +312,14 @@ function advtrains.get_real_path_index(train, pit)
end
-function advtrains.register_wagon(sysname, traintype, prototype)
+function advtrains.register_wagon(sysname, traintype, prototype, desc, inv_img)
setmetatable(prototype, {__index=wagon})
minetest.register_entity("advtrains:"..sysname,prototype)
minetest.register_craftitem("advtrains:"..sysname, {
- description = sysname,
- inventory_image = prototype.textures[1],
- wield_image = prototype.textures[1],
+ description = desc,
+ inventory_image = inv_img,
+ wield_image = inv_img,
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
@@ -347,7 +347,7 @@ function advtrains.register_wagon(sysname, traintype, prototype)
end,
})
end
-advtrains.register_train_type("steam", {"regular", "fineturns", "default"})
+advtrains.register_train_type("steam", {"regular", "default"})
--[[advtrains.register_wagon("blackwagon", "steam",{textures = {"black.png"}})
advtrains.register_wagon("bluewagon", "steam",{textures = {"blue.png"}})
@@ -375,7 +375,7 @@ advtrains.register_wagon("newlocomotive", "steam",{
self.old_anim_velocity=advtrains.abs_ceil(velocity)
end
end
-})
+}, "Steam Engine", "advtrains_newlocomotive_inv.png")
advtrains.register_wagon("wagon_default", "steam",{
mesh="wagon.b3d",
textures = {"advtrains_wagon.png"},
@@ -384,8 +384,20 @@ advtrains.register_wagon("wagon_default", "steam",{
visual_size = {x=1, y=1},
wagon_span=1.8,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
-})
+}, "Passenger Wagon", "advtrains_wagon_inv.png")
+advtrains.register_train_type("subway", {"regular", "default"})
+
+advtrains.register_wagon("subway_wagon", "subway",{
+ mesh="advtrains_subway_train.b3d",
+ textures = {"advtrains_subway_train.png"},
+ attach_offset={x=0, y=10, z=0},
+ view_offset={x=0, y=6, z=0},
+ visual_size = {x=1, y=1},
+ wagon_span=1.8,
+ collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
+ is_locomotive=true,
+}, "Subway Passenger Wagon", "advtrains_subway_train_inv.png")
--[[
advtrains.register_wagon("wagontype1",{on_rightclick=function(self, clicker)
if clicker:get_player_control().sneak then