From c0e50999571d22e9589c4ba973c29f20b54befa2 Mon Sep 17 00:00:00 2001 From: blert2112 Date: Thu, 21 May 2015 19:56:20 -0400 Subject: [PATCH] First commit --- 126r.lua | 29 ++++-- README.md | 9 +- black.lua | 31 +++--- blue.lua | 29 ++++-- boat.lua | 28 +++-- brown.lua | 29 ++++-- cyan.lua | 29 ++++-- dark_green.lua | 29 ++++-- dark_grey.lua | 29 ++++-- depends.txt | 0 f1.lua | 37 ++++--- api.lua => framework.lua | 160 +++++++++++++++++++---------- green.lua | 29 ++++-- grey.lua | 29 ++++-- hot_rod.lua | 29 ++++-- hover_blue.lua | 28 +++-- init.lua | 71 +++++++------ magenta.lua | 29 ++++-- mese_blue.lua | 32 +++--- mese_pink.lua | 32 +++--- mese_purple.lua | 32 +++--- models/boat.x | 0 models/car.x | 0 models/car_126r.x | 0 models/car_126r_render.png | Bin models/car_f1.x | 0 models/car_f1_2.x | 0 models/car_f1_render.png | Bin models/hovercraft.blend | Bin models/hovercraft.x | 0 models/rowboat.x | 0 nyan_ride.lua | 29 ++++-- oerkki_bliss.lua | 29 ++++-- orange.lua | 29 ++++-- pink.lua | 29 ++++-- red.lua | 29 ++++-- road_master.lua | 29 ++++-- rowboat.lua | 37 ++++--- sounds/hovercraft_bounce.ogg | Bin sounds/hovercraft_jump.ogg | Bin sounds/hovercraft_thrust_fade.ogg | Bin sounds/hovercraft_thrust_loop.ogg | Bin template.lua | 31 ++++++ textures/boat_inventory.png | Bin textures/boat_wield.png | Bin textures/car_126r.png | Bin textures/car_126r_inventory.png | Bin textures/car_126r_wield.png | Bin textures/car_black.png | Bin textures/car_blue.png | Bin textures/car_brown.png | Bin textures/car_cyan.png | Bin textures/car_dark_green.png | Bin textures/car_dark_grey.png | Bin textures/car_f1.png | Bin textures/car_f1_inventory.png | Bin textures/car_f1_wield.png | Bin textures/car_green.png | Bin textures/car_grey.png | Bin textures/car_magenta.png | Bin textures/car_orange.png | Bin textures/car_pink.png | Bin textures/car_red.png | Bin textures/car_violet.png | Bin textures/car_white.png | Bin textures/car_yellow.png | Bin textures/hot_rod.png | Bin textures/hovercraft_blue.png | Bin textures/hovercraft_blue_inv.png | Bin textures/hovercraft_green.png | Bin textures/hovercraft_green_inv.png | Bin textures/hovercraft_red.png | Bin textures/hovercraft_red_inv.png | Bin textures/hovercraft_yellow.png | Bin textures/hovercraft_yellow_inv.png | Bin textures/inv_car_black.png | Bin textures/inv_car_blue.png | Bin textures/inv_car_brown.png | Bin textures/inv_car_cyan.png | Bin textures/inv_car_dark_green.png | Bin textures/inv_car_dark_grey.png | Bin textures/inv_car_green.png | Bin textures/inv_car_grey.png | Bin textures/inv_car_magenta.png | Bin textures/inv_car_orange.png | Bin textures/inv_car_pink.png | Bin textures/inv_car_red.png | Bin textures/inv_car_violet.png | Bin textures/inv_car_white.png | Bin textures/inv_car_yellow.png | Bin textures/mesecar_car1back.png | Bin textures/mesecar_car1front.png | Bin textures/mesecar_car1leftside.png | Bin textures/mesecar_car1rightside.png | Bin textures/mesecar_car1top.png | Bin textures/mesecar_car2back.png | Bin textures/mesecar_car2front.png | Bin textures/mesecar_car2leftside.png | Bin textures/mesecar_car2rightside.png | Bin textures/mesecar_car2top.png | Bin textures/mesecar_car3back.png | Bin textures/mesecar_car3front.png | Bin textures/mesecar_car3leftside.png | Bin textures/mesecar_car3rightside.png | Bin textures/mesecar_car3top.png | Bin textures/mesecar_carbase.png | Bin textures/motor.png | Bin textures/nyan_ride.png | Bin textures/oerkki_bliss.png | Bin textures/road_master.png | Bin textures/rowboat_inventory.png | Bin textures/rowboat_wield.png | Bin textures/steel_frame.png | Bin textures/tire.png | Bin textures/windshield.png | Bin violet.lua | 29 ++++-- white.lua | 29 ++++-- yellow.lua | 29 ++++-- 118 files changed, 687 insertions(+), 392 deletions(-) mode change 100644 => 100755 126r.lua mode change 100644 => 100755 README.md mode change 100644 => 100755 black.lua mode change 100644 => 100755 blue.lua mode change 100644 => 100755 boat.lua mode change 100644 => 100755 brown.lua mode change 100644 => 100755 cyan.lua mode change 100644 => 100755 dark_green.lua mode change 100644 => 100755 dark_grey.lua mode change 100644 => 100755 depends.txt mode change 100644 => 100755 f1.lua rename api.lua => framework.lua (63%) mode change 100644 => 100755 green.lua mode change 100644 => 100755 grey.lua mode change 100644 => 100755 hot_rod.lua mode change 100644 => 100755 hover_blue.lua mode change 100644 => 100755 init.lua mode change 100644 => 100755 magenta.lua mode change 100644 => 100755 mese_blue.lua mode change 100644 => 100755 mese_pink.lua mode change 100644 => 100755 mese_purple.lua mode change 100644 => 100755 models/boat.x mode change 100644 => 100755 models/car.x mode change 100644 => 100755 models/car_126r.x mode change 100644 => 100755 models/car_126r_render.png mode change 100644 => 100755 models/car_f1.x mode change 100644 => 100755 models/car_f1_2.x mode change 100644 => 100755 models/car_f1_render.png mode change 100644 => 100755 models/hovercraft.blend mode change 100644 => 100755 models/hovercraft.x mode change 100644 => 100755 models/rowboat.x mode change 100644 => 100755 nyan_ride.lua mode change 100644 => 100755 oerkki_bliss.lua mode change 100644 => 100755 orange.lua mode change 100644 => 100755 pink.lua mode change 100644 => 100755 red.lua mode change 100644 => 100755 road_master.lua mode change 100644 => 100755 rowboat.lua mode change 100644 => 100755 sounds/hovercraft_bounce.ogg mode change 100644 => 100755 sounds/hovercraft_jump.ogg mode change 100644 => 100755 sounds/hovercraft_thrust_fade.ogg mode change 100644 => 100755 sounds/hovercraft_thrust_loop.ogg create mode 100644 template.lua mode change 100644 => 100755 textures/boat_inventory.png mode change 100644 => 100755 textures/boat_wield.png mode change 100644 => 100755 textures/car_126r.png mode change 100644 => 100755 textures/car_126r_inventory.png mode change 100644 => 100755 textures/car_126r_wield.png mode change 100644 => 100755 textures/car_black.png mode change 100644 => 100755 textures/car_blue.png mode change 100644 => 100755 textures/car_brown.png mode change 100644 => 100755 textures/car_cyan.png mode change 100644 => 100755 textures/car_dark_green.png mode change 100644 => 100755 textures/car_dark_grey.png mode change 100644 => 100755 textures/car_f1.png mode change 100644 => 100755 textures/car_f1_inventory.png mode change 100644 => 100755 textures/car_f1_wield.png mode change 100644 => 100755 textures/car_green.png mode change 100644 => 100755 textures/car_grey.png mode change 100644 => 100755 textures/car_magenta.png mode change 100644 => 100755 textures/car_orange.png mode change 100644 => 100755 textures/car_pink.png mode change 100644 => 100755 textures/car_red.png mode change 100644 => 100755 textures/car_violet.png mode change 100644 => 100755 textures/car_white.png mode change 100644 => 100755 textures/car_yellow.png mode change 100644 => 100755 textures/hot_rod.png mode change 100644 => 100755 textures/hovercraft_blue.png mode change 100644 => 100755 textures/hovercraft_blue_inv.png mode change 100644 => 100755 textures/hovercraft_green.png mode change 100644 => 100755 textures/hovercraft_green_inv.png mode change 100644 => 100755 textures/hovercraft_red.png mode change 100644 => 100755 textures/hovercraft_red_inv.png mode change 100644 => 100755 textures/hovercraft_yellow.png mode change 100644 => 100755 textures/hovercraft_yellow_inv.png mode change 100644 => 100755 textures/inv_car_black.png mode change 100644 => 100755 textures/inv_car_blue.png mode change 100644 => 100755 textures/inv_car_brown.png mode change 100644 => 100755 textures/inv_car_cyan.png mode change 100644 => 100755 textures/inv_car_dark_green.png mode change 100644 => 100755 textures/inv_car_dark_grey.png mode change 100644 => 100755 textures/inv_car_green.png mode change 100644 => 100755 textures/inv_car_grey.png mode change 100644 => 100755 textures/inv_car_magenta.png mode change 100644 => 100755 textures/inv_car_orange.png mode change 100644 => 100755 textures/inv_car_pink.png mode change 100644 => 100755 textures/inv_car_red.png mode change 100644 => 100755 textures/inv_car_violet.png mode change 100644 => 100755 textures/inv_car_white.png mode change 100644 => 100755 textures/inv_car_yellow.png mode change 100644 => 100755 textures/mesecar_car1back.png mode change 100644 => 100755 textures/mesecar_car1front.png mode change 100644 => 100755 textures/mesecar_car1leftside.png mode change 100644 => 100755 textures/mesecar_car1rightside.png mode change 100644 => 100755 textures/mesecar_car1top.png mode change 100644 => 100755 textures/mesecar_car2back.png mode change 100644 => 100755 textures/mesecar_car2front.png mode change 100644 => 100755 textures/mesecar_car2leftside.png mode change 100644 => 100755 textures/mesecar_car2rightside.png mode change 100644 => 100755 textures/mesecar_car2top.png mode change 100644 => 100755 textures/mesecar_car3back.png mode change 100644 => 100755 textures/mesecar_car3front.png mode change 100644 => 100755 textures/mesecar_car3leftside.png mode change 100644 => 100755 textures/mesecar_car3rightside.png mode change 100644 => 100755 textures/mesecar_car3top.png mode change 100644 => 100755 textures/mesecar_carbase.png mode change 100644 => 100755 textures/motor.png mode change 100644 => 100755 textures/nyan_ride.png mode change 100644 => 100755 textures/oerkki_bliss.png mode change 100644 => 100755 textures/road_master.png mode change 100644 => 100755 textures/rowboat_inventory.png mode change 100644 => 100755 textures/rowboat_wield.png mode change 100644 => 100755 textures/steel_frame.png mode change 100644 => 100755 textures/tire.png mode change 100644 => 100755 textures/windshield.png mode change 100644 => 100755 violet.lua mode change 100644 => 100755 white.lua mode change 100644 => 100755 yellow.lua diff --git a/126r.lua b/126r.lua old mode 100644 new mode 100755 index 571d3c0..a50922c --- a/126r.lua +++ b/126r.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_126r", { + +local name = "car_126r" + +local definition = { description = "126r car", - is_boat = false, - player_attach_at = {x=-2,y=10,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.6, -0.25, -0.3, 0.6, 1/2, 0.3}, onplace_position_adj = -0.25, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2,y=10,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "car_126r_inventory.png", wield_image = "car_126r_wield.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car_126r.x", - visual_size = {x=1, y=1}, textures = {"car_126r.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-0.6, -0.25, -0.3, 0.6, 1/2, 0.3}, --- back, bottom, port, front, top, starboard -}) \ No newline at end of file + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 255bb37..8cd22ab --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ***Vehicles_mash*** -- version: 1.3 +- version: 1.4 - by blert2112 A merge of all the vehicles from: @@ -10,6 +10,8 @@ A merge of all the vehicles from: - "Hovercraft" by Stuart Jones (experimental and disabled by default) - 26 vehicles currently (27 if you include the experimental hovercraft) +- Certain vehicles can now carry passengers. Currently one passenger max. + - Disable vehicles by commenting out it's 'dofile' line in init.lua - Adding new vehicles is a simple matter of: - create/aquire vehicle model and textures @@ -32,6 +34,11 @@ As far as the work I did... It's really just a fork of a fork of a fork of a for - crafting ***Change Log*** +v1.4 5/19/2015 + - attach (one) passenger added + - reorganized vehicle definition file code and added some variables pertaining to passengers + - added a vehicle definition file template with comments + - cleaned up to remove code dulplication v1.3 5/5/2015 - player now sits forward in vehicles - tweaked player sit positions diff --git a/black.lua b/black.lua old mode 100644 new mode 100755 index c569fb5..aea344d --- a/black.lua +++ b/black.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_black", { + +local name = "car_black" + +local definition = { description = "Black car", - inventory_image = "inv_car_black.png", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, + inventory_image = "inv_car_black.png", wield_image = "inv_car_black.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_black.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/blue.lua b/blue.lua old mode 100644 new mode 100755 index d72565b..d8a8049 --- a/blue.lua +++ b/blue.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_blue", { + +local name = "car_blue" + +local definition = { description = "Blue car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_blue.png", wield_image = "inv_car_blue.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_blue.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/boat.lua b/boat.lua old mode 100644 new mode 100755 index 2166de4..b06fc29 --- a/boat.lua +++ b/boat.lua @@ -1,21 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:boat", { + +local name = "boat" + +local definition = { description = "Boat", - attach_player_at = {x=0,y=11,z=-3}, - player_rotation = {x=0,y=0,z=0}, + collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, + onplace_position_adj = 0, is_boat = true, - drop_on_destroy = "default:wood 3", + player_rotation = {x=0,y=0,z=0}, + driver_attach_at = {x=0,y=11,z=-3}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "boat_inventory.png", wield_image = "boat_wield.png", - wield_scale = {x=2, y=2, z=1}, + wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "boat.x", - visual_size = {x=1, y=1}, textures = {"default_wood.png"}, - stepheight = 0, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0, max_speed_forward = 10, max_speed_reverse = 5, accel = 1, braking = 1, turn_speed = 2, - collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, -}) \ No newline at end of file + drop_on_destroy = "default:wood 3", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/brown.lua b/brown.lua old mode 100644 new mode 100755 index 5ba8016..c680793 --- a/brown.lua +++ b/brown.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_brown", { + +local name = "car_brown" + +local definition = { description = "Brown car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_brown.png", wield_image = "inv_car_brown.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_brown.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/cyan.lua b/cyan.lua old mode 100644 new mode 100755 index 910478e..5e81d0f --- a/cyan.lua +++ b/cyan.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_cyan", { + +local name = "car_cyan" + +local definition = { description = "Cyan car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_cyan.png", wield_image = "inv_car_cyan.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_cyan.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/dark_green.lua b/dark_green.lua old mode 100644 new mode 100755 index de8bb14..6f70489 --- a/dark_green.lua +++ b/dark_green.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_dark_green", { + +local name = "car_dark_green" + +local definition = { description = "Dark green car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_dark_green.png", wield_image = "inv_car_dark_green.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_dark_green.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/dark_grey.lua b/dark_grey.lua old mode 100644 new mode 100755 index 1dd9af9..3987bbb --- a/dark_grey.lua +++ b/dark_grey.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_dark_grey", { + +local name = "car_dark_grey" + +local definition = { description = "Dark grey car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_dark_grey.png", wield_image = "inv_car_dark_grey.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_dark_grey.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/depends.txt b/depends.txt old mode 100644 new mode 100755 diff --git a/f1.lua b/f1.lua old mode 100644 new mode 100755 index c8d15a8..5fd0193 --- a/f1.lua +++ b/f1.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_f1", { + +local name = "car_f1" + +local definition = { description = "F1 car", - is_boat = false, - player_attach_at = {x=-5,y=11,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.7, -0.25, -0.4, 0.7, 0.25, 0.4}, onplace_position_adj = -0.25, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-5,y=11,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "car_f1_inventory.png", wield_image = "car_f1_wield.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car_f1.x", - visual_size = {x=1, y=1}, textures = {"car_f1.png"}, - stepheight = 0.6, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes - max_speed_forward = 20, - max_speed_reverse = 10, - accel = 2, + visual_size = {x=1, y=1}, + stepheight = 0.6, + max_speed_forward = 25, + max_speed_reverse = 15, + accel = 3, braking = 4, - turn_speed = 2, - collisionbox = {-0.7, -0.25, -0.4, 0.7, 0.25, 0.4}, --- back, bottom, port, front, top, starboard -}) \ No newline at end of file + turn_speed = 4, + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/api.lua b/framework.lua similarity index 63% rename from api.lua rename to framework.lua index 7a768e5..10cafd3 100644 --- a/api.lua +++ b/framework.lua @@ -29,47 +29,101 @@ local function is_water(pos) return minetest.get_item_group(nn, "water") ~= 0 end -function vehicle_mash:register_car(name, def) +local function AttachPlayer(self, clicker, is_driver) + local pname = clicker:get_player_name() + local attach_at + if is_driver then + attach_at = self.driver_attach_at + else + attach_at = self.passenger_attach_at + clicker:set_eye_offset(self.passenger_eye_offset, {x=0, y=0, z=0}) + end + clicker:set_attach(self.object, "", attach_at, self.player_rotation) + default.player_attached[pname] = true + minetest.after(0.2, function() + default.player_set_animation(clicker, "sit" , 30) + end) + if self.is_boat then + self.object:setyaw(clicker:get_look_yaw() - math.pi/2) + else + self.object:setyaw(clicker:get_look_yaw()) + end + return clicker +end + +local function DetachPlayer(self, clicker, is_driver) + local pname = clicker:get_player_name() + clicker:set_detach() + default.player_attached[pname] = false + default.player_set_animation(clicker, "stand" , 30) + if not is_driver then + clicker:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0}) + end + return nil +end + +function vehicle_mash:register_vehicle(name, def) minetest.register_entity(name, { - textures = def.textures, - name = name, - physical = true, collisionbox = def.collisionbox, + is_boat = def.is_boat, + player_rotation = def.player_rotation, + driver_attach_at = def.driver_attach_at, + driver_detach_pos_offset = def.driver_detach_pos_offset, + number_of_passengers = def.number_of_passengers, + passenger_attach_at = def.passenger_attach_at, + passenger_eye_offset = def.passenger_eye_offset, + passenger_detach_pos_offset = def.passenger_detach_pos_offset, visual = def.visual, - visual_size = def.visual_size, mesh = def.mesh, + textures = def.textures, + tiles = def.tiles, + visual_size = def.visual_size, stepheight = def.stepheight, - driver = nil, - v = 0, - v2 = 0, - mouselook = 1, max_spd_f = def.max_speed_forward, max_spd_r = def.max_speed_reverse, accel = def.accel, braking = def.braking, turn_spd = def.turn_speed, + drop_on_destroy = def.drop_on_destroy, + driver = nil, + passenge = nil, + v = 0, + v2 = 0, + mouselook = 1, + physical = true, + removed = false, on_rightclick = function(self, clicker) if not clicker or not clicker:is_player() then return end - local pname = clicker:get_player_name() - if self.driver and clicker == self.driver then - self.driver = nil - clicker:set_detach() - default.player_attached[pname] = false - default.player_set_animation(clicker, "stand" , 30) - elseif not self.driver then - self.driver = clicker - clicker:set_attach(self.object, "", def.player_attach_at, def.player_rotation) - default.player_attached[pname] = true - minetest.after(0.2, function() - default.player_set_animation(clicker, "sit" , 30) - end) - if def.is_boat then - self.object:setyaw(clicker:get_look_yaw() - math.pi/2) + -- if there is already a driver + if self.driver then + -- if clicker is driver detach passenger and driver + if clicker == self.driver then + -- if passenger detach first + if self.passenger then + self.passenger = DetachPlayer(self, self.passenger, false) + end + -- detach driver + self.driver = DetachPlayer(self, clicker, true) + -- if clicker is not the driver else - self.object:setyaw(clicker:get_look_yaw()) + -- if clicker is pasenger + if clicker == self.passenger then + -- detach passenger + self.passenger = DetachPlayer(self, clicker, false) + -- if clicker is not passenger + else + -- attach passenger if possible + if not self.passenger and self.number_of_passengers > 0 then + self.passenger = AttachPlayer(self, clicker, false) + end + end end + -- if there is no driver + else + -- attach driver + self.driver = AttachPlayer(self, clicker, true) end end, on_activate = function(self, staticdata, dtime_s) @@ -82,25 +136,16 @@ function vehicle_mash:register_car(name, def) get_staticdata = function(self) return tostring(self.v) end, - on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, direction) - if not puncher or not puncher:is_player() or self.removed then + on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir) + if not puncher or not puncher:is_player() or self.removed or self.driver then return end - if self.driver and puncher == self.driver then - self.driver = nil - puncher:set_detach() - default.player_attached[puncher:get_player_name()] = false - end - if not self.driver then - self.removed = true - -- delay remove to ensure player is detached - minetest.after(0.1, function() - self.object:remove() - end) - if not minetest.setting_getbool("creative_mode") then - puncher:get_inventory():add_item("main", self.name) - end - end + self.removed = true + -- delay remove to ensure player is detached + minetest.after(0.1, function() + self.object:remove() + end) + puncher:get_inventory():add_item("main", self.name) end, on_step = function(self, dtime) -- Acelerating, braking, and rotating @@ -160,7 +205,7 @@ function vehicle_mash:register_car(name, def) local new_velo = {x = 0, y = 0, z = 0} local new_acce = {x = 0, y = 0, z = 0} - if def.is_boat then + if self.is_boat then p.y = p.y - 0.5 if not is_water(p) then local nodedef = minetest.registered_nodes[minetest.get_node(p).name] @@ -206,24 +251,22 @@ function vehicle_mash:register_car(name, def) end self.object:setvelocity(new_velo) self.object:setacceleration(new_acce) - - if def.is_boat then + if self.is_boat then -- if boat comes to sudden stop then it has crashed, destroy boat and drop 3x wood if self.v2 - self.v >= 3 then if self.driver then - local name = self.driver:get_player_name() - self.driver:set_detach() - default.player_attached[name] = false - default.player_set_animation(self.driver, "stand" , 30) + self.driver = DetachPlayer(self, self.driver, true) end local pos = self.object:getpos() self.object:remove() - minetest.add_item(pos, def.drop_on_destroy) + minetest.add_item(pos, self.drop_on_destroy) end self.v2 = self.v end - end, + end }) + + local onplace_position_adj = def.onplace_position_adj minetest.register_craftitem(name, { description = def.description, inventory_image = def.inventory_image, @@ -235,21 +278,24 @@ function vehicle_mash:register_car(name, def) return end if def.is_boat then - if not is_water(pointed_thing.under) then + if is_water(pointed_thing.under) then + pointed_thing.under.y = pointed_thing.under.y + 0.5 + minetest.add_entity(pointed_thing.under, name) + else return end - pointed_thing.under.y = pointed_thing.under.y + 0.5 - minetest.add_entity(pointed_thing.under, name) else - pointed_thing.above.y = pointed_thing.above.y + def.onplace_position_adj + pointed_thing.above.y = pointed_thing.above.y + onplace_position_adj minetest.env:add_entity(pointed_thing.above, name) end itemstack:take_item() return itemstack - end, + end }) + -- minetest.register_craft({ -- output = name, --- recipe = def.recipe, +-- recipe = def.recipe -- }) end + diff --git a/green.lua b/green.lua old mode 100644 new mode 100755 index 2e6c8e9..ced4fdf --- a/green.lua +++ b/green.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_green", { + +local name = "car_green" + +local definition = { description = "Green car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_green.png", wield_image = "inv_car_green.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_green.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/grey.lua b/grey.lua old mode 100644 new mode 100755 index 14e5433..1f23cc1 --- a/grey.lua +++ b/grey.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_grey", { + +local name = "car_grey" + +local definition = { description = "Grey car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_grey.png", wield_image = "inv_car_grey.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_grey.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/hot_rod.lua b/hot_rod.lua old mode 100644 new mode 100755 index 9d1e00d..5cda56a --- a/hot_rod.lua +++ b/hot_rod.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_hot_rod", { + +local name = "car_hot_rod" + +local definition = { description = "Hot Rod car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_red.png", wield_image = "inv_car_red.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"hot_rod.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/hover_blue.lua b/hover_blue.lua old mode 100644 new mode 100755 index 90906e1..149e7d1 --- a/hover_blue.lua +++ b/hover_blue.lua @@ -1,23 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:hover_blue", { + +local name = "hover_blue" + +local definition = { description = "Blue hovercraft", - is_boat = false, - player_attach_at = {x=-2,y=16.5,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.8,0,-0.8, 0.8,1.2,0.8}, onplace_position_adj = 0, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2,y=16.5,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "hovercraft_blue_inv.png", wield_image = "hovercraft_blue_inv.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "hovercraft.x", - visual_size = {x=1, y=1}, textures = {"hovercraft_blue.png"}, - stepheight = 0.6, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0.6, max_speed_forward = 12, max_speed_reverse = 0, accel = 2.5, braking = 1, turn_speed = 2, - collisionbox = {-0.8,0,-0.8, 0.8,1.2,0.8}, -}) \ No newline at end of file + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/init.lua b/init.lua old mode 100644 new mode 100755 index 31170c8..1f2bf59 --- a/init.lua +++ b/init.lua @@ -1,35 +1,48 @@ --- Cars Api -dofile(minetest.get_modpath("vehicle_mash").."/api.lua") + +-- settings + +-- end settings + +-- get mod path +local mpath = minetest.get_modpath("vehicle_mash") + +-- load framework +dofile(mpath.."/framework.lua") + + +-- *********************** +-- load vehicles down here +-- *********************** -- Cars -dofile(minetest.get_modpath("vehicle_mash").."/126r.lua") -dofile(minetest.get_modpath("vehicle_mash").."/f1.lua") -dofile(minetest.get_modpath("vehicle_mash").."/black.lua") -dofile(minetest.get_modpath("vehicle_mash").."/blue.lua") -dofile(minetest.get_modpath("vehicle_mash").."/brown.lua") -dofile(minetest.get_modpath("vehicle_mash").."/cyan.lua") -dofile(minetest.get_modpath("vehicle_mash").."/dark_green.lua") -dofile(minetest.get_modpath("vehicle_mash").."/dark_grey.lua") -dofile(minetest.get_modpath("vehicle_mash").."/green.lua") -dofile(minetest.get_modpath("vehicle_mash").."/grey.lua") -dofile(minetest.get_modpath("vehicle_mash").."/magenta.lua") -dofile(minetest.get_modpath("vehicle_mash").."/orange.lua") -dofile(minetest.get_modpath("vehicle_mash").."/pink.lua") -dofile(minetest.get_modpath("vehicle_mash").."/red.lua") -dofile(minetest.get_modpath("vehicle_mash").."/violet.lua") -dofile(minetest.get_modpath("vehicle_mash").."/white.lua") -dofile(minetest.get_modpath("vehicle_mash").."/yellow.lua") -dofile(minetest.get_modpath("vehicle_mash").."/hot_rod.lua") -dofile(minetest.get_modpath("vehicle_mash").."/nyan_ride.lua") -dofile(minetest.get_modpath("vehicle_mash").."/oerkki_bliss.lua") -dofile(minetest.get_modpath("vehicle_mash").."/road_master.lua") -dofile(minetest.get_modpath("vehicle_mash").."/mese_blue.lua") -dofile(minetest.get_modpath("vehicle_mash").."/mese_pink.lua") -dofile(minetest.get_modpath("vehicle_mash").."/mese_purple.lua") +dofile(mpath.."/126r.lua") +dofile(mpath.."/f1.lua") +dofile(mpath.."/black.lua") +dofile(mpath.."/blue.lua") +dofile(mpath.."/brown.lua") +dofile(mpath.."/cyan.lua") +dofile(mpath.."/dark_green.lua") +dofile(mpath.."/dark_grey.lua") +dofile(mpath.."/green.lua") +dofile(mpath.."/grey.lua") +dofile(mpath.."/magenta.lua") +dofile(mpath.."/orange.lua") +dofile(mpath.."/pink.lua") +dofile(mpath.."/red.lua") +dofile(mpath.."/violet.lua") +dofile(mpath.."/white.lua") +dofile(mpath.."/yellow.lua") +dofile(mpath.."/hot_rod.lua") +dofile(mpath.."/nyan_ride.lua") +dofile(mpath.."/oerkki_bliss.lua") +dofile(mpath.."/road_master.lua") +dofile(mpath.."/mese_blue.lua") +dofile(mpath.."/mese_pink.lua") +dofile(mpath.."/mese_purple.lua") -- Boats -dofile(minetest.get_modpath("vehicle_mash").."/boat.lua") -dofile(minetest.get_modpath("vehicle_mash").."/rowboat.lua") +dofile(mpath.."/boat.lua") +dofile(mpath.."/rowboat.lua") -- Hovercraft ---dofile(minetest.get_modpath("vehicle_mash").."/hover_blue.lua") +--dofile(mpath.."/hover_blue.lua") diff --git a/magenta.lua b/magenta.lua old mode 100644 new mode 100755 index 98660e2..15ca57c --- a/magenta.lua +++ b/magenta.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_magenta", { + +local name = "car_magenta" + +local definition = { description = "Magenta car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_magenta.png", wield_image = "inv_car_magenta.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_magenta.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/mese_blue.lua b/mese_blue.lua old mode 100644 new mode 100755 index 6fd4cc6..0e6ecf6 --- a/mese_blue.lua +++ b/mese_blue.lua @@ -1,30 +1,38 @@ -vehicle_mash:register_car("vehicle_mash:mesecar_blue", { + +local name = "mesecar_blue" + +local definition = { description = "Mesecar blue", - is_boat = false, - player_attach_at = {x=-2.1,y=3,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, onplace_position_adj = 0.25, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2.1,y=3,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "mesecar_car1front.png", wield_image = "mesecar_car1front.png", wield_scale = {x=1, y=1, z=1}, visual = "cube", mesh = "", - visual_size = {x=1.5, y=1.5}, - textures = { -- top base front back left right + textures = { "mesecar_car1top.png", "mesecar_carbase.png", "mesecar_car1front.png", "mesecar_car1back.png", "mesecar_car1leftside.png", - "mesecar_car1rightside.png", + "mesecar_car1rightside.png" }, - stepheight = 0.6, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0.6, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, -}) \ No newline at end of file + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/mese_pink.lua b/mese_pink.lua old mode 100644 new mode 100755 index 73b4397..e3f618f --- a/mese_pink.lua +++ b/mese_pink.lua @@ -1,30 +1,38 @@ -vehicle_mash:register_car("vehicle_mash:mesecar_pink", { + +local name = "mesecar_pink" + +local definition = { description = "Mesecar pink", - is_boat = false, - player_attach_at = {x=-2.1,y=3,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, onplace_position_adj = 0.25, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2.1,y=3,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "mesecar_car3front.png", wield_image = "mesecar_car3front.png", wield_scale = {x=1, y=1, z=1}, visual = "cube", mesh = "", - visual_size = {x=1.5, y=1.5}, - textures = { -- top base front back left right + textures = { "mesecar_car3top.png", "mesecar_carbase.png", "mesecar_car3front.png", "mesecar_car3back.png", "mesecar_car3leftside.png", - "mesecar_car3rightside.png", + "mesecar_car3rightside.png" }, - stepheight = 0.6, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0.6, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, -}) \ No newline at end of file + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/mese_purple.lua b/mese_purple.lua old mode 100644 new mode 100755 index 1867983..dd284af --- a/mese_purple.lua +++ b/mese_purple.lua @@ -1,30 +1,38 @@ -vehicle_mash:register_car("vehicle_mash:mesecar_purple", { + +local name = "mesecar_purple" + +local definition = { description = "Mesecar purple", - is_boat = false, - player_attach_at = {x=-2.1,y=3,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, onplace_position_adj = 0.25, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2.1,y=3,z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "mesecar_car2front.png", wield_image = "mesecar_car2front.png", wield_scale = {x=1, y=1, z=1}, visual = "cube", mesh = "", - visual_size = {x=1.5, y=1.5}, - textures = { -- top base front back left right + textures = { "mesecar_car2top.png", "mesecar_carbase.png", "mesecar_car2front.png", "mesecar_car2back.png", "mesecar_car2leftside.png", - "mesecar_car2rightside.png", + "mesecar_car2rightside.png" }, - stepheight = 0.6, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0.6, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, -}) \ No newline at end of file + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/models/boat.x b/models/boat.x old mode 100644 new mode 100755 diff --git a/models/car.x b/models/car.x old mode 100644 new mode 100755 diff --git a/models/car_126r.x b/models/car_126r.x old mode 100644 new mode 100755 diff --git a/models/car_126r_render.png b/models/car_126r_render.png old mode 100644 new mode 100755 diff --git a/models/car_f1.x b/models/car_f1.x old mode 100644 new mode 100755 diff --git a/models/car_f1_2.x b/models/car_f1_2.x old mode 100644 new mode 100755 diff --git a/models/car_f1_render.png b/models/car_f1_render.png old mode 100644 new mode 100755 diff --git a/models/hovercraft.blend b/models/hovercraft.blend old mode 100644 new mode 100755 diff --git a/models/hovercraft.x b/models/hovercraft.x old mode 100644 new mode 100755 diff --git a/models/rowboat.x b/models/rowboat.x old mode 100644 new mode 100755 diff --git a/nyan_ride.lua b/nyan_ride.lua old mode 100644 new mode 100755 index 840cf44..6c32f33 --- a/nyan_ride.lua +++ b/nyan_ride.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_nyan_ride", { + +local name = "car_nyan_ride" + +local definition = { description = "Nyan Ride car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_pink.png", wield_image = "inv_car_pink.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"nyan_ride.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/oerkki_bliss.lua b/oerkki_bliss.lua old mode 100644 new mode 100755 index 79d16b7..c06c1c9 --- a/oerkki_bliss.lua +++ b/oerkki_bliss.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_oerkki_bliss", { + +local name = "car_oerkki_bliss" + +local definition = { description = "Oerkki Bliss car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_black.png", wield_image = "inv_car_black.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"oerkki_bliss.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/orange.lua b/orange.lua old mode 100644 new mode 100755 index 6a04091..17f191e --- a/orange.lua +++ b/orange.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_orange", { + +local name = "car_orange" + +local definition = { description = "Orange car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_orange.png", wield_image = "inv_car_orange.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_orange.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/pink.lua b/pink.lua old mode 100644 new mode 100755 index d4195fe..482e107 --- a/pink.lua +++ b/pink.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_pink", { + +local name = "car_pink" + +local definition = { description = "Pink car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_pink.png", wield_image = "inv_car_pink.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_pink.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/red.lua b/red.lua old mode 100644 new mode 100755 index da9e3e5..0fcad64 --- a/red.lua +++ b/red.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_red", { + +local name = "car_red" + +local definition = { description = "Red car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_red.png", wield_image = "inv_car_red.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_red.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/road_master.lua b/road_master.lua old mode 100644 new mode 100755 index f98f853..d1446b3 --- a/road_master.lua +++ b/road_master.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_road_master", { + +local name = "car_road_master" + +local definition = { description = "Road Master car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_brown.png", wield_image = "inv_car_brown.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"road_master.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/rowboat.lua b/rowboat.lua old mode 100644 new mode 100755 index 55c0937..d3ee25f --- a/rowboat.lua +++ b/rowboat.lua @@ -1,26 +1,35 @@ -vehicle_mash:register_car("vehicle_mash:rowboat", { + +local name = "rowboat" + +local definition = { description = "Rowboat", - attach_player_at = {x=0,y=11,z=-3}, - player_rotation = {x=0,y=0,z=0}, + collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, + onplace_position_adj = 0, is_boat = true, - drop_on_destroy = "default:wood 3", - recipe = { - {"", "", "" }, - {"group:wood", "", "group:wood"}, - {"group:wood", "group:wood", "group:wood"}, - }, + player_rotation = {x=0,y=0,z=0}, + driver_attach_at = {x=0,y=11,z=-3}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, inventory_image = "rowboat_inventory.png", wield_image = "rowboat_wield.png", - wield_scale = {x=2, y=2, z=1}, + wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "rowboat.x", - visual_size = {x=1, y=1}, textures = {"default_wood.png"}, - stepheight = 0, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 0, max_speed_forward = 10, max_speed_reverse = 5, accel = 1, braking = 1, turn_speed = 2, - collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, -}) \ No newline at end of file + drop_on_destroy = "default:wood 3", + recipe = { + {"", "", "" }, + {"group:wood", "", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + } +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/sounds/hovercraft_bounce.ogg b/sounds/hovercraft_bounce.ogg old mode 100644 new mode 100755 diff --git a/sounds/hovercraft_jump.ogg b/sounds/hovercraft_jump.ogg old mode 100644 new mode 100755 diff --git a/sounds/hovercraft_thrust_fade.ogg b/sounds/hovercraft_thrust_fade.ogg old mode 100644 new mode 100755 diff --git a/sounds/hovercraft_thrust_loop.ogg b/sounds/hovercraft_thrust_loop.ogg old mode 100644 new mode 100755 diff --git a/template.lua b/template.lua new file mode 100644 index 0000000..728db8e --- /dev/null +++ b/template.lua @@ -0,0 +1,31 @@ +local name = "car_template" -- mod name of vehicle + +local definition = { + description = "Template car", -- name as seen in inventory + collisionbox = {0, 0, 0, 0, 0, 0}, -- back, bottom, starboard, front, top, port + onplace_position_adj = 0, -- adjust placement position up/down + is_boat = false, -- does vehicle travel on water? + player_rotation = {x=0,y=0,z=0}, -- rotate player so they sit facing the correct direction + driver_attach_at = {x=0,y=0,z=0}, -- attach the driver at + number_of_passengers = 0, -- testing: 0 for none, do not increase at this time! + passenger_attach_at = {x=0,y=0,z=0}, -- attach the passenger, if applicable, at + passenger_eye_offset = {x=0, y=0, z=0}, -- offset for first person passenger view + inventory_image = "filename.png", -- image to use in inventory + wield_image = "filename.png", -- image to use in hand + wield_scale = {x=1, y=1, z=1}, -- + visual = "mesh", -- what type of object (mesh, cube, etc...) + mesh = "filename.ext", -- mesh model to use + textures = {"filename.png"}, -- mesh texture(s) + visual_size = {x=1, y=1}, -- adjust vehicle size + stepheight = 0, -- what can the vehicle climb over?, 0.6 = climb slabs, 1.1 = climb nodes + max_speed_forward = 10, -- vehicle maximum forward speed + max_speed_reverse = 5, -- vehicle maximum reverse speed + accel = 1, -- how fast vehicle accelerates + braking = 2, -- how fast can the vehicle stop + turn_speed = 2, -- how quick can the vehicle turn + drop_on_destroy = "", -- what gets dropped when vehicle is destroyed + recipe = {} -- crafting recipe +} + +-- nothing to change down here +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/textures/boat_inventory.png b/textures/boat_inventory.png old mode 100644 new mode 100755 diff --git a/textures/boat_wield.png b/textures/boat_wield.png old mode 100644 new mode 100755 diff --git a/textures/car_126r.png b/textures/car_126r.png old mode 100644 new mode 100755 diff --git a/textures/car_126r_inventory.png b/textures/car_126r_inventory.png old mode 100644 new mode 100755 diff --git a/textures/car_126r_wield.png b/textures/car_126r_wield.png old mode 100644 new mode 100755 diff --git a/textures/car_black.png b/textures/car_black.png old mode 100644 new mode 100755 diff --git a/textures/car_blue.png b/textures/car_blue.png old mode 100644 new mode 100755 diff --git a/textures/car_brown.png b/textures/car_brown.png old mode 100644 new mode 100755 diff --git a/textures/car_cyan.png b/textures/car_cyan.png old mode 100644 new mode 100755 diff --git a/textures/car_dark_green.png b/textures/car_dark_green.png old mode 100644 new mode 100755 diff --git a/textures/car_dark_grey.png b/textures/car_dark_grey.png old mode 100644 new mode 100755 diff --git a/textures/car_f1.png b/textures/car_f1.png old mode 100644 new mode 100755 diff --git a/textures/car_f1_inventory.png b/textures/car_f1_inventory.png old mode 100644 new mode 100755 diff --git a/textures/car_f1_wield.png b/textures/car_f1_wield.png old mode 100644 new mode 100755 diff --git a/textures/car_green.png b/textures/car_green.png old mode 100644 new mode 100755 diff --git a/textures/car_grey.png b/textures/car_grey.png old mode 100644 new mode 100755 diff --git a/textures/car_magenta.png b/textures/car_magenta.png old mode 100644 new mode 100755 diff --git a/textures/car_orange.png b/textures/car_orange.png old mode 100644 new mode 100755 diff --git a/textures/car_pink.png b/textures/car_pink.png old mode 100644 new mode 100755 diff --git a/textures/car_red.png b/textures/car_red.png old mode 100644 new mode 100755 diff --git a/textures/car_violet.png b/textures/car_violet.png old mode 100644 new mode 100755 diff --git a/textures/car_white.png b/textures/car_white.png old mode 100644 new mode 100755 diff --git a/textures/car_yellow.png b/textures/car_yellow.png old mode 100644 new mode 100755 diff --git a/textures/hot_rod.png b/textures/hot_rod.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_blue.png b/textures/hovercraft_blue.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_blue_inv.png b/textures/hovercraft_blue_inv.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_green.png b/textures/hovercraft_green.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_green_inv.png b/textures/hovercraft_green_inv.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_red.png b/textures/hovercraft_red.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_red_inv.png b/textures/hovercraft_red_inv.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_yellow.png b/textures/hovercraft_yellow.png old mode 100644 new mode 100755 diff --git a/textures/hovercraft_yellow_inv.png b/textures/hovercraft_yellow_inv.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_black.png b/textures/inv_car_black.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_blue.png b/textures/inv_car_blue.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_brown.png b/textures/inv_car_brown.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_cyan.png b/textures/inv_car_cyan.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_dark_green.png b/textures/inv_car_dark_green.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_dark_grey.png b/textures/inv_car_dark_grey.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_green.png b/textures/inv_car_green.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_grey.png b/textures/inv_car_grey.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_magenta.png b/textures/inv_car_magenta.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_orange.png b/textures/inv_car_orange.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_pink.png b/textures/inv_car_pink.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_red.png b/textures/inv_car_red.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_violet.png b/textures/inv_car_violet.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_white.png b/textures/inv_car_white.png old mode 100644 new mode 100755 diff --git a/textures/inv_car_yellow.png b/textures/inv_car_yellow.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car1back.png b/textures/mesecar_car1back.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car1front.png b/textures/mesecar_car1front.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car1leftside.png b/textures/mesecar_car1leftside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car1rightside.png b/textures/mesecar_car1rightside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car1top.png b/textures/mesecar_car1top.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car2back.png b/textures/mesecar_car2back.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car2front.png b/textures/mesecar_car2front.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car2leftside.png b/textures/mesecar_car2leftside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car2rightside.png b/textures/mesecar_car2rightside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car2top.png b/textures/mesecar_car2top.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car3back.png b/textures/mesecar_car3back.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car3front.png b/textures/mesecar_car3front.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car3leftside.png b/textures/mesecar_car3leftside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car3rightside.png b/textures/mesecar_car3rightside.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_car3top.png b/textures/mesecar_car3top.png old mode 100644 new mode 100755 diff --git a/textures/mesecar_carbase.png b/textures/mesecar_carbase.png old mode 100644 new mode 100755 diff --git a/textures/motor.png b/textures/motor.png old mode 100644 new mode 100755 diff --git a/textures/nyan_ride.png b/textures/nyan_ride.png old mode 100644 new mode 100755 diff --git a/textures/oerkki_bliss.png b/textures/oerkki_bliss.png old mode 100644 new mode 100755 diff --git a/textures/road_master.png b/textures/road_master.png old mode 100644 new mode 100755 diff --git a/textures/rowboat_inventory.png b/textures/rowboat_inventory.png old mode 100644 new mode 100755 diff --git a/textures/rowboat_wield.png b/textures/rowboat_wield.png old mode 100644 new mode 100755 diff --git a/textures/steel_frame.png b/textures/steel_frame.png old mode 100644 new mode 100755 diff --git a/textures/tire.png b/textures/tire.png old mode 100644 new mode 100755 diff --git a/textures/windshield.png b/textures/windshield.png old mode 100644 new mode 100755 diff --git a/violet.lua b/violet.lua old mode 100644 new mode 100755 index 661b4a1..8efbb7b --- a/violet.lua +++ b/violet.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_violet", { + +local name = "car_violet" + +local definition = { description = "Violet car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_violet.png", wield_image = "inv_car_violet.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_violet.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/white.lua b/white.lua old mode 100644 new mode 100755 index ebb16da..1fc23fb --- a/white.lua +++ b/white.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_white", { + +local name = "car_white" + +local definition = { description = "White car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_white.png", wield_image = "inv_car_white.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_white.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition) diff --git a/yellow.lua b/yellow.lua old mode 100644 new mode 100755 index d4e5c4d..d423c1a --- a/yellow.lua +++ b/yellow.lua @@ -1,24 +1,31 @@ -vehicle_mash:register_car("vehicle_mash:car_yellow", { + +local name = "car_yellow" + +local definition = { description = "Yellow car", - is_boat = false, - player_attach_at = {x=0,y=12,z=0}, - player_rotation = {x=0,y=90,z=0}, + collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, onplace_position_adj = -0.45, - drop_on_destroy = "", - recipe = {}, + is_boat = false, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=0,y=12,z=0}, + number_of_passengers = 1, + passenger_attach_at = {x=0,y=12,z=-8}, + passenger_eye_offset = {x=8, y=0, z=0}, inventory_image = "inv_car_yellow.png", wield_image = "inv_car_yellow.png", wield_scale = {x=1, y=1, z=1}, visual = "mesh", mesh = "car.x", - visual_size = {x=1, y=1}, textures = {"car_yellow.png"}, - stepheight = 1.1, -- Stepheight, 0.6 = climb slabs, 1.1 = climb nodes + visual_size = {x=1, y=1}, + stepheight = 1.1, max_speed_forward = 20, max_speed_reverse = 10, accel = 2, braking = 4, turn_speed = 2, - collisionbox = {-1.6, -0.05, -1.3, 1.0, 1, 0.5}, --- back, bottom, starboard, front, top, port -}) + drop_on_destroy = "", + recipe = {} +} + +vehicle_mash:register_vehicle("vehicle_mash:"..name, definition)