init.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. },
  51. pass={
  52. name = "Engenier's area",
  53. access_to = {"dstand"},
  54. require_doors_open=true,
  55. },
  56. },
  57. assign_to_seat_group = {"dstand"},
  58. doors={
  59. open={
  60. [-1]={frames={x=0, y= 20}, time=1},
  61. [1]={frames={x=40, y=60}, time=1}
  62. },
  63. close={
  64. [-1]={frames={x=20, y=40}, time=1},
  65. [1]={frames={x=60, y=80}, time=1}
  66. }
  67. },
  68. door_entry={-1},
  69. visual_size = {x=1, y=1},
  70. wagon_span=3.0,
  71. is_locomotive=true,
  72. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  73. drops={"advtrains_engine_DB_160"},
  74. }, S("DB 160 "), "advtrains_DB_160_inv.png")