init.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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_engine_japan", {
  8. mesh="moretrains_japan_bullet_engine.b3d",
  9. textures = {"moretrains_engine_japan.png"},
  10. drives_on={default=true},
  11. max_speed=20,
  12. seats = {
  13. {
  14. name=S("Driver stand"),
  15. attach_offset={x=1, y=1, z=0},
  16. view_offset={x=0, y=1.5, z=0},
  17. group="dstand",
  18. },
  19. {
  20. name="1",
  21. attach_offset={x=-4, y=-2, z=-16},
  22. view_offset={x=0, y=1.5, z=0},
  23. group="pass",
  24. },
  25. {
  26. name="2",
  27. attach_offset={x=4, y=-2, z=-16},
  28. view_offset={x=0, y=1.5, z=0},
  29. group="pass",
  30. },
  31. {
  32. name="3",
  33. attach_offset={x=-4, y=-2, z=-8},
  34. view_offset={x=0, y=1.5, z=0},
  35. group="pass",
  36. },
  37. {
  38. name="4",
  39. attach_offset={x=4, y=-2, z=-8},
  40. view_offset={x=0, y=1.5, z=0},
  41. group="pass",
  42. },
  43. },
  44. seat_groups = {
  45. dstand={
  46. name = "Driver Stand",
  47. access_to = {"pass"},
  48. require_doors_open=true,
  49. driving_ctrl_access=true,
  50. },
  51. pass={
  52. name = "Passenger area",
  53. access_to = {"dstand"},
  54. require_doors_open=true,
  55. },
  56. },
  57. assign_to_seat_group = {"dstand", "pass"},
  58. doors={
  59. open={
  60. [-1]={frames={x=0, y=10}, time=1},
  61. [1]={frames={x=20, y=30}, time=1}
  62. },
  63. close={
  64. [-1]={frames={x=10, y=20}, time=1},
  65. [1]={frames={x=30, y=40}, time=1}
  66. }
  67. },
  68. door_entry={-1.7},
  69. visual_size = {x=1, y=1},
  70. wagon_span=3.1,
  71. is_locomotive=true,
  72. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  73. drops={"default:steelblock"},
  74. horn_sound = "moretrains_japan_horn",
  75. }, S("Japanese Train Engine (moretrains)"), "moretrains_engine_japan_inv.png")
  76. advtrains.register_wagon("moretrains_wagon_japan", {
  77. mesh="moretrains_japan_bullet_wagon.b3d",
  78. textures = {"moretrains_wagon_japan.png"},
  79. drives_on={default=true},
  80. max_speed=20,
  81. seats = {
  82. {
  83. name="1",
  84. attach_offset={x=-4, y=-2, z=8},
  85. view_offset={x=0, y=-2, z=0},
  86. group="pass",
  87. },
  88. {
  89. name="2",
  90. attach_offset={x=4, y=-2, z=8},
  91. view_offset={x=0, y=-2, z=0},
  92. group="pass",
  93. },
  94. {
  95. name="1a",
  96. attach_offset={x=-4, y=-2, z=0},
  97. view_offset={x=0, y=-2, z=0},
  98. group="pass",
  99. },
  100. {
  101. name="2a",
  102. attach_offset={x=4, y=-2, z=0},
  103. view_offset={x=0, y=-2, z=0},
  104. group="pass",
  105. },
  106. {
  107. name="3",
  108. attach_offset={x=-4, y=-2, z=-8},
  109. view_offset={x=0, y=-2, z=0},
  110. group="pass",
  111. },
  112. {
  113. name="4",
  114. attach_offset={x=4, y=8, z=-8},
  115. view_offset={x=0, y=-2, z=0},
  116. group="pass",
  117. },
  118. },
  119. seat_groups = {
  120. pass={
  121. name = "Passenger area",
  122. access_to = {},
  123. require_doors_open=true,
  124. },
  125. },
  126. assign_to_seat_group = {"pass"},
  127. doors={
  128. open={
  129. [-1]={frames={x=0, y=10}, time=1},
  130. [1]={frames={x=20, y=30}, time=1}
  131. },
  132. close={
  133. [-1]={frames={x=10, y=20}, time=1},
  134. [1]={frames={x=30, y=40}, time=1}
  135. }
  136. },
  137. door_entry={-1.7, 1.7},
  138. visual_size = {x=1, y=1},
  139. wagon_span=2.96,
  140. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  141. drops={"default:steelblock"},
  142. }, S("Japanese Train Wagon (moretrains)"), "moretrains_wagon_japan_inv.png")
  143. minetest.register_craft({
  144. output = 'advtrains:moretrains_wagon_japan',
  145. recipe = {
  146. {'default:steelblock', 'default:steel_ingot', 'default:steelblock'},
  147. {'default:glass', 'dye:green', 'default:glass'},
  148. {'advtrains:wheel', '', 'advtrains:wheel'},
  149. },
  150. })
  151. minetest.register_craft({
  152. output = 'advtrains:moretrains_engine_japan',
  153. recipe = {
  154. {'default:steelblock', 'default:steelblock', ''},
  155. {'default:glass', 'dye:green', 'default:glass'},
  156. {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
  157. },
  158. })