aboutsummaryrefslogtreecommitdiff
path: root/moretrains_vintage/init.lua
blob: 74d5a37caf418f482e838059e749ababf25ed0c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
local S
if minetest.get_modpath("intllib") then
    S = intllib.Getter()
else
    S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
end

advtrains.register_wagon("moretrains_draisine", {
	mesh="moretrains_draisine.b3d",
	textures = {"moretrains_vintage.png"},
	drives_on={default=true},
	max_speed=3,
	seats = {
		{
			name=S("Driver stand"),
			attach_offset={x=0, y=-2, z=13},
			view_offset={x=0, y=1.5, z=0},
			group="dstand",
		},
		{
			name="1",
			attach_offset={x=-4, y=-2, z=0},
			view_offset={x=0, y=-2, z=0},
			group="pass",
		},
		{
			name="2",
			attach_offset={x=4, y=-2, z=0},
			view_offset={x=0, y=-2, z=0},
			group="pass",
		},
		{
			name="3",
			attach_offset={x=-4, y=-2, z=-8},
			view_offset={x=0, y=-2, z=0},
			group="pass",
		},
		{
			name="4",
			attach_offset={x=4, y=-2, z=-8},
			view_offset={x=0, y=-2, z=0},
			group="pass",
		},
	},
	seat_groups = {
		dstand={
			name = "Driver Stand",
			access_to = {"pass"},
			require_doors_open=true,
			driving_ctrl_access=true,
		},
		pass={
			name = "Passenger area",
			access_to = {"dstand"},
			require_doors_open=true,
		},
	},
	assign_to_seat_group = {"dstand", "pass"},
	visual_size = {x=1, y=1},
	wagon_span=1.06,
	is_locomotive=true,
	collisionbox = {-0.8,-0.5,-0.7, 0.8,2,0.7},
	drops={"default:wood"},
}, S("Draisine"), "moretrains_draisine_inv.png")


advtrains.register_wagon("moretrains_minecart", {
	mesh="moretrains_minecart.b3d",
	textures = {"moretrains_vintage.png"},
	drives_on={default=true},
	max_speed=6,
	seats = {},
	visual_size = {x=1, y=1},
	wagon_span=1.06,
	collisionbox = {-0.8,-0.5,-0.7, 0.8,2,0.7},
	drops={"default:wood"},
	has_inventory = true,
	get_inventory_formspec = function(self, pname, invname)
		return "size[8,11]"..
			"list["..invname..";box;0,0;8,3;]"..
			"list[current_player;main;0,5;8,4;]"..
			"listring[]"
	end,
	inventory_list_sizes = {
		box=1*4,
	},
}, S("Minecart"), "moretrains_minecart_inv.png")

--minetest.register_craft({
--	output = 'advtrains:moretrains_draisine',
--	recipe = {
--		{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
--		{'default:glass', 'dye:green', 'default:glass'},
--		{'advtrains:wheel', '', 'advtrains:wheel'},
--	},
--})

--minetest.register_craft({
--	output = 'advtrains:moretrains_minecart',
--	recipe = {
--		{'default:steel_ingot', 'default:steel_ingot', ''},
--		{'default:glass', 'dye:green', 'default:glass'},
--		{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
--	},
--})