init.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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("engine_railbus", {
  8. mesh="advtrains_railbus.b3d",
  9. textures = {"advtrains_railbus.png"},
  10. drives_on={default=true},
  11. max_speed=20,
  12. seats = {
  13. {
  14. name=S("Driver stand"),
  15. attach_offset={x=0, y=8, z=13},
  16. view_offset={x=0, y=0, z=0},
  17. driving_ctrl_access=true,
  18. group="dstand",
  19. },
  20. {
  21. name="1",
  22. attach_offset={x=-4, y=8, z=0},
  23. view_offset={x=0, y=0, z=0},
  24. group="pass",
  25. },
  26. {
  27. name="2",
  28. attach_offset={x=4, y=8, z=0},
  29. view_offset={x=0, y=0, z=0},
  30. group="pass",
  31. },
  32. {
  33. name="3",
  34. attach_offset={x=-4, y=8, z=-8},
  35. view_offset={x=0, y=0, z=0},
  36. group="pass",
  37. },
  38. {
  39. name="4",
  40. attach_offset={x=4, y=8, z=-8},
  41. view_offset={x=0, y=0, z=0},
  42. group="pass",
  43. },
  44. },
  45. seat_groups = {
  46. dstand={
  47. name = "Driver Stand",
  48. access_to = {"pass"},
  49. require_doors_open=true,
  50. driving_ctrl_access=true,
  51. },
  52. pass={
  53. name = "Passenger area",
  54. access_to = {"dstand"},
  55. require_doors_open=true,
  56. },
  57. },
  58. assign_to_seat_group = {"dstand", "pass"},
  59. door_entry={-1},
  60. visual_size = {x=1, y=1},
  61. wagon_span=2.5,
  62. is_locomotive=true,
  63. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  64. drops={"advtrains:engine_railbus"},
  65. }, S("railbus"), "advtrains_railbus_inv.png")