template.lua 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. local name = "car_template" -- mod name of vehicle
  2. local definition = {
  3. terrain_type = 1, -- 0 = air, 1 = land, 2 = liquid, 3 = land + liquid
  4. description = "Template car", -- name as seen in inventory
  5. collisionbox = {0, 0, 0, 0, 0, 0}, -- back, bottom, starboard, front, top, port
  6. onplace_position_adj = 0, -- adjust placement position up/down
  7. enable_crash = true, -- whether to destroy the vehicle when going too fast and crashes with a block or not
  8. can_fly = false, -- if enabled, the specified vehicle will be able to fly around
  9. can_go_down = false, -- applies only when `can_fly` is enabled
  10. can_go_up = false, -- applies only when `can_fly` is enabled
  11. player_rotation = {x=0,y=0,z=0}, -- rotate player so they sit facing the correct direction
  12. driver_attach_at = {x=0,y=0,z=0}, -- attach the driver at
  13. driver_eye_offset = {x=0, y=0, z=0}, -- offset for first person driver view
  14. number_of_passengers = 0, -- maximum number of passengers. Can have 3 passengers maximum
  15. passenger_attach_at = {x=0,y=0,z=0}, -- attach the 1st passenger, if applicable, at the specified positions
  16. passenger_eye_offset = {x=0, y=0, z=0}, -- offset for the 1st passenger in first-person view
  17. passenger_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 1st passenger when they leave the vehicle
  18. passenger2_attach_at = {x=0,y=0,z=0}, -- attach the 2nd passenger, if applicable, at the specified positions
  19. passenger2_eye_offset = {x=0,y=0,z=0}, -- offset for the 2nd passenger in first-person view
  20. passenger2_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 2nd passenger when they leave the vehicle
  21. passenger3_attach_at = {x=0,y=0,z=0}, -- attach the 3rd passenger, if applicable, at the specified positions
  22. passenger3_eye_offset = {x=0,y=0,z=0}, -- offset for the 3rd passenger in first-person view
  23. passenger3_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 3rd passenger when they leave the vehicle
  24. inventory_image = "filename.png", -- image to use in inventory
  25. wield_image = "filename.png", -- image to use in hand
  26. wield_scale = {x=1, y=1, z=1}, --
  27. visual = "mesh", -- what type of object (mesh, cube, etc...)
  28. mesh = "filename.ext", -- mesh model to use
  29. textures = {"filename.png"}, -- mesh texture(s)
  30. visual_size = {x=1, y=1}, -- adjust vehicle size
  31. stepheight = 0, -- what can the vehicle climb over?, 0.6 = climb slabs, 1.1 = climb nodes
  32. max_speed_forward = 10, -- vehicle maximum forward speed
  33. max_speed_reverse = 5, -- vehicle maximum reverse speed
  34. max_speed_upwards = 5, -- vehicle maximum upwards speed (applies only if `can_fly` is enabled)
  35. max_speed_downwards = 3.5, -- vehicle maximum downwards speed (applies only if `can_fly` is enabled)
  36. accel = 1, -- how fast vehicle accelerates
  37. braking = 2, -- how fast can the vehicle stop
  38. turn_speed = 2, -- how quick can the vehicle turn
  39. drop_on_destroy = {""}, -- what gets dropped when vehicle is destroyed
  40. recipe = {} -- crafting recipe
  41. }
  42. -- nothing to change down here
  43. vehicle_mash.register_vehicle("vehicle_mash:"..name, definition)