Compare commits
11 Commits
fc16e60740
...
5b95630b4e
Author | SHA1 | Date | |
---|---|---|---|
|
5b95630b4e | ||
|
c62f4ae73f | ||
|
7ec209abd9 | ||
|
8ace6437bc | ||
|
cbeb67ba8f | ||
|
daa5845666 | ||
|
6b3141fd69 | ||
|
dbd0d395c6 | ||
|
906402e763 | ||
|
c05f94c1a4 | ||
|
f14cf378ba |
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@ -1,11 +0,0 @@
|
||||
on: [push, pull_request]
|
||||
name: build
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: lint
|
||||
uses: Roang-zero1/factorio-mod-luacheck@master
|
||||
with:
|
||||
luacheckrc_url: ""
|
10
.github/workflows/luacheck.yml
vendored
Normal file
10
.github/workflows/luacheck.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: luacheck
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Luacheck
|
||||
uses: lunarmodules/luacheck@master
|
@ -11,5 +11,5 @@ read_globals = {
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
"minetest", "lib_mount",
|
||||
"core",
|
||||
"core", "vector"
|
||||
}
|
||||
|
@ -7,20 +7,22 @@ Copyright (C) 2019-2022 Panquesito7 (halfpacho@gmail.com) and contributors
|
||||
- <https://forum.minetest.net/viewtopic.php?f=13&t=7407>
|
||||
- License:
|
||||
- No info given in that mod but I am going to assume the credit for the original model goes to:
|
||||
- Melcor and his CAR01 model
|
||||
- Melcor and his CAR01 model (MELKAR)
|
||||
- <https://forum.minetest.net/viewtopic.php?f=9&t=6512>
|
||||
- License: CC-BY-NC-SA
|
||||
- License: [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/)
|
||||
|
||||
- MeseCars from: "Mesecars" by paramat
|
||||
- <https://forum.minetest.net/viewtopic.php?f=11&t=7967>
|
||||
- Licenses: Code WTFPL, textures CC BY-SA
|
||||
|
||||
- Boats from "Boats" by PilzAdam
|
||||
- <https://github.com/PilzAdam/boats>
|
||||
- textures: Zeg9
|
||||
- model: thetoon and Zeg9, modified by PavelS(SokolovPavel)
|
||||
- License: WTFPL
|
||||
- License: [WTFPL](http://www.wtfpl.net/)
|
||||
|
||||
- Hovercraft from "Hovercraft" by Stuart Jones
|
||||
- <https://github.com/stujones11/hovercraft>
|
||||
- Licenses:
|
||||
- textures: CC-BY-SA
|
||||
- sounds: freesound.org
|
||||
|
48
README.md
48
README.md
@ -1,6 +1,6 @@
|
||||
# Vehicle Mash [![Build status](https://github.com/minetest-mods/vehicle_mash/workflows/build/badge.svg)](https://github.com/minetest-mods/vehicle_mash/actions) [![ContentDB](https://content.minetest.net/packages/Panquesito7/vehicle_mash/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/vehicle_mash/)
|
||||
# Vehicle Mash [![LuaCheck status](https://github.com/minetest-mods/vehicle_mash/workflows/luacheck/badge.svg)](https://github.com/minetest-mods/vehicle_mash/actions) [![ContentDB](https://content.minetest.net/packages/Panquesito7/vehicle_mash/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/vehicle_mash/)
|
||||
|
||||
- Current version: 2.3.0
|
||||
- Current version: 2.4.0
|
||||
- By [blert2112](https://github.com/blert2112), and handed over to [Panquesito7](https://github.com/Panquesito7).
|
||||
|
||||
![Screenshot](https://raw.githubusercontent.com/minetest-mods/vehicle_mash/master/screenshot.png)
|
||||
@ -39,14 +39,14 @@ For further information or help, see:\
|
||||
|
||||
## Known issues
|
||||
|
||||
- Attachments incorrectly ordered.
|
||||
- None as of now.
|
||||
|
||||
## License
|
||||
|
||||
Copyright (C) 2015-2016 blert2112 and contributors\
|
||||
Copyright (C) 2019-2022 Panquesito7 (halfpacho@gmail.com) and contributors
|
||||
|
||||
All licenses of previous works, of course, apply. (see credits below)
|
||||
All licenses of previous works, of course, apply (see credits below).
|
||||
As far as the work I did... It's really just a fork of a fork of a fork of a fork, tossed it all into a blender and spun it on puree for a bit. Baked it for a while and set it on the counter to cool. What I mean is, make what you will of it, it matters not to me.
|
||||
|
||||
See [`LICENSE.md`](LICENSE.md) for more information.
|
||||
@ -67,6 +67,14 @@ There are no pending tasks to do yet.
|
||||
|
||||
## Changelog
|
||||
|
||||
v2.4.0 1/12/2022
|
||||
|
||||
- Added new API support for `lib_mount`.
|
||||
- Customizable HP/Armor for all vehicles. Players will be affected.
|
||||
- Short and tweak the code.
|
||||
- Cars can now be killed by players.
|
||||
- Support for 3+ passengers (beta).
|
||||
|
||||
v2.3.0 2/12/2021
|
||||
|
||||
- Improved formatting in `README.md`.
|
||||
@ -149,35 +157,3 @@ v1.0 4/24/2015
|
||||
|
||||
Report bugs or suggest ideas by [creating an issue](https://github.com/minetest-mods/vehicle_mash/issues/new).\
|
||||
If you know how to fix an issue, consider opening a [pull request](https://github.com/minetest-mods/vehicle_mash/compare).
|
||||
|
||||
## Credit where credit is due
|
||||
|
||||
- Black, Blue, Brown, Cyan, Dark Green, Dark Grey, Green, Grey, Magenta, Orange, Pink, Red, Violet, White, Yellow, Hot Rod, Nyan Ride, Oerkki Bliss, and Road Master from: "Car" by Esteban
|
||||
- <https://forum.minetest.net/viewtopic.php?f=13&t=7407>
|
||||
- License:
|
||||
- No info given in that mod but I am going to assume the credit for the original model goes to:
|
||||
- Melcor and his CAR01 model
|
||||
- <https://forum.minetest.net/viewtopic.php?f=9&t=6512>
|
||||
- License: CC-BY-NC-SA
|
||||
|
||||
- MeseCars from: "Mesecars" by paramat
|
||||
- <https://forum.minetest.net/viewtopic.php?f=11&t=7967>
|
||||
- Licenses: Code WTFPL, textures CC BY-SA
|
||||
|
||||
- Boats from "Boats" by PilzAdam
|
||||
- textures: Zeg9
|
||||
- model: thetoon and Zeg9, modified by PavelS(SokolovPavel)
|
||||
- License: WTFPL
|
||||
|
||||
- Hovercraft from "Hovercraft" by Stuart Jones
|
||||
- Licenses:
|
||||
- textures: CC-BY-SA
|
||||
- sounds: freesound.org
|
||||
- Rocket Boost Engine Loop by qubodup - CC0
|
||||
- CARTOON-BING-LOW by kantouth - CC-BY-3.0
|
||||
- All other sounds: Copyright Stuart Jones - CC-BY-SA
|
||||
|
||||
I am sure many others deserve mention.\
|
||||
If you feel left out let me know and I will add you in.
|
||||
|
||||
Enjoy!
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "boat"
|
||||
local definition = ...
|
||||
local craft_check = minetest.settings:get_bool("vehicle_mash.enable_crafts")
|
||||
|
||||
definition.description = "BoatA"
|
||||
definition.description = vehicle_mash.S("BoatA")
|
||||
definition.inventory_image = "boat_inventory.png"
|
||||
definition.wield_image = "boat_wield.png"
|
||||
definition.mesh = "boats_boat.obj"
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "rowboat"
|
||||
local definition = ...
|
||||
local craft_check = minetest.settings:get_bool("vehicle_mash.enable_crafts")
|
||||
|
||||
definition.description = "Rowboat"
|
||||
definition.description = vehicle_mash.S("Rowboat")
|
||||
definition.inventory_image = "rowboat_inventory.png"
|
||||
definition.wield_image = "rowboat_wield.png"
|
||||
definition.mesh = "rowboat.x"
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_black"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Black car"
|
||||
definition.description = vehicle_mash.S("Black car")
|
||||
definition.inventory_image = "inv_car_black.png"
|
||||
definition.wield_image = "inv_car_black.png"
|
||||
definition.textures = {"car_black.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_blue"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Blue car"
|
||||
definition.description = vehicle_mash.S("Blue car")
|
||||
definition.inventory_image = "inv_car_blue.png"
|
||||
definition.wield_image = "inv_car_blue.png"
|
||||
definition.textures = {"car_blue.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_brown"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Brown car"
|
||||
definition.description = vehicle_mash.S("Brown car")
|
||||
definition.inventory_image = "inv_car_brown.png"
|
||||
definition.wield_image = "inv_car_brown.png"
|
||||
definition.textures = {"car_brown.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_cyan"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Cyan car"
|
||||
definition.description = vehicle_mash.S("Cyan car")
|
||||
definition.inventory_image = "inv_car_cyan.png"
|
||||
definition.wield_image = "inv_car_cyan.png"
|
||||
definition.textures = {"car_cyan.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_dark_green"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Dark green car"
|
||||
definition.description = vehicle_mash.S("Dark green car")
|
||||
definition.inventory_image = "inv_car_dark_green.png"
|
||||
definition.wield_image = "inv_car_dark_green.png"
|
||||
definition.textures = {"car_dark_green.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_dark_grey"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Dark grey car"
|
||||
definition.description = vehicle_mash.S("Dark grey car")
|
||||
definition.inventory_image = "inv_car_dark_grey.png"
|
||||
definition.wield_image = "inv_car_dark_grey.png"
|
||||
definition.textures = {"car_dark_grey.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_green"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Green car"
|
||||
definition.description = vehicle_mash.S("Green car")
|
||||
definition.inventory_image = "inv_car_green.png"
|
||||
definition.wield_image = "inv_car_green.png"
|
||||
definition.textures = {"car_green.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_grey"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Grey car"
|
||||
definition.description = vehicle_mash.S("Grey car")
|
||||
definition.inventory_image = "inv_car_grey.png"
|
||||
definition.wield_image = "inv_car_grey.png"
|
||||
definition.textures = {"car_grey.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_hot_rod"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Hot Rod car"
|
||||
definition.description = vehicle_mash.S("Hot Rod car")
|
||||
definition.inventory_image = "inv_car_red.png"
|
||||
definition.wield_image = "inv_car_red.png"
|
||||
definition.textures = {"hot_rod.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_magenta"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Magenta car"
|
||||
definition.description = vehicle_mash.S("Magenta car")
|
||||
definition.inventory_image = "inv_car_magenta.png"
|
||||
definition.wield_image = "inv_car_magenta.png"
|
||||
definition.textures = {"car_magenta.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_nyan_ride"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Nyan Ride car"
|
||||
definition.description = vehicle_mash.S("Nyan Ride car")
|
||||
definition.inventory_image = "inv_car_pink.png"
|
||||
definition.wield_image = "inv_car_pink.png"
|
||||
definition.textures = {"nyan_ride.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_oerkki_bliss"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Oerkki Bliss car"
|
||||
definition.description = vehicle_mash.S("Oerkki Bliss car")
|
||||
definition.inventory_image = "inv_car_black.png"
|
||||
definition.wield_image = "inv_car_black.png"
|
||||
definition.textures = {"oerkki_bliss.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_orange"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Orange car"
|
||||
definition.description = vehicle_mash.S("Orange car")
|
||||
definition.inventory_image = "inv_car_orange.png"
|
||||
definition.wield_image = "inv_car_orange.png"
|
||||
definition.textures = {"car_orange.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_pink"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Pink car"
|
||||
definition.description = vehicle_mash.S("Pink car")
|
||||
definition.inventory_image = "inv_car_pink.png"
|
||||
definition.wield_image = "inv_car_pink.png"
|
||||
definition.textures = {"car_pink.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_red"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Red car"
|
||||
definition.description = vehicle_mash.S("Red car")
|
||||
definition.inventory_image = "inv_car_red.png"
|
||||
definition.wield_image = "inv_car_red.png"
|
||||
definition.textures = {"car_red.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_road_master"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Road Master car"
|
||||
definition.description = vehicle_mash.S("Road Master car")
|
||||
definition.inventory_image = "inv_car_brown.png"
|
||||
definition.wield_image = "inv_car_brown.png"
|
||||
definition.textures = {"road_master.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_violet"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Violet car"
|
||||
definition.description = vehicle_mash.S("Violet car")
|
||||
definition.inventory_image = "inv_car_violet.png"
|
||||
definition.wield_image = "inv_car_violet.png"
|
||||
definition.textures = {"car_violet.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_white"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "White car"
|
||||
definition.description = vehicle_mash.S("White car")
|
||||
definition.inventory_image = "inv_car_white.png"
|
||||
definition.wield_image = "inv_car_white.png"
|
||||
definition.textures = {"car_white.png"}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "car_yellow"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Yellow car"
|
||||
definition.description = vehicle_mash.S("Yellow car")
|
||||
definition.inventory_image = "inv_car_yellow.png"
|
||||
definition.wield_image = "inv_car_yellow.png"
|
||||
definition.textures = {"car_yellow.png"}
|
||||
|
@ -1 +1,6 @@
|
||||
Adds many types of vehicles.
|
||||
Adds many types of vehicles:
|
||||
|
||||
- Normal cars.
|
||||
- Boats.
|
||||
- Hovercrafts.
|
||||
- And mesecars.
|
||||
|
@ -1,7 +1,3 @@
|
||||
|
||||
vehicle_mash = {}
|
||||
local drive = lib_mount.drive
|
||||
|
||||
function vehicle_mash.register_vehicle(name, def)
|
||||
minetest.register_entity(name, {
|
||||
terrain_type = def.terrain_type,
|
||||
@ -14,17 +10,8 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
driver_eye_offset = def.driver_eye_offset,
|
||||
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,
|
||||
|
||||
passenger2_attach_at = def.passenger2_attach_at,
|
||||
passenger2_eye_offset = def.passenger2_eye_offset,
|
||||
passenger2_detach_pos_offset = def.passenger2_detach_pos_offset,
|
||||
|
||||
passenger3_attach_at = def.passenger3_attach_at,
|
||||
passenger3_eye_offset = def.passenger3_eye_offset,
|
||||
passenger3_detach_pos_offset = def.passenger3_detach_pos_offset,
|
||||
passengers = def.passengers,
|
||||
|
||||
enable_crash = def.enable_crash,
|
||||
visual = def.visual,
|
||||
@ -50,8 +37,12 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
mouselook = false,
|
||||
physical = true,
|
||||
removed = false,
|
||||
offset = {x=0, y=0, z=0},
|
||||
offset = vector.new(0,0,0),
|
||||
owner = "",
|
||||
hp_min = def.hp_min,
|
||||
hp_max = def.hp_max,
|
||||
armor = def.armor,
|
||||
rpm_values = {{16, 16, .5}, {10, 10, .4}, {0, 5, .3}},
|
||||
on_rightclick = function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
@ -60,42 +51,29 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
if self.driver then
|
||||
-- if clicker is driver detach passengers and driver
|
||||
if clicker == self.driver then
|
||||
if self.passenger then
|
||||
lib_mount.detach(self.passenger, self.offset)
|
||||
for i = 1, self.number_of_passengers do -- Detaches all passengers with the new Library Mount API.
|
||||
local passenger = self.passengers[i]
|
||||
if passenger.player then
|
||||
lib_mount.detach(passenger.player, passenger.eye_offset)
|
||||
end
|
||||
|
||||
if self.passenger2 then
|
||||
lib_mount.detach(self.passenger2, self.offset)
|
||||
end
|
||||
|
||||
if self.passenger3 then
|
||||
lib_mount.detach(self.passenger3, self.offset)
|
||||
end
|
||||
-- detach driver
|
||||
lib_mount.detach(self.driver, self.offset)
|
||||
-- if clicker is not the driver
|
||||
else
|
||||
-- if clicker is passenger
|
||||
-- detach passengers
|
||||
if clicker == self.passenger then
|
||||
lib_mount.detach(self.passenger, self.offset)
|
||||
|
||||
elseif clicker == self.passenger2 then
|
||||
lib_mount.detach(self.passenger2, self.offset)
|
||||
|
||||
elseif clicker == self.passenger3 then
|
||||
lib_mount.detach(self.passenger3, self.offset)
|
||||
-- if clicker is not passenger
|
||||
-- detach passengers with the new Library Mount API
|
||||
for i = 1, self.number_of_passengers do
|
||||
local passenger = self.passengers[i]
|
||||
if clicker == passenger.player then
|
||||
lib_mount.detach(passenger.player, passenger.eye_offset)
|
||||
break
|
||||
else
|
||||
-- attach passengers if possible
|
||||
if lib_mount.passengers[self.passenger] == self.passenger and self.number_of_passengers >= 1 then
|
||||
lib_mount.attach(self, clicker, true, 1)
|
||||
-- Attach passengers with the new Library Mount API
|
||||
if not passenger.player then -- If there's no current passenger, attach if possible.
|
||||
lib_mount.attach(self, clicker, true, i)
|
||||
break -- We've already attached the player, no need to continue.
|
||||
end
|
||||
if lib_mount.passengers[self.passenger2] == self.passenger2 and self.number_of_passengers >= 2 then
|
||||
lib_mount.attach(self, clicker, true, 2)
|
||||
end
|
||||
if lib_mount.passengers[self.passenger3] == self.passenger3 and self.number_of_passengers >= 3 then
|
||||
lib_mount.attach(self, clicker, true, 3)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -108,7 +86,16 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
end
|
||||
end,
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
if def.armor then
|
||||
self.object:set_armor_groups({fleshy = def.armor}) -- Set armor groups to vehicle
|
||||
else
|
||||
self.object:set_armor_groups({fleshy = 0, immortal = 1}) -- Else, make vehicle immortal
|
||||
end
|
||||
|
||||
if def.hp_min and def.hp_max then
|
||||
self.object:set_hp(math.random(def.hp_min, def.hp_max), "Set HP to vehicle")
|
||||
end
|
||||
|
||||
local tmp = minetest.deserialize(staticdata)
|
||||
if tmp then
|
||||
for _,stat in pairs(tmp) do
|
||||
@ -129,7 +116,7 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
end
|
||||
return core.serialize(tmp)
|
||||
end,
|
||||
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
|
||||
if not puncher or not puncher:is_player() or self.removed or self.driver then
|
||||
return
|
||||
end
|
||||
@ -143,12 +130,24 @@ function vehicle_mash.register_vehicle(name, def)
|
||||
puncher:get_inventory():add_item("main", self.name)
|
||||
end
|
||||
end,
|
||||
on_step = function(self, dtime)
|
||||
on_step = function(self, dtime, moveresult, ...)
|
||||
-- Automatically set `enable_crash` to true if there's no value found
|
||||
if def.enable_crash == nil then
|
||||
def.enable_crash = true
|
||||
end
|
||||
drive(self, dtime, false, nil, nil, 0, def.can_fly, def.can_go_down, def.can_go_up, def.enable_crash)
|
||||
lib_mount.drive(self, dtime, false, nil, nil, 0, def.can_fly, def.can_go_down, def.can_go_up, def.enable_crash, moveresult)
|
||||
end,
|
||||
on_death = function(self, killer)
|
||||
if self.driver then
|
||||
lib_mount.detach(self.driver, self.offset)
|
||||
end
|
||||
for i = 1, self.number_of_passengers do -- Detaches all passengers with the new Library Mount API.
|
||||
local passenger = self.passengers[i]
|
||||
if passenger.player then
|
||||
lib_mount.detach(passenger.player, passenger.eye_offset)
|
||||
passenger.player:set_eye_offset(vector.new(0,0,0), vector.new(0,0,0))
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "hover_blue"
|
||||
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Blue hovercraft"
|
||||
definition.description = vehicle_mash.S("Blue hovercraft")
|
||||
definition.inventory_image = "hovercraft_blue_inv.png"
|
||||
definition.wield_image = "hovercraft_blue_inv.png"
|
||||
definition.textures = {"hovercraft_blue.png"}
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "hover_green"
|
||||
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Green hovercraft"
|
||||
definition.description = vehicle_mash.S("Green hovercraft")
|
||||
definition.inventory_image = "hovercraft_green_inv.png"
|
||||
definition.wield_image = "hovercraft_green_inv.png"
|
||||
definition.textures = {"hovercraft_green.png"}
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "hover_red"
|
||||
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Red hovercraft"
|
||||
definition.description = vehicle_mash.S("Red hovercraft")
|
||||
definition.inventory_image = "hovercraft_red_inv.png"
|
||||
definition.wield_image = "hovercraft_red_inv.png"
|
||||
definition.textures = {"hovercraft_red.png"}
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
local name = "hover_yellow"
|
||||
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Yellow hovercraft"
|
||||
definition.description = vehicle_mash.S("Yellow hovercraft")
|
||||
definition.inventory_image = "hovercraft_yellow_inv.png"
|
||||
definition.wield_image = "hovercraft_yellow_inv.png"
|
||||
definition.textures = {"hovercraft_yellow.png"}
|
||||
|
115
init.lua
115
init.lua
@ -1,5 +1,11 @@
|
||||
vehicle_mash = {
|
||||
S = minetest.get_translator(minetest.get_current_modname())
|
||||
}
|
||||
|
||||
-- Fix `player_api` eye height model if desired
|
||||
if minetest.settings:get_bool("vehicle_mash.player_api_fix") == true or minetest.settings:get_bool("vehicle_mash.player_api_fix") == nil then
|
||||
if minetest.settings:get_bool("vehicle_mash.player_api_fix") == true or minetest.settings:get_bool("vehicle_mash.player_api_fix") == nil
|
||||
and player_api.registered_models["character.b3d"] then
|
||||
|
||||
player_api.registered_models["character.b3d"].animations.sit.eye_height = 1.47
|
||||
end
|
||||
|
||||
@ -54,22 +60,34 @@ else
|
||||
visual = "mesh",
|
||||
mesh = "car.x",
|
||||
visual_size = {x=1, y=1},
|
||||
wield_scale = {x=1, y=1, z=1},
|
||||
wield_scale = vector.new(1,1,1),
|
||||
collisionbox = {-0.6, -0.05, -0.6, 0.6, 1, 0.6},
|
||||
onplace_position_adj = -0.45,
|
||||
-- player specific stuff
|
||||
player_rotation = {x=0,y=90,z=0},
|
||||
driver_attach_at = {x=3.5,y=3.7,z=3.5},
|
||||
driver_eye_offset = {x=-4, y=0, z=0},
|
||||
player_rotation = vector.new(0,90,0),
|
||||
driver_attach_at = vector.new(3.5,3.7,3.5),
|
||||
driver_eye_offset = vector.new(-4,0,0),
|
||||
number_of_passengers = 3,
|
||||
passenger_attach_at = {x=3.5,y=3.7,z=-3.5},
|
||||
passenger_eye_offset = {x=4, y=0, z=0},
|
||||
|
||||
passenger2_attach_at = {x=-4,y=3.7,z=3.5},
|
||||
passenger2_eye_offset = {x=-4, y=3, z=0},
|
||||
passengers = {
|
||||
{
|
||||
attach_at = vector.new(3.5,3.7,-3.5),
|
||||
eye_offset = vector.new(4,0,0),
|
||||
},
|
||||
{
|
||||
attach_at = vector.new(-4,3.7,3.5),
|
||||
eye_offset = vector.new(-4,3,0),
|
||||
},
|
||||
{
|
||||
attach_at = vector.new(-4,3.7,-3.5),
|
||||
eye_offset = vector.new(4,3,0),
|
||||
},
|
||||
},
|
||||
|
||||
passenger3_attach_at = {x=-4,y=3.7,z=-3.5},
|
||||
passenger3_eye_offset = {x=4, y=3, z=0},
|
||||
-- HP/Armor stuff. Uncomment to enable.
|
||||
-- min_hp = 10,
|
||||
-- max_hp = 35,
|
||||
-- armor = 25,
|
||||
|
||||
-- drop and recipe
|
||||
drop_on_destroy = {"vehicle_mash:tire 2", "vehicle_mash:windshield",
|
||||
@ -86,7 +104,7 @@ else
|
||||
"nyan_ride", "oerkki_bliss", "road_master",
|
||||
}
|
||||
|
||||
-- Load all CAR01's cars if enabled
|
||||
-- Load all CAR01's cars if enabled
|
||||
for _, name in ipairs(car01_names) do
|
||||
local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name .. "_car")
|
||||
if check_enabled or check_enabled == nil then
|
||||
@ -110,22 +128,26 @@ else
|
||||
visual = "cube",
|
||||
mesh = "",
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
wield_scale = {x=1, y=1, z=1},
|
||||
wield_scale = vector.new(1,1,1),
|
||||
collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75},
|
||||
onplace_position_adj = 0.25,
|
||||
-- player specific stuff
|
||||
player_rotation = {x=0,y=0,z=0},
|
||||
driver_attach_at = {x=0,y=0,z=-2.0},
|
||||
driver_eye_offset = {x=0, y=0, z=0},
|
||||
player_rotation = vector.new(0,0,0),
|
||||
driver_attach_at = vector.new(0,0,-2.0),
|
||||
driver_eye_offset = vector.new(0,0,0),
|
||||
number_of_passengers = 0,
|
||||
passenger_attach_at = {x=0,y=0,z=0},
|
||||
passenger_eye_offset = {x=0, y=0, z=0},
|
||||
|
||||
passenger2_attach_at = {x=0,y=0,z=0},
|
||||
passenger2_eye_offset = {x=0, y=0, z=0},
|
||||
passengers = {
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
},
|
||||
|
||||
passenger3_attach_at = {x=0,y=0,z=0},
|
||||
passenger3_eye_offset = {x=0, y=0, z=0},
|
||||
-- HP/Armor stuff. Uncomment to enable.
|
||||
-- min_hp = 10,
|
||||
-- max_hp = 35,
|
||||
-- armor = 25,
|
||||
|
||||
-- drop and recipe
|
||||
drop_on_destroy = {"vehicle_mash:motor", "vehicle_mash:battery"},
|
||||
@ -162,23 +184,26 @@ else
|
||||
-- model specific stuff
|
||||
visual = "mesh",
|
||||
visual_size = {x=1, y=1},
|
||||
wield_scale = {x=1, y=1, z=1},
|
||||
wield_scale = vector.new(1,1,1),
|
||||
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
|
||||
onplace_position_adj = 0,
|
||||
textures = {"default_wood.png"},
|
||||
-- player specific stuff
|
||||
player_rotation = {x=0, y=0, z=0},
|
||||
driver_attach_at = {x=0.5,y=1,z=-3},
|
||||
driver_eye_offset = {x=0, y=0, z=0},
|
||||
player_rotation = vector.new(0,0,0),
|
||||
driver_attach_at = vector.new(0.5,1,-3),
|
||||
driver_eye_offset = vector.new(0,0,0),
|
||||
number_of_passengers = 0,
|
||||
passenger_attach_at = {x=0,y=0,z=0},
|
||||
passenger_eye_offset = {x=0, y=0, z=0},
|
||||
passengers = {
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
},
|
||||
|
||||
passenger2_attach_at = {x=0,y=0,z=0},
|
||||
passenger2_eye_offset = {x=0, y=0, z=0},
|
||||
|
||||
passenger3_attach_at = {x=0,y=0,z=0},
|
||||
passenger3_eye_offset = {x=0, y=0, z=0}
|
||||
-- HP/Armor stuff. Uncomment to enable.
|
||||
-- min_hp = 10,
|
||||
-- max_hp = 35,
|
||||
-- armor = 25,
|
||||
}
|
||||
|
||||
local boat_names = {
|
||||
@ -210,22 +235,26 @@ else
|
||||
visual = "mesh",
|
||||
mesh = "hovercraft.x",
|
||||
visual_size = {x=1, y=1},
|
||||
wield_scale = {x=1, y=1, z=1},
|
||||
wield_scale = vector.new(1,1,1),
|
||||
collisionbox = {-0.8, -0.25, -0.8, 0.8, 1.2, 0.8},
|
||||
onplace_position_adj = -0.25,
|
||||
-- player specific stuff
|
||||
player_rotation = {x=0,y=90,z=0},
|
||||
driver_attach_at = {x=-2,y=6.3,z=0},
|
||||
driver_eye_offset = {x=0, y=0, z=0},
|
||||
player_rotation = vector.new(0,90,0),
|
||||
driver_attach_at = vector.new(-2,6.3,0),
|
||||
driver_eye_offset = vector.new(0,0,0),
|
||||
number_of_passengers = 0,
|
||||
passenger_attach_at = {x=0,y=0,z=0},
|
||||
passenger_eye_offset = {x=0, y=0, z=0},
|
||||
|
||||
passenger2_attach_at = {x=0,y=0,z=0},
|
||||
passenger2_eye_offset = {x=0, y=0, z=0},
|
||||
passengers = {
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
},
|
||||
|
||||
passenger3_attach_at = {x=0,y=0,z=0},
|
||||
passenger3_eye_offset = {x=0, y=0, z=0},
|
||||
-- HP/Armor stuff. Uncomment to enable.
|
||||
-- min_hp = 10,
|
||||
-- max_hp = 35,
|
||||
-- armor = 25,
|
||||
|
||||
-- recipe
|
||||
recipe = nil
|
||||
|
35
locale/template.txt
Normal file
35
locale/template.txt
Normal file
@ -0,0 +1,35 @@
|
||||
# textdomain: vehicle_mash
|
||||
|
||||
Motor=
|
||||
Tire=
|
||||
Wind Shield=
|
||||
Car battery=
|
||||
BoatA=
|
||||
Rowboat=
|
||||
Black car=
|
||||
Blue car=
|
||||
Brown car=
|
||||
Cyan car=
|
||||
Dark green car=
|
||||
Dark grey car=
|
||||
Green car=
|
||||
Grey car=
|
||||
Hot Rod car=
|
||||
Magenta car=
|
||||
Nyan Ride car=
|
||||
Oerkki Bliss car=
|
||||
Orange car=
|
||||
Pink car=
|
||||
Red car=
|
||||
Road Master car=
|
||||
Violet car=
|
||||
White car=
|
||||
Yellow car=
|
||||
Blue hovercraft=
|
||||
Green hovercraft=
|
||||
Red hovercraft=
|
||||
Yellow hovercraft=
|
||||
Blue Mesecar=
|
||||
Pink Mesecar=
|
||||
Purple Mesecar=
|
||||
Yellow Mesecar=
|
35
locale/vehicle_mash.es.tr
Normal file
35
locale/vehicle_mash.es.tr
Normal file
@ -0,0 +1,35 @@
|
||||
# textdomain: vehicle_mash
|
||||
|
||||
Motor=Motor
|
||||
Tire=Lanta
|
||||
Wind Shield=
|
||||
Car battery=Batería de Carro
|
||||
BoatA=BoteA
|
||||
Rowboat=Bote de remos
|
||||
Black car=Carro negro
|
||||
Blue car=Carro azul
|
||||
Brown car=Carro cáfe
|
||||
Cyan car=Carro celeste
|
||||
Dark green car=Carro verde oscuro
|
||||
Dark grey car=Carro gris oscuro
|
||||
Green car=Carro verde
|
||||
Grey car=Carro gris
|
||||
Hot Rod car=Carro de carreras
|
||||
Magenta car=Carro magenta
|
||||
Nyan Ride car=Carro de Nyan
|
||||
Oerkki Bliss car=Carro de Oerkki
|
||||
Orange car=Carro naranja
|
||||
Pink car=Carro rosa
|
||||
Red car=Carro rojo
|
||||
Road Master car=Carro Maestro
|
||||
Violet car=Carro violeta
|
||||
White car=Carro blanco
|
||||
Yellow car=Carro amarillo
|
||||
Blue hovercraft=Aerodeslizador azul
|
||||
Green hovercraft=Aerodeslizador verde
|
||||
Red hovercraft=Aerodeslizador rojo
|
||||
Yellow hovercraft=Aerodeslizador amarillo
|
||||
Blue Mesecar=Carro de Mese azul
|
||||
Pink Mesecar=Carro de Mese Rosa
|
||||
Purple Mesecar=Carro de Mese Morado
|
||||
Yellow Mesecar=Carro de Mese amarillo
|
@ -1,8 +1,7 @@
|
||||
|
||||
local name = "mesecar_blue"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Blue Mesecar"
|
||||
definition.description = vehicle_mash.S("Blue Mesecar")
|
||||
definition.inventory_image = "mesecar_car1front.png"
|
||||
definition.wield_image = "mesecar_car1front.png"
|
||||
definition.textures = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
local name = "mesecar_pink"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Pink Mesecar"
|
||||
definition.description = vehicle_mash.S("Pink Mesecar")
|
||||
definition.inventory_image = "mesecar_car3front.png"
|
||||
definition.wield_image = "mesecar_car3front.png"
|
||||
definition.textures = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
local name = "mesecar_purple"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Purple Mesecar"
|
||||
definition.description = vehicle_mash.S("Purple Mesecar")
|
||||
definition.inventory_image = "mesecar_car2front.png"
|
||||
definition.wield_image = "mesecar_car2front.png"
|
||||
definition.textures = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
local name = "mesecar_yellow"
|
||||
local definition = ...
|
||||
|
||||
definition.description = "Yellow Mesecar"
|
||||
definition.description = vehicle_mash.S("Yellow Mesecar")
|
||||
definition.inventory_image = "mesecar_car4front.png"
|
||||
definition.wield_image = "mesecar_car4front.png"
|
||||
definition.textures = {
|
||||
|
1
mod.conf
1
mod.conf
@ -9,3 +9,4 @@ Adds many types of vehicles:
|
||||
- Hovercrafts.
|
||||
- And mesecars.
|
||||
"""
|
||||
min_minetest_version = 5.0.0
|
||||
|
6761
models/car_126r.x
6761
models/car_126r.x
File diff suppressed because it is too large
Load Diff
4657
models/car_f1.x
4657
models/car_f1.x
File diff suppressed because it is too large
Load Diff
39
template.lua
39
template.lua
@ -9,25 +9,30 @@ local definition = {
|
||||
can_fly = false, -- if enabled, the specified vehicle will be able to fly around
|
||||
can_go_down = false, -- applies only when `can_fly` is enabled
|
||||
can_go_up = false, -- applies only when `can_fly` is enabled
|
||||
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
|
||||
driver_eye_offset = {x=0, y=0, z=0}, -- offset for first person driver view
|
||||
player_rotation = vector.new(0,0,0), -- rotate player so they sit facing the correct direction
|
||||
driver_attach_at = vector.new(0,0,0), -- attach the driver at
|
||||
driver_eye_offset = vector.new(0,0,0), -- offset for first person driver view
|
||||
number_of_passengers = 0, -- maximum number of passengers. Can have 3 passengers maximum
|
||||
passenger_attach_at = {x=0,y=0,z=0}, -- attach the 1st passenger, if applicable, at the specified positions
|
||||
passenger_eye_offset = {x=0, y=0, z=0}, -- offset for the 1st passenger in first-person view
|
||||
passenger_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 1st passenger when they leave the vehicle
|
||||
|
||||
passenger2_attach_at = {x=0,y=0,z=0}, -- attach the 2nd passenger, if applicable, at the specified positions
|
||||
passenger2_eye_offset = {x=0,y=0,z=0}, -- offset for the 2nd passenger in first-person view
|
||||
passenger2_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 2nd passenger when they leave the vehicle
|
||||
|
||||
passenger3_attach_at = {x=0,y=0,z=0}, -- attach the 3rd passenger, if applicable, at the specified positions
|
||||
passenger3_eye_offset = {x=0,y=0,z=0}, -- offset for the 3rd passenger in first-person view
|
||||
passenger3_detach_pos_offset = {x=0,y=0,z=0}, -- offset for the 3rd passenger when they leave the vehicle
|
||||
-- Attachment positions and offset for all passengers (can be over 3 passengers)
|
||||
passengers = {
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
{
|
||||
attach_at = vector.new(0,0,0),
|
||||
eye_offset = vector.new(0,0,0),
|
||||
},
|
||||
},
|
||||
|
||||
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}, --
|
||||
wield_scale = vector.new(1,1,1), -- the size of the item in hand
|
||||
visual = "mesh", -- what type of object (mesh, cube, etc...)
|
||||
mesh = "filename.ext", -- mesh model to use
|
||||
textures = {"filename.png"}, -- mesh texture(s)
|
||||
@ -41,7 +46,11 @@ local definition = {
|
||||
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
|
||||
recipe = {}, -- crafting recipe
|
||||
-- HP/Armor stuff.
|
||||
min_hp = 1,
|
||||
max_hp = 10,
|
||||
armor = 25
|
||||
}
|
||||
|
||||
-- nothing to change down here
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 73 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 57 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user