init.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_DB_160", {
  8. mesh="advtrains_DB_160.b3d",
  9. textures = {"advtrains_DB_160.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 = "Engineers' area",
  54. access_to = {"dstand"},
  55. require_doors_open=true,
  56. },
  57. },
  58. assign_to_seat_group = {"dstand"},
  59. doors={
  60. open={
  61. [-1]={frames={x=0, y= 20}, time=1},
  62. [1]={frames={x=40, y=60}, time=1}
  63. },
  64. close={
  65. [-1]={frames={x=20, y=40}, time=1},
  66. [1]={frames={x=60, y=80}, time=1}
  67. }
  68. },
  69. door_entry={-1},
  70. visual_size = {x=1, y=1},
  71. wagon_span=3.0,
  72. is_locomotive=true,
  73. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  74. drops={"advtrains:engine_DB_160"},
  75. }, S("DB 160 "), "advtrains_DB_160_inv.png")