mirror of
https://github.com/APercy/automobiles_pck
synced 2025-06-17 14:28:02 +02:00
added support for mineclonia and voxel libre
This commit is contained in:
parent
a61a64ba75
commit
0d2ef53821
@ -167,8 +167,8 @@ function automobiles_lib.ground_get_distances(self, radius, axis_distance)
|
|||||||
local wheels = {
|
local wheels = {
|
||||||
{x = -front_wheel_x, y = 0, z = axis_distance}, -- Roda frontal esquerda
|
{x = -front_wheel_x, y = 0, z = axis_distance}, -- Roda frontal esquerda
|
||||||
{x = front_wheel_x, y = 0, z = axis_distance}, -- Roda frontal direita
|
{x = front_wheel_x, y = 0, z = axis_distance}, -- Roda frontal direita
|
||||||
{x = -rear_wheel_x, y = 0, z = 0}, -- Roda traseira esquerda
|
{x = -rear_wheel_x, y = 0, z = -axis_distance}, -- Roda traseira esquerda
|
||||||
{x = rear_wheel_x, y = 0, z = 0} -- Roda traseira direita
|
{x = rear_wheel_x, y = 0, z = -axis_distance} -- Roda traseira direita
|
||||||
}
|
}
|
||||||
|
|
||||||
--retornando pitch e roll
|
--retornando pitch e roll
|
||||||
|
@ -17,6 +17,10 @@ end
|
|||||||
local S = automobiles_lib.S
|
local S = automobiles_lib.S
|
||||||
local storage = automobiles_lib.storage
|
local storage = automobiles_lib.storage
|
||||||
|
|
||||||
|
automobiles_lib.is_minetest = core.get_modpath("player_api")
|
||||||
|
automobiles_lib.is_mcl = core.get_modpath("mcl_player")
|
||||||
|
automobiles_lib.is_repixture = core.get_modpath("rp_player")
|
||||||
|
|
||||||
automobiles_lib.fuel = {['biofuel:biofuel'] = 1,['biofuel:bottle_fuel'] = 1,
|
automobiles_lib.fuel = {['biofuel:biofuel'] = 1,['biofuel:bottle_fuel'] = 1,
|
||||||
['biofuel:phial_fuel'] = 0.25, ['biofuel:fuel_can'] = 10,
|
['biofuel:phial_fuel'] = 0.25, ['biofuel:fuel_can'] = 10,
|
||||||
['airutils:biofuel'] = 1,}
|
['airutils:biofuel'] = 1,}
|
||||||
@ -44,7 +48,7 @@ end
|
|||||||
|
|
||||||
local motorcycle_anim_mode = minetest.settings:get_bool("motorcycle_anim_mode", true)
|
local motorcycle_anim_mode = minetest.settings:get_bool("motorcycle_anim_mode", true)
|
||||||
automobiles_lib.mot_anim_mode = true
|
automobiles_lib.mot_anim_mode = true
|
||||||
if motorcycle_anim_mode == false then
|
if motorcycle_anim_mode == false or automobiles_lib.is_mcl then --disable for mcl too -- TODO
|
||||||
automobiles_lib.mot_anim_mode = false
|
automobiles_lib.mot_anim_mode = false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,6 +72,12 @@ automobiles_lib.colors ={
|
|||||||
yellow='#ffe400',
|
yellow='#ffe400',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local eye_height_plus_value = 6.5
|
||||||
|
local base_eie_height = -4
|
||||||
|
if automobiles_lib.is_mcl then
|
||||||
|
base_eie_height = -5.5
|
||||||
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- helpers and co.
|
-- helpers and co.
|
||||||
--
|
--
|
||||||
@ -133,19 +143,28 @@ end
|
|||||||
--returns 0 for old, 1 for new
|
--returns 0 for old, 1 for new
|
||||||
function automobiles_lib.detect_player_api(player)
|
function automobiles_lib.detect_player_api(player)
|
||||||
local player_proterties = player:get_properties()
|
local player_proterties = player:get_properties()
|
||||||
|
--local mesh = "character.b3d"
|
||||||
|
--if player_proterties.mesh == mesh then
|
||||||
|
if core.get_modpath("player_api") then
|
||||||
local models = player_api.registered_models
|
local models = player_api.registered_models
|
||||||
local character = models[player_proterties.mesh]
|
local character = models[player_proterties.mesh]
|
||||||
|
--core.chat_send_all(dump(character));
|
||||||
if character then
|
if character then
|
||||||
if character.animations.sit.eye_height then
|
if character.animations.sit.eye_height then
|
||||||
|
--core.chat_send_all(dump(character.animations.sit.eye_height));
|
||||||
if character.animations.sit.eye_height == 0.8 then
|
if character.animations.sit.eye_height == 0.8 then
|
||||||
--minetest.chat_send_all("new model");
|
--core.chat_send_all("new model");
|
||||||
return 1
|
return 1
|
||||||
|
else
|
||||||
|
--core.chat_send_all("new height");
|
||||||
|
return 2 --strange bug with armor ands skins returning 1.47
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--minetest.chat_send_all("old model");
|
--core.chat_send_all("old model");
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@ -172,6 +191,12 @@ function automobiles_lib.seats_create(self)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function automobiles_lib.sit(player)
|
||||||
|
--set_animation(frame_range, frame_speed, frame_blend, frame_loop)
|
||||||
|
player:set_animation({x = 81, y = 160},30, 0, true)
|
||||||
|
if core.get_modpath("emote") then emote.start(player:get_player_name(), "sit") end
|
||||||
|
end
|
||||||
|
|
||||||
-- attach player
|
-- attach player
|
||||||
function automobiles_lib.attach_driver(self, player)
|
function automobiles_lib.attach_driver(self, player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
@ -179,35 +204,29 @@ function automobiles_lib.attach_driver(self, player)
|
|||||||
|
|
||||||
-- attach the driver
|
-- attach the driver
|
||||||
player:set_attach(self.driver_seat, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
player:set_attach(self.driver_seat, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
local eye_y = -4
|
local eye_y = base_eie_height
|
||||||
if automobiles_lib.detect_player_api(player) == 1 then
|
if automobiles_lib.detect_player_api(player) == 1 then
|
||||||
eye_y = 2.5
|
eye_y = eye_y + eye_height_plus_value
|
||||||
end
|
end
|
||||||
eye_y = eye_y*self._vehicle_scale
|
eye_y = eye_y*self._vehicle_scale
|
||||||
|
|
||||||
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = eye_y, z = -30})
|
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = eye_y, z = -30})
|
||||||
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
|
|
||||||
-- Make the driver sit
|
|
||||||
-- Minetest bug: Animation is not always applied on the client.
|
|
||||||
-- So we try sending it twice.
|
|
||||||
-- We call set_animation with a speed on the second call
|
|
||||||
-- so set_animation will not do nothing.
|
|
||||||
player_api.set_animation(player, "sit")
|
player_api.set_animation(player, "sit")
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
mcl_player.player_set_animation(player, "sit" , 30)
|
||||||
|
automobiles_lib.sit(player)
|
||||||
|
end
|
||||||
|
|
||||||
minetest.after(0.2, function()
|
-- make the driver sit
|
||||||
player = minetest.get_player_by_name(name)
|
minetest.after(1, function()
|
||||||
if player then
|
if player then
|
||||||
local speed = 30.01
|
--minetest.chat_send_all("okay")
|
||||||
local mesh = player:get_properties().mesh
|
automobiles_lib.sit(player)
|
||||||
if mesh then
|
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
|
||||||
local character = player_api.registered_models[mesh]
|
|
||||||
if character and character.animation_speed then
|
|
||||||
speed = character.animation_speed + 0.01
|
|
||||||
end
|
|
||||||
end
|
|
||||||
player_api.set_animation(player, "sit", speed)
|
|
||||||
if emote then emote.start(player:get_player_name(), "sit") end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -235,9 +254,20 @@ function automobiles_lib.dettach_driver(self, player)
|
|||||||
|
|
||||||
--player:set_properties({physical=true})
|
--player:set_properties({physical=true})
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
player_api.player_attached[name] = nil
|
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
|
if player_api.player_attached[name] then
|
||||||
|
player_api.player_attached[name] = nil
|
||||||
|
end
|
||||||
player_api.set_animation(player, "stand")
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
self.driver = nil
|
self.driver = nil
|
||||||
end
|
end
|
||||||
@ -247,34 +277,33 @@ function automobiles_lib.attach_pax(self, player, onside)
|
|||||||
local onside = onside or false
|
local onside = onside or false
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
||||||
local eye_y = -4
|
local eye_y = base_eie_height
|
||||||
if automobiles_lib.detect_player_api(player) == 1 then
|
if automobiles_lib.detect_player_api(player) == 1 then
|
||||||
eye_y = 2.5
|
eye_y = eye_y + eye_height_plus_value
|
||||||
end
|
end
|
||||||
eye_y = eye_y*self._vehicle_scale
|
eye_y = eye_y*self._vehicle_scale
|
||||||
|
|
||||||
if self._passenger == nil then
|
if self._passenger == nil then
|
||||||
self._passenger = name
|
self._passenger = name
|
||||||
|
|
||||||
-- attach the driver
|
-- attach the pax
|
||||||
player:set_attach(self.passenger_seat, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
player:set_attach(self.passenger_seat, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = eye_y, z = -30})
|
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = eye_y, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
-- make the pax sit
|
player_api.set_animation(player, "sit")
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
mcl_player.player_set_animation(player, "sit" , 30)
|
||||||
|
automobiles_lib.sit(player)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- make the pax sit
|
||||||
minetest.after(0.2, function()
|
minetest.after(0.2, function()
|
||||||
player = minetest.get_player_by_name(name)
|
|
||||||
if player then
|
if player then
|
||||||
local speed = 30.01
|
--minetest.chat_send_all("okay")
|
||||||
local mesh = player:get_properties().mesh
|
automobiles_lib.sit(player)
|
||||||
if mesh then
|
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
|
||||||
local character = player_api.registered_models[mesh]
|
|
||||||
if character and character.animation_speed then
|
|
||||||
speed = character.animation_speed + 0.01
|
|
||||||
end
|
|
||||||
end
|
|
||||||
player_api.set_animation(player, "sit", speed)
|
|
||||||
if emote then emote.start(player:get_player_name(), "sit") end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
@ -295,29 +324,27 @@ function automobiles_lib.attach_pax(self, player, onside)
|
|||||||
for k,v in ipairs(t) do
|
for k,v in ipairs(t) do
|
||||||
i = t[k]
|
i = t[k]
|
||||||
if self._passengers[i] == nil and i > 2 then
|
if self._passengers[i] == nil and i > 2 then
|
||||||
--minetest.chat_send_all(self.driver_name)
|
--core.chat_send_all(self.driver_name)
|
||||||
self._passengers[i] = name
|
self._passengers[i] = name
|
||||||
player:set_attach(self._passengers_base[i], "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
player:set_attach(self._passengers_base[i], "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = 3, z = -30})
|
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = 3, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
-- make the pax sit
|
player_api.set_animation(player, "sit")
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
mcl_player.player_set_animation(player, "sit" , 30)
|
||||||
|
automobiles_lib.sit(player)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- make the pax sit
|
||||||
minetest.after(0.2, function()
|
minetest.after(0.2, function()
|
||||||
player = minetest.get_player_by_name(name)
|
|
||||||
if player then
|
if player then
|
||||||
local speed = 30.01
|
--minetest.chat_send_all("okay")
|
||||||
local mesh = player:get_properties().mesh
|
automobiles_lib.sit(player)
|
||||||
if mesh then
|
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
|
||||||
local character = player_api.registered_models[mesh]
|
|
||||||
if character and character.animation_speed then
|
|
||||||
speed = character.animation_speed + 0.01
|
|
||||||
end
|
|
||||||
end
|
|
||||||
player_api.set_animation(player, "sit", speed)
|
|
||||||
if emote then emote.start(player:get_player_name(), "sit") end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -349,8 +376,17 @@ function automobiles_lib.dettach_pax(self, player)
|
|||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
|
if player_api.player_attached[name] then
|
||||||
player_api.player_attached[name] = nil
|
player_api.player_attached[name] = nil
|
||||||
|
end
|
||||||
player_api.set_animation(player, "stand")
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
--remove_physics_override(player, {speed=1,gravity=1,jump=1})
|
--remove_physics_override(player, {speed=1,gravity=1,jump=1})
|
||||||
@ -489,10 +525,17 @@ function automobiles_lib.destroy(self, puncher)
|
|||||||
if puncher then
|
if puncher then
|
||||||
puncher:set_detach()
|
puncher:set_detach()
|
||||||
puncher:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
puncher:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
if minetest.global_exists("player_api") then
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
|
if player_api.player_attached[self.driver_name] then
|
||||||
player_api.player_attached[self.driver_name] = nil
|
player_api.player_attached[self.driver_name] = nil
|
||||||
-- player should stand again
|
end
|
||||||
player_api.set_animation(puncher, "stand")
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[self.driver_name] then
|
||||||
|
mcl_player.player_attached[self.driver_name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.driver_name = nil
|
self.driver_name = nil
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
local storage = automobiles_lib.storage
|
local storage = automobiles_lib.storage
|
||||||
automobiles_lib.modname = minetest.get_current_modname()
|
automobiles_lib.modname = core.get_current_modname()
|
||||||
|
|
||||||
--function to format formspec for mineclone. In case of minetest, just returns an empty string
|
--function to format formspec for mineclone. In case of minetest, just returns an empty string
|
||||||
local function get_itemslot_bg(a, b, c, d)
|
local function get_itemslot_bg(a, b, c, d)
|
||||||
|
if automobiles_lib.is_mcl then
|
||||||
if mcl_formspec then
|
if mcl_formspec then
|
||||||
return mcl_formspec.get_itemslot_bg(a,b,c,d)
|
return mcl_formspec.get_itemslot_bg(a,b,c,d)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_formspec_by_size(self, size)
|
local function get_formspec_by_size(self, size)
|
||||||
local background = ""
|
local background = ""
|
||||||
local hotbar = ""
|
local hotbar = ""
|
||||||
local is_minetest_game = false
|
local is_minetest_game = automobiles_lib.is_minetest or false
|
||||||
if is_minetest_game then
|
if is_minetest_game then
|
||||||
background = background .. default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
background = background .. default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||||
hotbar = default.get_hotbar_bg(0,4.85)
|
hotbar = default.get_hotbar_bg(0,4.85)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name = automobiles_lib
|
name = automobiles_lib
|
||||||
depends=player_api
|
depends=
|
||||||
optional_depends=emote, biofuel, dg_mapgen
|
optional_depends=player_api, mcl_formspec, mcl_player, emote, biofuel, dg_mapgen
|
||||||
|
@ -39,7 +39,11 @@ function motorcycle.attach_driver_stand(self, player)
|
|||||||
player:set_attach(self.object, "", self._seat_pos[1], {x = 0, y = 0, z = 0})
|
player:set_attach(self.object, "", self._seat_pos[1], {x = 0, y = 0, z = 0})
|
||||||
--player:set_eye_offset({x = 0, y = 0, z = 1.5}, {x = 0, y = 3, z = -30})
|
--player:set_eye_offset({x = 0, y = 0, z = 1.5}, {x = 0, y = 3, z = -30})
|
||||||
player:set_eye_offset({x = self._seat_pos[1].x, y = 0, z = self._seat_pos[1].z}, {x = 0, y = 3, z = -30})
|
player:set_eye_offset({x = self._seat_pos[1].x, y = 0, z = self._seat_pos[1].z}, {x = 0, y = 3, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
-- makes it "invisible"
|
-- makes it "invisible"
|
||||||
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
||||||
@ -93,11 +97,20 @@ function motorcycle.dettach_driver_stand(self, player)
|
|||||||
--automobiles_lib.remove_hud(player)
|
--automobiles_lib.remove_hud(player)
|
||||||
|
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
if player_api.player_attached[name] then
|
if player_api.player_attached[name] then
|
||||||
player_api.player_attached[name] = nil
|
player_api.player_attached[name] = nil
|
||||||
end
|
end
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
|
||||||
player_api.set_animation(player, "stand")
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if self.driver_properties then
|
if self.driver_properties then
|
||||||
player:set_properties({mesh = self.driver_properties.mesh})
|
player:set_properties({mesh = self.driver_properties.mesh})
|
||||||
@ -134,7 +147,11 @@ function motorcycle.attach_pax_stand(self, player)
|
|||||||
player:set_attach(self.object, "", self._seat_pos[2], {x = 0, y = 0, z = 0})
|
player:set_attach(self.object, "", self._seat_pos[2], {x = 0, y = 0, z = 0})
|
||||||
--player:set_eye_offset({x = 0, y = 3, z = 0}, {x = 0, y = 3, z = -30})
|
--player:set_eye_offset({x = 0, y = 3, z = 0}, {x = 0, y = 3, z = -30})
|
||||||
player:set_eye_offset({x = self._seat_pos[2].x, y = 3, z = self._seat_pos[2].z}, {x = 0, y = 3, z = -30})
|
player:set_eye_offset({x = self._seat_pos[2].x, y = 3, z = self._seat_pos[2].z}, {x = 0, y = 3, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
-- makes it "invisible"
|
-- makes it "invisible"
|
||||||
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
||||||
@ -175,10 +192,19 @@ function motorcycle.dettach_pax_stand(self, player)
|
|||||||
if player then
|
if player then
|
||||||
--player:set_properties({physical=true})
|
--player:set_properties({physical=true})
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
player_api.player_attached[name] = nil
|
|
||||||
player_api.set_animation(player, "stand")
|
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
--remove_physics_override(player, {speed=1,gravity=1,jump=1})
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
|
if player_api.player_attached[name] then
|
||||||
|
player_api.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
if self.pax_properties then
|
if self.pax_properties then
|
||||||
player:set_properties({mesh = self.pax_properties.mesh})
|
player:set_properties({mesh = self.pax_properties.mesh})
|
||||||
|
@ -39,7 +39,11 @@ function vespa.attach_driver_stand(self, player)
|
|||||||
player:set_attach(self.object, "", self._seat_pos[1], {x = 0, y = 0, z = 0})
|
player:set_attach(self.object, "", self._seat_pos[1], {x = 0, y = 0, z = 0})
|
||||||
--player:set_eye_offset({x = 0, y = 0, z = 1.5}, {x = 0, y = 3, z = -30})
|
--player:set_eye_offset({x = 0, y = 0, z = 1.5}, {x = 0, y = 3, z = -30})
|
||||||
player:set_eye_offset({x = self._seat_pos[1].x, y = 0, z = self._seat_pos[1].z}, {x = 0, y = 3, z = -30})
|
player:set_eye_offset({x = self._seat_pos[1].x, y = 0, z = self._seat_pos[1].z}, {x = 0, y = 3, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
-- makes it "invisible"
|
-- makes it "invisible"
|
||||||
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
||||||
@ -85,11 +89,19 @@ function vespa.dettach_driver_stand(self, player)
|
|||||||
--automobiles_lib.remove_hud(player)
|
--automobiles_lib.remove_hud(player)
|
||||||
|
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
if player_api.player_attached[name] then
|
if player_api.player_attached[name] then
|
||||||
player_api.player_attached[name] = nil
|
player_api.player_attached[name] = nil
|
||||||
end
|
end
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
|
||||||
player_api.set_animation(player, "stand")
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if self.driver_properties then
|
if self.driver_properties then
|
||||||
player:set_properties({mesh = self.driver_properties.mesh})
|
player:set_properties({mesh = self.driver_properties.mesh})
|
||||||
@ -126,7 +138,11 @@ function vespa.attach_pax_stand(self, player)
|
|||||||
player:set_attach(self.object, "", self._seat_pos[2], {x = 0, y = 0, z = 0})
|
player:set_attach(self.object, "", self._seat_pos[2], {x = 0, y = 0, z = 0})
|
||||||
--player:set_eye_offset({x = 0, y = 3, z = 0}, {x = 0, y = 3, z = -30})
|
--player:set_eye_offset({x = 0, y = 3, z = 0}, {x = 0, y = 3, z = -30})
|
||||||
player:set_eye_offset({x = self._seat_pos[2].x, y = 3, z = self._seat_pos[2].z}, {x = 0, y = 3, z = -30})
|
player:set_eye_offset({x = self._seat_pos[2].x, y = 3, z = self._seat_pos[2].z}, {x = 0, y = 3, z = -30})
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
player_api.player_attached[name] = true
|
player_api.player_attached[name] = true
|
||||||
|
elseif airutils.is_mcl then
|
||||||
|
mcl_player.player_attached[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
-- makes it "invisible"
|
-- makes it "invisible"
|
||||||
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"})
|
||||||
@ -167,10 +183,19 @@ function vespa.dettach_pax_stand(self, player)
|
|||||||
if player then
|
if player then
|
||||||
--player:set_properties({physical=true})
|
--player:set_properties({physical=true})
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
player_api.player_attached[name] = nil
|
|
||||||
player_api.set_animation(player, "stand")
|
|
||||||
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
|
||||||
--remove_physics_override(player, {speed=1,gravity=1,jump=1})
|
|
||||||
|
if automobiles_lib.is_minetest then
|
||||||
|
if player_api.player_attached[name] then
|
||||||
|
player_api.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
player_api.set_animation(player, "stand")
|
||||||
|
elseif automobiles_lib.is_mcl then
|
||||||
|
if mcl_player.player_attached[name] then
|
||||||
|
mcl_player.player_attached[name] = nil
|
||||||
|
end
|
||||||
|
mcl_player.player_set_animation(player, "stand")
|
||||||
|
end
|
||||||
|
|
||||||
if self.pax_properties then
|
if self.pax_properties then
|
||||||
player:set_properties({mesh = self.pax_properties.mesh})
|
player:set_properties({mesh = self.pax_properties.mesh})
|
||||||
|
Loading…
Reference in New Issue
Block a user