init.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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_diesel_german", {
  142. mesh="moretrains_diesel_german.b3d",
  143. textures = {"moretrains_diesel_german.png"},
  144. drives_on={default=true},
  145. max_speed=20,
  146. seats = {
  147. {
  148. name=S("Driver Stand (right)"),
  149. attach_offset={x=1, y=1.4, z=-7.2},
  150. view_offset={x=2, y=3.1, z=-8},
  151. driving_ctrl_access=true,
  152. group = "dstand",
  153. },
  154. },
  155. seat_groups = {
  156. dstand={
  157. name = "Driver Stand",
  158. access_to = {},
  159. driving_ctrl_access = true,
  160. },
  161. },
  162. assign_to_seat_group = {"dstand"},
  163. visual_size = {x=1, y=1},
  164. wagon_span=2.8,
  165. is_locomotive=true,
  166. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  167. drops={"default:steelblock 4"},
  168. horn_sound = "advtrains_industrial_horn",
  169. }, S("Old German Diesel"), "moretrains_diesel_german_inv.png")
  170. advtrains.register_wagon("moretrains_silberling_train", {
  171. mesh="moretrains_silberling_train.b3d",
  172. textures = {"moretrains_silberling_train.png"},
  173. drives_on={default=true},
  174. max_speed=20,
  175. seats = {
  176. {
  177. name=S("Driver stand"),
  178. attach_offset={x=0, y=-0.4, z=21},
  179. view_offset={x=10.4, y=9, z=0},
  180. group="dstand",
  181. },
  182. {
  183. name="1",
  184. attach_offset={x=-4, y=-2, z=8},
  185. view_offset={x=0, y=-2, z=0},
  186. group="pass",
  187. },
  188. {
  189. name="2",
  190. attach_offset={x=4, y=-2, z=8},
  191. view_offset={x=0, y=-2, z=0},
  192. group="pass",
  193. },
  194. {
  195. name="1a",
  196. attach_offset={x=-4, y=-2, z=0},
  197. view_offset={x=0, y=-2, z=0},
  198. group="pass",
  199. },
  200. {
  201. name="2a",
  202. attach_offset={x=4, y=-2, z=0},
  203. view_offset={x=0, y=-2, z=0},
  204. group="pass",
  205. },
  206. {
  207. name="3",
  208. attach_offset={x=-4, y=-2, z=-8},
  209. view_offset={x=0, y=-2, z=0},
  210. group="pass",
  211. },
  212. {
  213. name="4",
  214. attach_offset={x=4, y=8, z=-8},
  215. view_offset={x=0, y=-2, z=0},
  216. group="pass",
  217. },
  218. },
  219. seat_groups = {
  220. dstand={
  221. name = "Driver Stand",
  222. access_to = {"pass"},
  223. driving_ctrl_access=true,
  224. },
  225. pass={
  226. name = "Passenger area",
  227. access_to = {"dstand"},
  228. require_doors_open=true,
  229. },
  230. },
  231. assign_to_seat_group = {"dstand", "pass"},
  232. doors={
  233. open={
  234. [-1]={frames={x=0, y=10}, time=1},
  235. [1]={frames={x=20, y=30}, time=1}
  236. },
  237. close={
  238. [-1]={frames={x=10, y=20}, time=1},
  239. [1]={frames={x=30, y=40}, time=1}
  240. }
  241. },
  242. assign_to_seat_group = {"dstand"},
  243. visual_size = {x=1, y=1},
  244. wagon_span=3,
  245. is_locomotive=false,
  246. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  247. drops={"default:steelblock 4"},
  248. horn_sound = "advtrains_industrial_horn",
  249. }, S("MT Silberling Cab Car"), "moretrains_silberling_train_inv.png")
  250. minetest.register_craft({
  251. output = 'advtrains:moretrains_diesel_german',
  252. recipe = {
  253. {'default:glass', 'dye:red', ''},
  254. {'default:steelblock', 'advtrains:driver_cab', 'default:steelblock'},
  255. {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
  256. },
  257. })
  258. local block = 'default:steelblock'
  259. local ingot = 'default:steel_ingot'
  260. if minetest.get_modpath("moreores") then
  261. block = 'moreores:silver_block'
  262. ingot = 'moreores:silver_ingot'
  263. end
  264. minetest.register_craft({
  265. output = 'advtrains:moretrains_silberling',
  266. recipe = {
  267. {'default:steelblock', block, 'default:steelblock'},
  268. {ingot, 'default:glass', ingot},
  269. {'advtrains:wheel', '', 'advtrains:wheel'},
  270. },
  271. })
  272. minetest.register_craft({
  273. output = 'advtrains:moretrains_silberling_train',
  274. recipe = {
  275. {'default:steelblock', block, 'default:steelblock'},
  276. {block, 'default:glass', ingot},
  277. {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
  278. },
  279. })
  280. minetest.register_craft({
  281. output = 'advtrains:moretrains_railroad_car',
  282. recipe = {
  283. {'default:steelblock', 'default:tin_ingot', 'default:steelblock'},
  284. {'default:steelblock', 'default:glass', 'default:steelblock'},
  285. {'advtrains:wheel', '', 'advtrains:wheel'},
  286. },
  287. })