aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--models/advtrains_subway_train.b3dbin0 -> 95856 bytes
-rw-r--r--models/blender/subway-train.blendbin0 -> 536268 bytes
-rw-r--r--models/blender/subway-train.blend1bin0 -> 538188 bytes
-rw-r--r--models/blender/subway-train.pngbin0 -> 96773 bytes
-rw-r--r--models/blender/subway-train.xcfbin0 -> 92554 bytes
-rw-r--r--textures/advtrains_newlocomotive_inv.pngbin0 -> 955 bytes
-rw-r--r--textures/advtrains_subway_train.pngbin0 -> 12027 bytes
-rw-r--r--textures/advtrains_subway_train_inv.pngbin0 -> 900 bytes
-rw-r--r--textures/advtrains_wagon_inv.pngbin0 -> 1844 bytes
-rw-r--r--trainlogic.lua6
-rw-r--r--wagons.lua26
11 files changed, 22 insertions, 10 deletions
diff --git a/models/advtrains_subway_train.b3d b/models/advtrains_subway_train.b3d
new file mode 100644
index 0000000..a824d33
--- /dev/null
+++ b/models/advtrains_subway_train.b3d
Binary files differ
diff --git a/models/blender/subway-train.blend b/models/blender/subway-train.blend
new file mode 100644
index 0000000..690d87b
--- /dev/null
+++ b/models/blender/subway-train.blend
Binary files differ
diff --git a/models/blender/subway-train.blend1 b/models/blender/subway-train.blend1
new file mode 100644
index 0000000..86d1f92
--- /dev/null
+++ b/models/blender/subway-train.blend1
Binary files differ
diff --git a/models/blender/subway-train.png b/models/blender/subway-train.png
new file mode 100644
index 0000000..d0b9731
--- /dev/null
+++ b/models/blender/subway-train.png
Binary files differ
diff --git a/models/blender/subway-train.xcf b/models/blender/subway-train.xcf
new file mode 100644
index 0000000..74e5a9e
--- /dev/null
+++ b/models/blender/subway-train.xcf
Binary files differ
diff --git a/textures/advtrains_newlocomotive_inv.png b/textures/advtrains_newlocomotive_inv.png
new file mode 100644
index 0000000..6148880
--- /dev/null
+++ b/textures/advtrains_newlocomotive_inv.png
Binary files differ
diff --git a/textures/advtrains_subway_train.png b/textures/advtrains_subway_train.png
new file mode 100644
index 0000000..230f56d
--- /dev/null
+++ b/textures/advtrains_subway_train.png
Binary files differ
diff --git a/textures/advtrains_subway_train_inv.png b/textures/advtrains_subway_train_inv.png
new file mode 100644
index 0000000..1d0e809
--- /dev/null
+++ b/textures/advtrains_subway_train_inv.png
Binary files differ
diff --git a/textures/advtrains_wagon_inv.png b/textures/advtrains_wagon_inv.png
new file mode 100644
index 0000000..e5377a9
--- /dev/null
+++ b/textures/advtrains_wagon_inv.png
Binary files differ
diff --git a/trainlogic.lua b/trainlogic.lua
index 71d7086..81672d9 100644
--- a/trainlogic.lua
+++ b/trainlogic.lua
@@ -168,7 +168,7 @@ function advtrains.train_step(id, train, dtime)
if train.couple_eid_back and (not minetest.luaentities[train.couple_eid_back] or not minetest.luaentities[train.couple_eid_back].is_couple) then train.couple_eid_back=nil end
--skip certain things (esp. collision) when not moving
- local train_moves=train.velocity~=0
+ local train_moves=(train.velocity~=0)
--if not train.last_pos then advtrains.trains[id]=nil return end
@@ -202,7 +202,7 @@ function advtrains.train_step(id, train, dtime)
if train.tarvelocity<0 then train.tarvelocity=0 end
end
- if train_moving then
+ if train_moves then
--check for collisions by finding objects
--front
local search_radius=4
@@ -294,7 +294,7 @@ function advtrains.train_step(id, train, dtime)
--handle collided_with_env
if train.recently_collided_with_env then
train.tarvelocity=0
- if not train_moving then
+ if not train_moves then
train.recently_collided_with_env=false--reset status when stopped
end
end
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