Page 35 of 169
Posted: Tue Jan 21, 2014 19:39
by PilzAdam
pandaro wrote:So the question is:
I want to test a terrain generator , for example mapgenv7
I want to first of all that the world created is always the same, to do this, it is enough, when I create a world, give it a name, and select a fixed seed, such as the 1 seed.
Now the problem, I want, from file minetest. conf, the generator reads some parameters such as:
# mgv7_np_terrain = 10, 12, (350, 350, 350), 82 341, 5, 0.6
# mgv7_np_bgroup = 0.5, 0.3125, (350, 350, 350), 5923, 2, 0.6
# mgv7_np_heat = 25, 50, (500, 500, 500), 35293, 1, 0
# mgv7_np_humidity = 50, 31.25, (750, 750, 750), 12094, 2, 0.6
to do this then I compile my minetest.conf that I show it as it is:
main_menu_tab = server
name = pandaro
server_dedicated = false
fixed_map_seed = 1
main_menu_last_game_idx = 4
mainmenu_last_selected_world = 2
selected_world_path = /home/p/minetest/0.49.1/bin/../worlds/sdcs
enable_shaders = false
enable_damage = false
port = 30000
server_announce = true
address = 192.168.0.2
remote_port = 30000
creative_mode = true
num_emerge_threads = 2
mg_name = v7
mgv7_np_terrain = 0, 1, (1, 1 1), 1, 1, 1
mgv7_np_bgroup = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_heat = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_humidity = 0, 1, (1, 1, 1), 1, 1, 1
but I realize that in spite of the parameter fixed_map_seed = 1 the map is different each time.
it seems to me that having or not having completed minetest.conf the generator of the terrain refers only on what I write in the main menu.
How do I create a map by passing minetest.conf?
Create a map without the gui (via command line options, see --help).
Posted: Tue Jan 21, 2014 19:54
by qwrwed
Code: Select all
fixed_map_seed = 66768767867868789
Every world created after putting this in minetest.conf and saving should have the seed 66768767867868789. I created two worlds after adding that line, and they were both the same.
Posted: Tue Jan 21, 2014 21:45
by Tails19935
If you make a skin mode, will it affect all the players on a sever or will it just show for you and will other players be able to see my skin?
I'm makeing a skin mod.
Posted: Fri Jan 24, 2014 21:37
by ch98
this code here
Code: Select all
local function read_image(f, bmp, infoheader, hmin, hmax, wmin, wmax)
local i, line, height, dir
height = infoheader.biHeight
line = (height < 0) and 1 or height
dir = (height < 0) and 1 or -1
height = math.abs(height)
print(("[bmpmap.bmp] size=%dx%d bpp=%d"):format(
infoheader.biWidth,
infoheader.biHeight,
infoheader.biBitCount
))
bmp.pixels = { }
for i = 1, height do
local row = { }
if hmin <= i <= hmax then
bmp.pixels[line] = row
end
if infoheader.biBitCount == 24 then
read_24bit_line(infoheader.biWidth, f, row, wmin, wmax)
elseif infoheader.biBitCount == 32 then
read_32bit_line(infoheader.biWidth, f, row, wmin, wmax)
else
return false
end
line = line + dir
end
return true
end
causes error saying
Code: Select all
13:34:58: ERROR[main]: ServerError: /root/.minetest/mods/bmpmap/loader_bmp.lua:153: attempt to compare boolean with number
13:34:58: ERROR[main]: stack traceback:
13:34:58: ERROR[main]: /root/.minetest/mods/bmpmap/loader_bmp.lua:153: in function 'read_image'
13:34:58: ERROR[main]: /root/.minetest/mods/bmpmap/loader_bmp.lua:228: in function 'load'
13:34:58: ERROR[main]: /root/.minetest/mods/bmpmap/imageloader.lua:49: in function 'load'
13:34:58: ERROR[main]: /root/.minetest/mods/bmpmap/mapgen.lua:37: in function '?'
full code at
github
help please? I can't find the problem in the code while i stared at it for 30 minutes.
Edit: found the error. hmin <= i <= hmax was supposed to be hmin <= i and i <= hmax
Posted: Mon Jan 27, 2014 10:58
by Landrover110
How can i get my game to run faster with lots of mods
Posted: Mon Jan 27, 2014 16:14
by LionsDen
Landrover110 wrote:How can i get my game to run faster with lots of mods
Get a faster computer?
Or you could turn off shaders and the complex plant drawtypes. Maybe use the default textures as larger textures will slow the system. Change the view distance to be shorter. Decrease the amount of chunks kept in memory. Stuff like that can be found by looking at FAQs and threads in the forum and by doing some good searches. Hope this helps some.
Posted: Tue Jan 28, 2014 01:25
by GunshipPenguin
I'm having a problem with a mod that I'm making to protect the area around the spawnpoint from being damaged. The code to stop people from digging nodes is as follows.
Code: Select all
minetest.register_on_dignode(function(pos, oldnode, digger)
if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been dug within spawn as defined with limit
if not minetest.get_player_privs(digger:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
minetest.chat_send_player(digger:get_player_name(), "You are attempting to dig inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot dig inside spawn
minetest.set_node(pos, oldnode)
digger:get_inventory():remove_item("main", oldnode)
end
end
end)
It works fine, but the code to stop players from placing nodes does not. I remove the node, inform the player that he cannot build near spawn and then try to add the node back to his/her inventory. For some reason though, the item isn't being added into the inventory.
Code: Select all
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been placed within spawn as defined with limit
if not minetest.get_player_privs(placer:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
minetest.chat_send_player(placer:get_player_name(), "You are attempting to build inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot build inside spawn
minetest.set_node(pos, oldnode)
placer:get_inventory():add_item("main", newnode.name)
end
end
end)
Thanks in advance for any help. I'm new to Lua and Minetest modding so I apologize if this question is a bit noobish.
Posted: Tue Jan 28, 2014 17:44
by PilzAdam
GunshipPenguin wrote:I'm having a problem with a mod that I'm making to protect the area around the spawnpoint from being damaged. The code to stop people from digging nodes is as follows.
Code: Select all
minetest.register_on_dignode(function(pos, oldnode, digger)
if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been dug within spawn as defined with limit
if not minetest.get_player_privs(digger:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
minetest.chat_send_player(digger:get_player_name(), "You are attempting to dig inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot dig inside spawn
minetest.set_node(pos, oldnode)
digger:get_inventory():remove_item("main", oldnode)
end
end
end)
It works fine, but the code to stop players from placing nodes does not. I remove the node, inform the player that he cannot build near spawn and then try to add the node back to his/her inventory. For some reason though, the item isn't being added into the inventory.
Code: Select all
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been placed within spawn as defined with limit
if not minetest.get_player_privs(placer:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
minetest.chat_send_player(placer:get_player_name(), "You are attempting to build inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot build inside spawn
minetest.set_node(pos, oldnode)
placer:get_inventory():add_item("main", newnode.name)
end
end
end)
Thanks in advance for any help. I'm new to Lua and Minetest modding so I apologize if this question is a bit noobish.
You should look into minetest.is_protected() (see doc/lua_api.txt)
Posted: Thu Jan 30, 2014 03:33
by GunshipPenguin
Hybrid Dog wrote:setting the oldnode after adding the newnode into the inventory or "return itemstack" might help
Yay! using return itemstack makes it work. Thanks a lot, I really appreciate it.
Posted: Fri Jan 31, 2014 21:04
by pandaro
about sneak and sneak_glitch
What changed exactly sneak and sneak_glitch in player:set_physics_override ()
I realized that if I sneak == true then the player does not come down from the block if I hold down shift.
if you sneak == false then the player goes down from the block even if I keep holding shift.
I do not understand what happens if sneak_glitch is changed from true to false.
It seems to me always the same
Posted: Fri Jan 31, 2014 22:06
by PilzAdam
pandaro wrote:about sneak and sneak_glitch
What changed exactly sneak and sneak_glitch in player:set_physics_override ()
I realized that if I sneak == true then the player does not come down from the block if I hold down shift.
if you sneak == false then the player goes down from the block even if I keep holding shift.
I do not understand what happens if sneak_glitch is changed from true to false.
It seems to me always the same
Try searching for "sneak elevator". sneak_glitch = false basically prevents that.
Posted: Fri Jan 31, 2014 22:18
by pandaro
PilzAdam wrote:Try searching for "sneak elevator". sneak_glitch = false basically prevents that.
Where should I look? I tried google but only find discussions in irc (unclear).
And I can not find anything on
http://dev.minetest.net
In any case I may have figured out what you want to explain:
it is the ability to climb on a step by holding down shift?
Posted: Sat Feb 01, 2014 20:22
by philipbenr
Krock wrote:I'm not sure but
on_rightclick itemstack should be the stack, which the player used to click right onto the node.
What exactly do you want to do?
When I click something with a certain itemstack, I wish it to perform a specific function. Like if you are wearing specific gloves, you can turn on something, or remove something, but only with that specific item wielded.
Basically, I want to have a certain pair of gloves, that if you are wielding them, you can rightclick a certain node and remove it, and if you leftclick the node, it plays a sound. It is for the audio/dj mod I am working toward.
Posted: Sat Feb 01, 2014 20:59
by Krock
@philipbenr, post abrove:
How about defining the gloves, instead of the diffrent nodes?
like: on_use, on_place (not sure, but you can loop up the documentation)
Posted: Mon Feb 03, 2014 01:54
by philipbenr
Krock wrote:@philipbenr, post abrove:
How about defining the gloves, instead of the diffrent nodes?
like: on_use, on_place (not sure, but you can loop up the documentation)
Found the answer to my problem. I have to use on_place/on_use in the craftitem callbacks and define the pointed thing as an "audio:______" and have the callback function. I'm guessing this is correct.
Also, how can I define the pointed thing as one specific node? As in the example below:
Code: Select all
on_use = function(itemstack, placer, pointed_thing <-- Here? )
--Or Somewhere down here?
Code: Select all
on_use = function(itemstack, placer, audio:player_black )
Code: Select all
on_use = function(itemstack, placer, pointed_thing)
pointed_thing="audio:player_black"
Somewhere else? Some other way?
Posted: Mon Feb 03, 2014 14:47
by Krock
philipbenr wrote:Also, how can I define the pointed thing as one specific node?
Code: Select all
on_use = function(itemstack, placer, pointed_thing <-- Here? )
--Or Somewhere down here?
Code: Select all
minetest.register_tool("audio:gloves", {
description = "xyz",
inventory_image = "xyz.png",
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~="node" then
return
end
local node = minetest.get_node(pointed_thing.under)
--node equals the node you pointed to when using the "gloves"
Posted: Tue Feb 04, 2014 01:05
by philipbenr
That is another way of doing it i suppose. Ok, thanks so much. I'll see if I can make something of all this.
Posted: Tue Feb 04, 2014 08:28
by Gambit
How would I make a block that hurts the player once he/she touches it either on the sides on standing on top of it?
Posted: Tue Feb 04, 2014 13:57
by Evergreen
Gambit wrote:How would I make a block that hurts the player once he/she touches it either on the sides on standing on top of it?
Just stick this in the node definition:
Code: Select all
damage_per_second = amount_of_damage,
Posted: Tue Feb 04, 2014 16:21
by Casimir
That only works when standing in the node. I haven't found any workaround.
Posted: Tue Feb 04, 2014 17:40
by Sokomine
Casimir wrote:
That only works when standing in the node. I haven't found any workaround.
You might use an abm to replace the air around your node with special air that does the damage. Or let the player live on :-)
Posted: Fri Feb 07, 2014 03:32
by Novacain
is there an easy way to add a second recipe for crafting something?
I have multiple versions of the same block (different colors) and several of those blocks. what I have is this:
-W,-B,-G,-O are represtitive of colors. they craft like this;
A-W->B-W->C-W->D-W
A-W->A-B/A-O/A-G
B-W->B-B/B-O/B-G
C-W->C-B/C-O/C-G
D-W->D-B/D-O/D-G
I wanna add support so this can be included:
A-B->B-B->C-B->D-B
A-O->B-O->C-O->D-O
A-G->B-G->C-G->D-G
hope you can understand this, and help. my main question is whether I need to create another class (if that's what they are called in Lua) or whether it can be incorperated into the current class.
the reason why is cause I will have over 32 variations of this node, and I don't want to create that much additional code if it isn't neccesary
Posted: Fri Feb 07, 2014 09:17
by DeepGaze
is there a way to write a code to:
player places block A and then block B
player hits block A
block A places block C
Block B turns into a teleport to Block C
Block C turns into a teleport to Block B
player hits block A
Block C is destroyed
Block B stops teleport function
any ideas (Stupid in the way of modding)
Posted: Sat Feb 08, 2014 01:48
by Sokomine
Novacain wrote:
Is there an easy way to add a second recipe for crafting something?
I have multiple versions of the same block (different colors) and several of those blocks. what I have is this:
If you have diffrent colors, please try to stick to the naming schem wool uses (or, alternatively, unifieddyes) so that your mod may be supported by my colormachine mod. That might also help you with easier coloring.
Novacain wrote:
I wanna add support so this can be included:
A-B->B-B->C-B->D-B
A-O->B-O->C-O->D-O
A-G->B-G->C-G->D-G
There's no direct way for that. You might create a table with all the block names (a simple list) and let a for loop iterate over it so that you basicly craft list[ i ] -> list[ i+1 ].
DeepGaze wrote:
is there a way to write a code to:
player places block A and then block B
player hits block A
block A places block C
Depends a bit. If all your blocks are loaded - fine, could be made working. If the target isn't loaded - the new minetest.forceload_block might help you perhaps.
Posted: Sat Feb 08, 2014 17:43
by i1abnrk
Issue: lua mapgen seems to have no effect. I have tried several lua mapgen implementations (mods) but it seems the mapgen + seed in gui overrides the mod code and I'm stuck with vanilla every time. Minetest_game and the mod game both produce identical worlds. What are recommended settings or the prescribed method? I am using minetest 0.4.9 installed from deb on Ubuntu precise.