more mods

This commit is contained in:
tangent committed 2026-09-12 07:03:41 -06:00
1 parent cc0fa41e3b
commit bac6ac94a3
1742 files changed
+115814 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
## Coupe
This mod adds a coupe automobile to Minetest.
## Licenses
- Code: see [LICENSE](/LICENSE)
- Media: Model adapted from car assets v1 made by https://www.racoon-media.nl; licence CC0
## Screenshot
![coupe](/automobiles_coupe/screenshot.jpg)
+69
View File
@@ -0,0 +1,69 @@
local S = coupe.S
--
-- items
--
-- body
minetest.register_craftitem("automobiles_coupe:coupe_body",{
description = S("Coupe Body"),
inventory_image = "automobiles_coupe_body.png",
})
-- coupe
minetest.register_tool("automobiles_coupe:coupe", {
description = S("Coupe"),
inventory_image = "automobiles_coupe.png",
liquids_pointable = false,
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
local stack_meta = itemstack:get_meta()
local staticdata = stack_meta:get_string("staticdata")
local pointed_pos = pointed_thing.above
--pointed_pos.y=pointed_pos.y+0.2
local car = minetest.add_entity(pointed_pos, "automobiles_coupe:coupe", staticdata)
if car and placer then
local ent = car:get_luaentity()
local owner = placer:get_player_name()
if ent then
ent.owner = owner
ent.hp = 50 --reset hp
--minetest.chat_send_all("owner: " .. ent.owner)
car:set_yaw(placer:get_look_horizontal())
itemstack:take_item()
ent.object:set_acceleration({x=0,y=-automobiles_lib.gravity,z=0})
automobiles_lib.setText(ent, S("Coupe"))
automobiles_lib.create_inventory(ent, ent._trunk_slots, owner)
end
end
return itemstack
end,
})
--
-- crafting
--
if minetest.get_modpath("default") then
minetest.register_craft({
output = "automobiles_coupe:coupe",
recipe = {
{"automobiles_lib:wheel", "automobiles_lib:engine", "automobiles_lib:wheel"},
{"automobiles_lib:wheel","automobiles_coupe:coupe_body", "automobiles_lib:wheel"},
}
})
minetest.register_craft({
output = "automobiles_coupe:coupe_body",
recipe = {
{"default:glass" ,"default:glass","default:steel_ingot"},
{"default:steel_ingot","","default:steel_ingot"},
{"default:steelblock","default:steelblock", "default:steelblock"},
}
})
end
+307
View File
@@ -0,0 +1,307 @@
--
-- entity
--
local old_entities = {"automobiles_coupe:time_machine_kit", "automobiles_coupe:wheel","automobiles_coupe:normal_kit"}
for _,entity_name in ipairs(old_entities) do
minetest.register_entity(":"..entity_name, {
on_activate = function(self, staticdata)
self.object:remove()
end,
})
end
minetest.register_entity('automobiles_coupe:front_suspension',{
initial_properties = {
physical = true,
collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false,
visual = "sprite",
textures = {"automobiles_alpha.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
--[[on_step = function(self, dtime, moveresult)
minetest.chat_send_all(dump(moveresult))
end,]]--
})
minetest.register_entity('automobiles_coupe:rear_suspension',{
initial_properties = {
physical = true,
collide_with_objects=true,
pointable=false,
visual = "sprite",
textures = {"automobiles_alpha.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:f_lights',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
glow = 0,
visual = "mesh",
mesh = "automobiles_coupe_f_lights.b3d",
textures = {"automobiles_grey.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:r_lights',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
glow = 0,
visual = "mesh",
mesh = "automobiles_coupe_rear_pos_lights.b3d",
textures = {"automobiles_rear_lights_off.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:reverse_lights',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
glow = 0,
visual = "mesh",
mesh = "automobiles_coupe_reverse_lights.b3d",
textures = {"automobiles_grey.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:turn_left_light',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
glow = 0,
visual = "mesh",
mesh = "automobiles_coupe_turn_l_light.b3d",
textures = {"automobiles_turn.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:turn_right_light',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
glow = 0,
visual = "mesh",
mesh = "automobiles_coupe_turn_r_light.b3d",
textures = {"automobiles_turn.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:steering',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_coupe_drive_wheel.b3d",
textures = {"automobiles_black.png", "automobiles_black.png", "automobiles_black.png"},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity("automobiles_coupe:coupe", {
initial_properties = {
physical = true,
collide_with_objects = true,
collisionbox = {-0.1, -0.2, -0.1, 0.1, 1, 0.1},
selectionbox = {-1.5, 0.0, -1.5, 1.5, 2, 1.5},
stepheight = 0.65 + automobiles_lib.extra_stepheight,
visual = "mesh",
mesh = "automobiles_coupe_body.b3d",
textures = {
"automobiles_black.png", --bancos
"automobiles_painting.png", --carroceria
"automobiles_black.png", --paralamas
"automobiles_black.png", --saia
"automobiles_black.png", --banco
"automobiles_coupe_glasses.png", --vidros
"automobiles_black.png", --aletas vidro traseiro
"automobiles_grey.png", --interior
"automobiles_black.png", --panel
"automobiles_coupe_fuel.png",
},
},
textures = {},
driver_name = nil,
sound_handle = nil,
owner = "",
static_save = true,
infotext = "A very nice coupe!",
hp = 50,
buoyancy = 2,
physics = automobiles_lib.physics,
lastvelocity = vector.new(),
time_total = 0,
_passenger = nil,
_color = "#6d6d6d",
_steering_angle = 0,
_engine_running = false,
_last_checkpoint = "",
_total_laps = -1,
_race_id = "",
_energy = 1,
_last_time_collision_snd = 0,
_last_time_drift_snd = 0,
_last_time_command = 0,
_roll = math.rad(0),
_pitch = 0,
_longit_speed = 0,
_show_rag = true,
_show_lights = false,
_light_old_pos = nil,
_last_ground_check = 0,
_last_light_move = 0,
_last_engine_sound_update = 0,
_turn_light_timer = 0,
_inv = nil,
_inv_id = "",
_change_color = automobiles_lib.paint,
_intensity = 4,
_trunk_slots = 8,
_engine_sound = "coupe_engine",
_max_fuel = 10,
_vehicle_name = "Coupe",
_drive_wheel_pos = {x=-4.26,y=6.01,z=14.18},
_drive_wheel_angle = 15,
_steering_ent = 'automobiles_coupe:steering',
_seat_pos = {{x=-4.25,y=0.48,z=9.5},{x=4.25,y=0.48,z=9.5}},
_front_suspension_ent = 'automobiles_coupe:front_suspension',
_front_suspension_pos = {x=0,y=1.5,z=24.5},
_front_wheel_ent = 'automobiles_lib:wheel',
_front_wheel_xpos = 9.5,
_front_wheel_frames = {x = 1, y = 49},
_rear_suspension_ent = 'automobiles_coupe:rear_suspension',
_rear_suspension_pos = {x=0,y=1.5,z=0},
_rear_wheel_ent = 'automobiles_lib:wheel',
_rear_wheel_xpos = 9.5,
_rear_wheel_frames = {x = 1, y = 49},
_fuel_gauge_pos = {x=0,y=6.2,z=15.8},
_front_lights = 'automobiles_coupe:f_lights',
_rear_lights = 'automobiles_coupe:r_lights',
_reverse_lights = 'automobiles_coupe:reverse_lights',
_turn_left_lights = 'automobiles_coupe:turn_left_light',
_turn_right_lights = 'automobiles_coupe:turn_right_light',
_textures_turn_lights_off = {"automobiles_turn.png", },
_textures_turn_lights_on = { "automobiles_turn_on.png", },
_LONGIT_DRAG_FACTOR = 0.12*0.12,
_LATER_DRAG_FACTOR = 18.0,
_max_acc_factor = 8,
_max_speed = 22,
_min_later_speed = 2,
_consumption_divisor = 50000,
get_staticdata = automobiles_lib.get_staticdata,
on_deactivate = function(self)
automobiles_lib.save_inventory(self)
end,
on_activate = automobiles_lib.on_activate,
on_step = automobiles_lib.on_step,
on_punch = automobiles_lib.on_punch,
on_rightclick = automobiles_lib.on_rightclick,
})
+26
View File
@@ -0,0 +1,26 @@
--
-- constants
--
coupe={}
coupe.gravity = automobiles_lib.gravity
coupe.S = nil
if(minetest.get_translator ~= nil) then
coupe.S = minetest.get_translator(minetest.get_current_modname())
else
coupe.S = function ( s ) return s end
end
local S = coupe.S
dofile(minetest.get_modpath("automobiles_lib") .. DIR_DELIM .. "custom_physics.lua")
dofile(minetest.get_modpath("automobiles_lib") .. DIR_DELIM .. "control.lua")
dofile(minetest.get_modpath("automobiles_lib") .. DIR_DELIM .. "fuel_management.lua")
dofile(minetest.get_modpath("automobiles_lib") .. DIR_DELIM .. "ground_detection.lua")
dofile(minetest.get_modpath("automobiles_coupe") .. DIR_DELIM .. "coupe_entities.lua")
dofile(minetest.get_modpath("automobiles_coupe") .. DIR_DELIM .. "coupe_crafts.lua")
@@ -0,0 +1,4 @@
# textdomain: automobiles_coupe
### coupe_crafts.lua ###
Coupe Body=Coupe Karrosserie
Coupe=Coupe
@@ -0,0 +1,4 @@
# textdomain: automobiles_coupe
### coupe_crafts.lua ###
Coupe Body=Korpo de Coupe
Coupe=Coupe
@@ -0,0 +1,4 @@
# textdomain: automobiles_coupe
### coupe_crafts.lua ###
Coupe Body=
Coupe=
+5
View File
@@ -0,0 +1,5 @@
name=automobiles_coupe
title=Coupe
description=A coupe
author=apercy
depends=automobiles_lib
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB