123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- local S
- if minetest.get_modpath("intllib") then
- S = intllib.Getter()
- else
- S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
- end
- advtrains.register_wagon("engine_electronic", {
- mesh="advtrains_engine_electronic.b3d",
- textures = {"advtrains_engine_electronic.png"},
- drives_on={default=true},
- max_speed=15,
- seats = {
- {
- name=S("Driver Stand (front)"),
- attach_offset={x=0, y=6, z=8},
- view_offset={x=0, y=-3, z=0},
- driving_ctrl_access=true,
- group = "dstand",
- },
- {
- name=S("Driver Stand (back)"),
- attach_offset={x=0, y=-6, z=8},
- view_offset={x=0, y=-3, z=0},
- driving_ctrl_access=true,
- group = "dstand",
- },
- },
- seat_groups = {
- dstand={
- name = "Driver Stand",
- access_to = {},
- },
- },
- assign_to_seat_group = {"dstand"},
- wagon_span=2.1,
- visual_size = {x=1, y=1},
- collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
- is_locomotive=true,
- drops={"advtrains:engine_electronic"},
- horn_sound = "advtrains_engine_diesel_horn",
- custom_on_velocity_change = function(self, velocity, old_velocity, dtime)
- if not velocity or not old_velocity then return end
- if old_velocity == 0 and velocity > 0 then
- minetest.sound_play("advtrains_train_orient_express_engine_throttle", {object = self.object})
- end
- end
-
- }, S("electronic engine"), "advtrains_engine_electronic_inv.png")
- advtrains.register_wagon("wagon_compartment", {
- mesh="advtrains_wagon_compartment.b3d",
- textures = {"advtrains_compartment.png"},
- drives_on={default=true},
- max_speed=15,
- seats = {
- {
- name="1",
- attach_offset={x=2, y=6, z=8},
- view_offset={x=0, y=-4, z=0},
- group="pass",
- },
- {
- name="2",
- attach_offset={x=-1, y=6, z=8},
- view_offset={x=0, y=-4, z=0},
- group="pass",
- },
- {
- name="3",
- attach_offset={x=-4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- {
- name="4",
- attach_offset={x=4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- },
- seat_groups = {
- pass={
- name = "Passenger area",
- access_to = {},
- },
- },
- assign_to_seat_group = {"pass"},
- visual_size = {x=1, y=1},
- wagon_span=2.5,
- collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
- drops={"default:steelblock 4"},
- }, S("Passenger compartment Wagon"), "advtrains_compartment_inv.png")
- advtrains.register_wagon("wagon_compartment_restored", {
- mesh="advtrains_wagon_compartment.b3d",
- textures = {"advtrains_orient_express_restored.png"},
- drives_on={default=true},
- max_speed=15,
- seats = {
- {
- name="1",
- attach_offset={x=2, y=6, z=8},
- view_offset={x=0, y=-4, z=0},
- group="pass",
- },
- {
- name="2",
- attach_offset={x=-1, y=6, z=8},
- view_offset={x=0, y=-4, z=0},
- group="pass",
- },
- {
- name="3",
- attach_offset={x=-4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- {
- name="4",
- attach_offset={x=4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- },
- seat_groups = {
- pass={
- name = "Passenger area",
- access_to = {},
- },
- },
- assign_to_seat_group = {"pass"},
- visual_size = {x=1, y=1},
- wagon_span=2.5,
- collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
- drops={"default:steelblock 4"},
- }, S("Passenger Restored Wagon"), "advtrains_orient_express_restored_inv.png")
- advtrains.register_wagon("wagon_sleep", {
- mesh="advtrains_wagon_sleep.b3d",
- textures = {"advtrains_sleep.png"},
- drives_on={default=true},
- max_speed=15,
- seats = {
- {
- name="1",
- attach_offset={x=2, y=6, z=8},
- view_offset={x=0, y=-2, z=0},
- group="pass",
- },
- {
- name="2",
- attach_offset={x=-1, y=6, z=8},
- view_offset={x=0, y=-4, z=0},
- group="pass",
- },
- {
- name="3",
- attach_offset={x=-4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- {
- name="4",
- attach_offset={x=4, y=8, z=-8},
- view_offset={x=0, y=0, z=0},
- group="pass",
- },
- },
- seat_groups = {
- pass={
- name = "Passenger area",
- access_to = {},
- },
- },
- assign_to_seat_group = {"pass"},
- visual_size = {x=1, y=1},
- wagon_span=2.5,
- collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
- drops={"default:steelblock 4"},
- }, S("Passenger sleeping Wagon"), "advtrains_sleep_inv.png")
|