minetest.register_node("fruitgrow:apples", {
description = "Apples",
paramtype = "light",
tiles = {"default_apple.png^default_leaves.png^default_torch_animated.png"},
drawtype = "allfaces_optional",
is_ground_content = false,
groups = {dig_immediate=3, leafdecay=1, leaves=1},
drop = {
max_items = 0,
},
})
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/guns.lua")
end
modernguns:register_weapon("modernguns:mp5holo", {
description = "MP5(ranged damage 3|max ammo 30)",
inventory_image = "modernguns_mp5holo.png",
rounds = 10,
shots = 3,
spec = {
range = 285,
step = 20,
tool_caps = {full_punch_interval=0.125, damage_groups={fleshy=3}},
groups = {snappy=3, fleshy=3, oddly_breakable_by_hand=3},
sound = "modernguns_mp5",
particle = "modernguns_bullet.png",
},
})
2016-06-02 22:44:55: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2016-06-02 22:44:55: WARNING[Main]: Undeclared global variable "modernguns" accessed at ...test\bin\..\games\minetest_game\mods\modernguns/guns.lua:1
2016-06-02 22:44:55: ERROR[Main]: ModError: Failed to load and run script from C:\Games\Minetest\bin\..\games\minetest_game\mods\modernguns\init.lua:
2016-06-02 22:44:55: ERROR[Main]: ...test\bin\..\games\minetest_game\mods\modernguns/guns.lua:1: attempt to index global 'modernguns' (a nil value)
2016-06-02 22:44:55: ERROR[Main]: stack traceback:
2016-06-02 22:44:55: ERROR[Main]: ...test\bin\..\games\minetest_game\mods\modernguns/guns.lua:1: in main chunk
2016-06-02 22:44:55: ERROR[Main]: [C]: in function 'dofile'
2016-06-02 22:44:56: ERROR[Main]: ...test\bin\..\games\minetest_game\mods\modernguns\init.lua:3: in main chunk
2016-06-02 22:44:56: ERROR[Main]: Check debug.txt for details.
TumeniNodes wrote:With the new doors api, is it possible to make doors utilize 2 node spaces..., so doors are place in the center of nodes and then able to occupy a portion of the next node when in the open position?
It took me a few minutes to figure out why, when I changed the doors pos, that it would just swing to the side within the same space (looking extremely odd)
sofar wrote:TumeniNodes wrote:With the new doors api, is it possible to make doors utilize 2 node spaces..., so doors are place in the center of nodes and then able to occupy a portion of the next node when in the open position?
It took me a few minutes to figure out why, when I changed the doors pos, that it would just swing to the side within the same space (looking extremely odd)
No, the doors API only supports the classical door mesh that is 1 node wide/deep, and 2 nodes high.
amadin wrote:How change formspec background image and buttons background in inventory_plus (http://github.com/cornernote/minetest-i ... s/init.lua)?
KCoombes wrote:you might check the default:furnace code, as I know there's an effect if you use a furnace next to/on ice (not sure if TenPlus1 coded that for Xanadu)
oscar14 wrote:Topic: how can i make a node that's only placeable in a tipe of node?
Reason: I want to make a mod of a furnace for alloys that's too hot and can only be placed on stone.
More Info: I am new in modding but I want to learn. Also sorry for my english, is not my native language.
minetest.register_node("mymod:my_node", {
-- Other fields coming before
on_place = function(itemstack, placer, pointed_thing)
local undernode = ... -- Get the node under the location the player tried to place
local is_good = ... -- Check that the node is valid for placing a furnace on.
if is_good then
return minetest.item_place(itemstack, placer, pointed_thing)
else
return itemstack
end
end,
-- Other fields coming after
})
Byakuren wrote:Define the "on_place" field of the node's definition. More specifically, override it so that if the placement is in a good spot, you call minetest.item_place and return its output. Otherwise, return the original itemstack without doing anything. This would look something like:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node("mymod:my_node", {
-- Other fields coming before
on_place = function(itemstack, placer, pointed_thing)
local undernode = ... -- Get the node under the location the player tried to place
local is_good = ... -- Check that the node is valid for placing a furnace on.
if is_good then
return minetest.item_place(itemstack, placer, pointed_thing)
else
return itemstack
end
end,
-- Other fields coming after
})
Izaya wrote:Topic: Lua 5.1 replacements for bit32?
Reason: Need to extract bits from bytes
I've played with bit32 in lua 5.2 but 5.1 lacks it. What other options do I have in the context of Minetest?
KCoombes wrote:can a decoration have a drop, or do I have to use the farming mod to accomplish that?
signs_lib.metal_wall_sign_model = {
nodebox = {
type = "fixed",
fixed = {-0.4375, -0.25, 0.4375, 0.4375, 0.375, 0.5}
},
textpos = {
{delta = {x = 0, y = 0.07, z = 0.43 }, yaw = 0},
{delta = {x = 0.43, y = 0.07, z = 0 }, yaw = math.pi / -2},
{delta = {x = 0, y = 0.07, z = -0.43 }, yaw = math.pi},
{delta = {x = -0.43, y = 0.07, z = 0 }, yaw = math.pi / 2},
}
}
pithy wrote:Is there a way to make minetest.line_of_sight cut corners?
minetest.register_privilege("foo", privilege definition)
minetest.register_chatcommand("foo", {
params = "<bar>",
description = "Do bar with foo",
privs = {foo = true},
func = function( _ , text)
minetest.chat_send_all(text)
return true, "foo did bar well"
end,
})
local privs = minetest.get_player_privs("name") -- not sure if right function
if privs.shout then
-- has shout
else
-- doesn't have shout
end
local privs = minetest.get_player_privs("name") -- not sure if right function
for i, priv in pairs(privs) do
if priv == "shout" then
-- has shout
return
end
end
-- doesn't have shout
return
function check_day(old_count)
local new_count = minetest.get_day_count()
if new_count > old_count then
execute()
end
minetest.after(10, check_day, new_count)
end
Gerald wrote:I want to execute a function every time a day passes (clock strikes midnight or player sleeps in bed).
Is there a better solution than this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
function check_day(old_count)
local new_count = minetest.get_day_count()
if new_count > old_count then
execute()
end
minetest.after(10, check_day, new_count)
end
function check_day()
if minetest.get_timeofday() == 1 -- 1 is midnight, end of day
execute() --Do what you whant
end
local time_speed = setting_get("time_speed")
minetest.after(24*60*60*60/time_speed, check_day)
end
iangp wrote:Why you don't simple get the time of day instead?
minetest.add_listener(<var - to - bind>, <desired - value> ,<callback - function>)
--or even some expression
minetest.add_listener(<boolean function>,<callback function>)
Users browsing this forum: No registered users and 5 guests