Ferk wrote:Maybe it would work to use minetest.setting_set (http://dev.minetest.net/minetest.setting_set).
rubenwardy wrote:minetest.set_mapgen_params(MapgenParams) may be the solution
https://github.com/minetest/minetest/bl ... .txt#L2007
you can set seed, flags, water level and mgname.
http://dev.minetest.net/Mapgen_Parameters wrote:This parameter cannot be modified through the Lua API.
Don wrote:If I wanted to do a block of code with register on die then where can I put it?
I want to make it so if a certain node is below when the player dies they spawn at a certain position.
minetest.register_on_dieplayer(function(player)
local pos = vector.round(player:getpos())
pos.y = pos.y-1
if minetest.get_node(pos).name ~= […] then
return
end
minetest.after(0, function(name)
local player = minetest.get_player_by_name(name)
if not player then
return
end
player:moveto([…])
end, player:get_player_name())
end)Hybrid Dog wrote:Don wrote:If I wanted to do a block of code with register on die then where can I put it?
I want to make it so if a certain node is below when the player dies they spawn at a certain position.
https://github.com/minetest/minetest/bl ... .txt#L1825
l guess this is easy. Put the code in init.lua, not in a function like the abm action.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_on_dieplayer(function(player)
local pos = vector.round(player:getpos())
pos.y = pos.y-1
if minetest.get_node(pos).name ~= […] then
return
end
minetest.after(0, function(name)
local player = minetest.get_player_by_name(name)
if not player then
return
end
player:moveto([…])
end, player:get_player_name())
end)
Amaz wrote:I think that if you change that to register_on_respawnplayer it would work. (That's the one the api says "return true in func to disable regular player placement" about.)
Don wrote:I also need to know if there is a way to make a node not highlight when pointed at but still not let the player point through it. If I set pointable = false then the player can point through it. The same goes for if I set selecetion box to 0,0,0,0,0,0.
minetestcr wrote:<snip>
minetest.register_node("stj:terrazo", {
description = "terrazo del piso",
tiles = {"terrazo.png"},
inventory_image = {"terrazo.png"},
sunlight_propagates = true,
paramtype = "light",
walkable = true,
sounds = default.node_sound_stone_defaults(),
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3},
})
minetest.register_craft({
output = "stj:terrazo 4",
recipe = {
{"group:sand", "default:gravel", ""},
{"", "", ""},
{"", "", ""},
}
})
stairs.register_ <stair / slab>(
"terrazo",
"stj:terrazo",
{snappy=2, cracky=3, oddly_breakable_by_hand=3},
{"terrazo.png"},
"terrazo del piso <stair / slab>",
default.node_sound_stone_defaults()
)Krock wrote:minetestcr wrote:<snip>
Use the function stairs.register_stair (or .register_slab) to register your node as a stair (or slab).
Here's how it could look like: (don't forget to add "default" and "stairs" to your depends.txt file)
Don wrote:Is there a way to get objects inside a defined area similar to get objects inside radius?
eduardomezencio wrote:I also wanted to know about this. And even another related thing: is there a way for a block to be pointable only when using a certain tool?
LionsDen wrote:Try looking at the code for the default bucket. That allows water and lava to be pointable when they normally aren't. Hope this helps you.
Hybrid Dog wrote:l don't believe you, you can place water on nodes by pointing them with the water bucket and right clicking.
Ferk wrote:Thought maybe there's a chance the feature is done in the lua api level of the engine, so he could have a look at it.. but I doubt it. Liquids are very particular and probably there's a lot of hardcoded stuff around them for the sake of efficiency.
Hybrid Dog wrote:Ferk wrote:Thought maybe there's a chance the feature is done in the lua api level of the engine, so he could have a look at it.. but I doubt it. Liquids are very particular and probably there's a lot of hardcoded stuff around them for the sake of efficiency.
l guess you could do it similar to the way it's done for the sounds:
e.g. add a group cracky_pointable = 0 to the tool which makes the cracky group (stone, cobble, etc) not be pointable by it
To disallow pointing with a tool, just set it's range to 0.
Don wrote:Hybrid Dog wrote:Ferk wrote:Thought maybe there's a chance the feature is done in the lua api level of the engine, so he could have a look at it.. but I doubt it. Liquids are very particular and probably there's a lot of hardcoded stuff around them for the sake of efficiency.
l guess you could do it similar to the way it's done for the sounds:
e.g. add a group cracky_pointable = 0 to the tool which makes the cracky group (stone, cobble, etc) not be pointable by it
To disallow pointing with a tool, just set it's range to 0.
That would work for a tool to be able to point at something. I would like a way to make a node not pointable but still not allow the player to point past the node.
I have suggested that there be an option to make the selection box transparent. This would make it so you can have windows that are pointable but you do not get the selection box. I think it would make them look much better.
Hybrid Dog wrote:Don wrote:Hybrid Dog wrote:How about hiding the selection box if you're wielding an implacable item which can't dig the pointed node? (e.g. pointing mese with a wood pick would not show it)
Users browsing this forum: No registered users and 8 guests