paramat wrote:minp.y of the surface mapchunk is -32, so this code only acts on empty mapchunks, mgv6 doesn't rise above the surface mapchunk (-32 to 47).
Perhaps just ignore any heightmap value of y = 47 as that is usually inside a mountain (not in mgv6 though because of the above fact).
Thanks! that makes sense.
I changed the dungeon maze to generate from -35 downwards and I had no problems anymore. I'll limit the generation of the entrances to the chunks in the ground level only (from -32 to 47).
Entrances will sometimes generate inside of mountains, but I think I prefer to leave it like that rather than prevent the entrance from getting generated at all.
Wow, thanks, "emerging" the area sounds exactly like what I wanted! I'ma go test for minetest.emerge_area(), and use it if present. I won't be relying on the result, anyway (it's very legit for the area to not be emerged yet / be unloaded again by the time I do my checks). Thanks!
I am trying to figure out item_drop. I am not sure if it is the right function to use.
I am trying to make it so when you punch a node the node stays but an item is placed into the players inventory.
Nathan.S wrote:I use minetest.add_item(pos, 'mod:thing') which works just fine, I think this may be an area where multiple functions can accomplish the same thing.
Thanks. I will do it that way.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!
I want to get_objects_inside_radius to find players. Then I want it to get the player names and make them strings.
Using the example from the wiki how would I change it so I can send a chat message to people within a set radius?
local all_objects = minetest.get_objects_inside_radius({x=0, y=0, z=0}, 10)
local players = {}
local _,obj
for _,obj in ipairs(all_objects) do
if obj:is_player() then
table.insert(players, obj)
end
end
minetest.chat_send_player(players, name.." placed a "..descr)
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!
Don you might try looking at this code. https://github.com/minetest-australopit ... e.lua#L321 I won't do anything for bystanders that aren't playing the game, but might that might not be a problem. I can't imagine there would be too many people interested in watching but not playing.
I am trying to figure out how to make the Nuke Mod 1.6 drop lumps when detonated. I have been comparing the code to the TNT mod and trying to figure out what to add from the TNT mod to the Nuke Mod to make it work.
DoyleChris wrote:I am trying to figure out how to make the Nuke Mod 1.6 drop lumps when detonated. I have been comparing the code to the TNT mod and trying to figure out what to add from the TNT mod to the Nuke Mod to make it work.
Games can have a minetest.conf file that will override some settings, right? (I never found this in the documentation, but I found a minetest.conf file in a lot of games)
eduardomezencio wrote:Games can have a minetest.conf file that will override some settings, right? (I never found this in the documentation, but I found a minetest.conf file in a lot of games)
Can a mod do the same?
Maybe it would work to use minetest.setting_set (http://dev.minetest.net/minetest.setting_set).
But would this override the global settings for the user? I hope it only affects the minetest.conf of the world, the documentation doesn't explain.
This would help, but only if it could be executed before anything is loaded. That's because the thing I want to change is the chunk size, to optimize my mapgen. Changing it after the world starts generating would not help.
eduardomezencio wrote:This would help, but only if it could be executed before anything is loaded. That's because the thing I want to change is the chunk size, to optimize my mapgen. Changing it after the world starts generating would not help.
I guess if you put it directly in the init.lua of your mod it should be effective as soon as the mods get loaded (which I believe precedes mapgen).
Ferk wrote:I guess if you put it directly in the init.lua of your mod it should be effective as soon as the mods get loaded (which I believe precedes mapgen).
I don't know if this is the right thing, but it kinda 'feels like' the right thing. I'll test it soon.
I also have a question: how come there's a "minetest.dir_to_wallmounted" but not a "minetest.wallmounted_to_dir"?
I'm implementing some rotation logic and I need to be able to convert the values to vector, transform them and convert them back. I can do this with facedir nodes but not wallmounted.
EDIT: Not sure if there's some other way to convert wallmounted to dir right now, but I opened a pull request to add that function to the engine.
I tested it, and it's not the solution. First problem is that it changes the user setting in his minetest.conf file, so it may cause problems with his other worlds. Second that just putting it in init.lua does not make the setting change before mapgen starts. Only after closing and opening the world again it starts to work.
Thank you very much for your answer. This seems to be the solution, but the information in the wiki contradicts it. First, chunksize is not listed as a possible value for mapgen_params here: http://dev.minetest.net/minetest.set_mapgen_params