init.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. local bed = 'wool:white'
  8. if minetest.get_modpath("beds") then
  9. bed = 'beds:bed'
  10. end
  11. local door = 'default:steel_ingot'
  12. if minetest.get_modpath("doors") then
  13. door = 'doors:door_steel'
  14. end
  15. advtrains.register_wagon("moretrains_nightline_couchette", {
  16. mesh="moretrains_nightline_couchette.b3d",
  17. textures = {"moretrains_nightline_couchette.png"},
  18. drives_on={default=true},
  19. max_speed=20,
  20. seats = {
  21. {
  22. name="1",
  23. attach_offset={x=0, y=-2, z=17},
  24. view_offset={x=0, y=-2, z=0},
  25. group="pass",
  26. },
  27. {
  28. name="2",
  29. attach_offset={x=0, y=-2, z=6},
  30. view_offset={x=0, y=-2, z=0},
  31. group="pass",
  32. },
  33. {
  34. name="3",
  35. attach_offset={x=0, y=-2, z=-6},
  36. view_offset={x=0, y=-2, z=0},
  37. group="pass",
  38. },
  39. {
  40. name="4",
  41. attach_offset={x=0, y=-2, z=-17},
  42. view_offset={x=0, y=-2, z=0},
  43. group="pass",
  44. },
  45. },
  46. seat_groups = {
  47. pass={
  48. name = "Passenger area",
  49. access_to = {},
  50. require_doors_open=true,
  51. },
  52. },
  53. doors={
  54. open={
  55. [-1]={frames={x=21, y=30}, time=1},
  56. [1]={frames={x=1, y=10}, time=1}
  57. },
  58. close={
  59. [-1]={frames={x=30, y=41}, time=1},
  60. [1]={frames={x=10, y=20}, time=1}
  61. }
  62. },
  63. door_entry={-2, 2},
  64. assign_to_seat_group = {"pass"},
  65. visual_size = {x=1, y=1},
  66. wagon_span=3,
  67. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  68. drops={"default:steelblock"},
  69. }, S("Night Line Couchette Wagon"), "moretrains_nightline_couchette_inv.png")
  70. minetest.register_craft({
  71. output = 'advtrains:moretrains_nightline_couchette',
  72. recipe = {
  73. {'default:steelblock', 'dye:blue', 'default:steelblock'},
  74. {'default:glass', bed, door},
  75. {'advtrains:wheel', 'default:steelblock', 'advtrains:wheel'},
  76. },
  77. })
  78. advtrains.register_wagon("moretrains_nightline_seat_car", {
  79. mesh="moretrains_nightline_seat_car.b3d",
  80. textures = {"moretrains_nightline_seat_car.png"},
  81. drives_on={default=true},
  82. max_speed=20,
  83. seats = {
  84. {
  85. name="1",
  86. attach_offset={x=0, y=-2, z=17},
  87. view_offset={x=0, y=-2, z=0},
  88. group="pass",
  89. },
  90. {
  91. name="2",
  92. attach_offset={x=0, y=-2, z=6},
  93. view_offset={x=0, y=-2, z=0},
  94. group="pass",
  95. },
  96. {
  97. name="3",
  98. attach_offset={x=0, y=-2, z=-6},
  99. view_offset={x=0, y=-2, z=0},
  100. group="pass",
  101. },
  102. {
  103. name="4",
  104. attach_offset={x=0, y=-2, z=-17},
  105. view_offset={x=0, y=-2, z=0},
  106. group="pass",
  107. },
  108. },
  109. seat_groups = {
  110. pass={
  111. name = "Passenger area",
  112. access_to = {},
  113. require_doors_open=true,
  114. },
  115. },
  116. doors={
  117. open={
  118. [-1]={frames={x=21, y=30}, time=1},
  119. [1]={frames={x=1, y=10}, time=1}
  120. },
  121. close={
  122. [-1]={frames={x=30, y=41}, time=1},
  123. [1]={frames={x=10, y=20}, time=1}
  124. }
  125. },
  126. door_entry={-2, 2},
  127. assign_to_seat_group = {"pass"},
  128. visual_size = {x=1, y=1},
  129. wagon_span=3,
  130. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  131. drops={"default:steelblock"},
  132. }, S("Night Line Seat Wagon"), "moretrains_nightline_seat_car_inv.png")
  133. minetest.register_craft({
  134. output = 'advtrains:moretrains_nightline_seat_car',
  135. recipe = {
  136. {'default:steelblock', 'dye:blue', 'default:steelblock'},
  137. {'default:glass', 'wool:blue', door},
  138. {'advtrains:wheel', 'default:steelblock', 'advtrains:wheel'},
  139. },
  140. })