init.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. local S
  2. if minetest.get_modpath("intllib") then
  3. S = intllib.Getter()
  4. else
  5. S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
  6. end
  7. advtrains.register_wagon("moretrains_railroad_car", {
  8. mesh="moretrains_railroad_car.b3d",
  9. textures = {"moretrains_railroad_car.png"},
  10. drives_on={default=true},
  11. max_speed=20,
  12. seats = {
  13. {
  14. name="1",
  15. attach_offset={x=-4, y=-2, z=8},
  16. view_offset={x=0, y=-2, z=0},
  17. group="pass",
  18. },
  19. {
  20. name="2",
  21. attach_offset={x=4, y=-2, z=8},
  22. view_offset={x=0, y=-2, z=0},
  23. group="pass",
  24. },
  25. {
  26. name="1a",
  27. attach_offset={x=-4, y=-2, z=0},
  28. view_offset={x=0, y=-2, z=0},
  29. group="pass",
  30. },
  31. {
  32. name="2a",
  33. attach_offset={x=4, y=-2, z=0},
  34. view_offset={x=0, y=-2, z=0},
  35. group="pass",
  36. },
  37. {
  38. name="3",
  39. attach_offset={x=-4, y=-2, z=-8},
  40. view_offset={x=0, y=-2, z=0},
  41. group="pass",
  42. },
  43. {
  44. name="4",
  45. attach_offset={x=4, y=8, z=-8},
  46. view_offset={x=0, y=-2, z=0},
  47. group="pass",
  48. },
  49. },
  50. seat_groups = {
  51. pass={
  52. name = "Passenger area",
  53. access_to = {},
  54. require_doors_open=true,
  55. },
  56. },
  57. doors={
  58. open={
  59. [-1]={frames={x=0, y=10}, time=1},
  60. [1]={frames={x=20, y=30}, time=1}
  61. },
  62. close={
  63. [-1]={frames={x=10, y=20}, time=1},
  64. [1]={frames={x=30, y=40}, time=1}
  65. }
  66. },
  67. door_entry={-1.7},
  68. assign_to_seat_group = {"pass"},
  69. visual_size = {x=1, y=1},
  70. wagon_span=2.94,
  71. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  72. drops={"default:steelblock"},
  73. }, S("Railroad Car"), "moretrains_railroad_car_inv.png")
  74. advtrains.register_wagon("moretrains_silberling", {
  75. mesh="moretrains_silberling.b3d",
  76. textures = {"moretrains_silberling.png"},
  77. drives_on={default=true},
  78. max_speed=20,
  79. seats = {
  80. {
  81. name="1",
  82. attach_offset={x=-4, y=-2, z=8},
  83. view_offset={x=0, y=-2, z=0},
  84. group="pass",
  85. },
  86. {
  87. name="2",
  88. attach_offset={x=4, y=-2, z=8},
  89. view_offset={x=0, y=-2, z=0},
  90. group="pass",
  91. },
  92. {
  93. name="1a",
  94. attach_offset={x=-4, y=-2, z=0},
  95. view_offset={x=0, y=-2, z=0},
  96. group="pass",
  97. },
  98. {
  99. name="2a",
  100. attach_offset={x=4, y=-2, z=0},
  101. view_offset={x=0, y=-2, z=0},
  102. group="pass",
  103. },
  104. {
  105. name="3",
  106. attach_offset={x=-4, y=-2, z=-8},
  107. view_offset={x=0, y=-2, z=0},
  108. group="pass",
  109. },
  110. {
  111. name="4",
  112. attach_offset={x=4, y=8, z=-8},
  113. view_offset={x=0, y=-2, z=0},
  114. group="pass",
  115. },
  116. },
  117. seat_groups = {
  118. pass={
  119. name = "Passenger area",
  120. access_to = {},
  121. require_doors_open=true,
  122. },
  123. },
  124. doors={
  125. open={
  126. [-1]={frames={x=20, y=30}, time=1},
  127. [1]={frames={x=0, y=10}, time=1}
  128. },
  129. close={
  130. [-1]={frames={x=30, y=40}, time=1},
  131. [1]={frames={x=10, y=20}, time=1}
  132. }
  133. },
  134. door_entry={-1.7},
  135. assign_to_seat_group = {"pass"},
  136. visual_size = {x=1, y=1},
  137. wagon_span=3,
  138. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  139. drops={"default:steelblock"},
  140. }, S("MT Silberling Wagon"), "moretrains_silberling_inv.png")
  141. advtrains.register_wagon("moretrains_silberling_dining", {
  142. mesh="moretrains_silberling_dining.b3d",
  143. textures = {"moretrains_silberling_dining.png"},
  144. drives_on={default=true},
  145. max_speed=20,
  146. seats = {
  147. {
  148. name="1L",
  149. attach_offset={x=-3.4, y=-2, z=18},
  150. view_offset={x=0, y=-2, z=0},
  151. group="pass",
  152. },
  153. {
  154. name="1R",
  155. attach_offset={x=3.4, y=-2, z=18},
  156. view_offset={x=0, y=-2, z=0},
  157. group="pass",
  158. },
  159. {
  160. name="2R",
  161. attach_offset={x=3.4, y=-2, z=8},
  162. view_offset={x=0, y=-2, z=0},
  163. group="pass",
  164. },
  165. {
  166. name="3L",
  167. attach_offset={x=-3.4, y=-2, z=-4},
  168. view_offset={x=0, y=-2, z=0},
  169. group="pass",
  170. },
  171. {
  172. name="3R",
  173. attach_offset={x=3.4, y=-2, z=-3},
  174. view_offset={x=0, y=-2, z=0},
  175. group="pass",
  176. },
  177. {
  178. name="4L",
  179. attach_offset={x=-3.4, y=-2, z=-14},
  180. view_offset={x=0, y=-2, z=0},
  181. group="pass",
  182. },
  183. },
  184. seat_groups = {
  185. pass={
  186. name = "Passenger area",
  187. access_to = {},
  188. require_doors_open=true,
  189. },
  190. },
  191. doors={
  192. open={
  193. [-1]={frames={x=20, y=30}, time=1},
  194. [1]={frames={x=0, y=10}, time=1}
  195. },
  196. close={
  197. [-1]={frames={x=30, y=40}, time=1},
  198. [1]={frames={x=10, y=20}, time=1}
  199. }
  200. },
  201. door_entry={-1.7},
  202. assign_to_seat_group = {"pass"},
  203. visual_size = {x=1, y=1},
  204. wagon_span=3,
  205. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  206. drops={"default:steelblock"},
  207. }, S("MT Silberling Dining Wagon"), "moretrains_silberling_dining_inv.png")
  208. advtrains.register_wagon("moretrains_diesel_german", {
  209. mesh="moretrains_diesel_german.b3d",
  210. textures = {"moretrains_diesel_german.png"},
  211. drives_on={default=true},
  212. max_speed=20,
  213. seats = {
  214. {
  215. name=S("Driver Stand (right)"),
  216. attach_offset={x=1, y=1.4, z=-7.2},
  217. view_offset={x=2, y=3.1, z=-8},
  218. driving_ctrl_access=true,
  219. group = "dstand",
  220. },
  221. },
  222. seat_groups = {
  223. dstand={
  224. name = "Driver Stand",
  225. access_to = {},
  226. driving_ctrl_access = true,
  227. },
  228. },
  229. assign_to_seat_group = {"dstand"},
  230. visual_size = {x=1, y=1},
  231. wagon_span=2.8,
  232. is_locomotive=true,
  233. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  234. drops={"default:steelblock 4"},
  235. horn_sound = "advtrains_industrial_horn",
  236. }, S("Old German Diesel"), "moretrains_diesel_german_inv.png")
  237. advtrains.register_wagon("moretrains_silberling_train", {
  238. mesh="moretrains_silberling_train.b3d",
  239. textures = {"moretrains_silberling_train.png"},
  240. drives_on={default=true},
  241. max_speed=20,
  242. seats = {
  243. {
  244. name=S("Driver stand"),
  245. attach_offset={x=0, y=-0.4, z=21},
  246. view_offset={x=10.4, y=9, z=0},
  247. group="dstand",
  248. },
  249. {
  250. name="1",
  251. attach_offset={x=-4, y=-2, z=8},
  252. view_offset={x=0, y=-2, z=0},
  253. group="pass",
  254. },
  255. {
  256. name="2",
  257. attach_offset={x=4, y=-2, z=8},
  258. view_offset={x=0, y=-2, z=0},
  259. group="pass",
  260. },
  261. {
  262. name="1a",
  263. attach_offset={x=-4, y=-2, z=0},
  264. view_offset={x=0, y=-2, z=0},
  265. group="pass",
  266. },
  267. {
  268. name="2a",
  269. attach_offset={x=4, y=-2, z=0},
  270. view_offset={x=0, y=-2, z=0},
  271. group="pass",
  272. },
  273. {
  274. name="3",
  275. attach_offset={x=-4, y=-2, z=-8},
  276. view_offset={x=0, y=-2, z=0},
  277. group="pass",
  278. },
  279. {
  280. name="4",
  281. attach_offset={x=4, y=8, z=-8},
  282. view_offset={x=0, y=-2, z=0},
  283. group="pass",
  284. },
  285. },
  286. seat_groups = {
  287. dstand={
  288. name = "Driver Stand",
  289. access_to = {"pass"},
  290. driving_ctrl_access=true,
  291. },
  292. pass={
  293. name = "Passenger area",
  294. access_to = {"dstand"},
  295. require_doors_open=true,
  296. },
  297. },
  298. assign_to_seat_group = {"dstand", "pass"},
  299. doors={
  300. open={
  301. [-1]={frames={x=0, y=10}, time=1},
  302. [1]={frames={x=20, y=30}, time=1}
  303. },
  304. close={
  305. [-1]={frames={x=10, y=20}, time=1},
  306. [1]={frames={x=30, y=40}, time=1}
  307. }
  308. },
  309. visual_size = {x=1, y=1},
  310. wagon_span=3,
  311. is_locomotive=false,
  312. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  313. drops={"default:steelblock 4"},
  314. horn_sound = "advtrains_industrial_horn",
  315. }, S("MT Silberling Cab Car"), "moretrains_silberling_train_inv.png")
  316. minetest.register_craft({
  317. output = 'advtrains:moretrains_diesel_german',
  318. recipe = {
  319. {'default:glass', 'dye:red', ''},
  320. {'default:steelblock', 'advtrains:driver_cab', 'default:steelblock'},
  321. {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
  322. },
  323. })
  324. local block = 'default:steelblock'
  325. local ingot = 'default:steel_ingot'
  326. if minetest.get_modpath("moreores") then
  327. block = 'moreores:silver_block'
  328. ingot = 'moreores:silver_ingot'
  329. end
  330. minetest.register_craft({
  331. output = 'advtrains:moretrains_silberling',
  332. recipe = {
  333. {'default:steelblock', block, 'default:steelblock'},
  334. {ingot, 'default:glass', ingot},
  335. {'advtrains:wheel', '', 'advtrains:wheel'},
  336. },
  337. })
  338. minetest.register_craft({
  339. output = 'advtrains:moretrains_silberling_dining',
  340. recipe = {
  341. {'default:steelblock', block, 'default:steelblock'},
  342. {ingot, 'default:furnace', ingot},
  343. {'advtrains:wheel', '', 'advtrains:wheel'},
  344. },
  345. })
  346. minetest.register_craft({
  347. output = 'advtrains:moretrains_silberling_train',
  348. recipe = {
  349. {'default:steelblock', block, 'default:steelblock'},
  350. {block, 'default:glass', ingot},
  351. {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
  352. },
  353. })
  354. minetest.register_craft({
  355. output = 'advtrains:moretrains_railroad_car',
  356. recipe = {
  357. {'default:steelblock', 'default:tin_ingot', 'default:steelblock'},
  358. {'default:steelblock', 'default:glass', 'default:steelblock'},
  359. {'advtrains:wheel', '', 'advtrains:wheel'},
  360. },
  361. })