Post your modding questions here

Locked
User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

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).

User avatar
qwrwed
Member
Posts: 326
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Post

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.

Tails19935
New member
Posts: 1
Joined: Tue Jan 21, 2014 21:42

by Tails19935 » Post

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.

ch98
Member
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Post

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
Last edited by ch98 on Fri Jan 24, 2014 23:04, edited 1 time in total.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

Landrover110
Member
Posts: 19
Joined: Mon Jan 13, 2014 09:38
In-game: Landrover
Location: South luangwa , Zambia

by Landrover110 » Post

How can i get my game to run faster with lots of mods

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

by GunshipPenguin » Post

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.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

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)

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

by GunshipPenguin » Post

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.

User avatar
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

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
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

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.

User avatar
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

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?
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

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.
Spoiler
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.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

@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)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

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?
Spoiler

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?
Last edited by philipbenr on Mon Feb 03, 2014 01:56, edited 1 time in total.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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"
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

That is another way of doing it i suppose. Ok, thanks so much. I'll see if I can make something of all this.

User avatar
Gambit
Member
Posts: 453
Joined: Sat Oct 29, 2011 19:31
Location: United States

by Gambit » Post

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?
Current Projects: MineToon | PixelBOX
Gambit's Checkmate Server - 43.65.296.232 - port: 30001

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

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,
Back from the dead!

User avatar
Casimir
Member
Posts: 1206
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

That only works when standing in the node. I haven't found any workaround.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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 :-)
A list of my mods can be found here.

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

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
Last edited by Novacain on Fri Feb 07, 2014 03:39, edited 1 time in total.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

User avatar
DeepGaze
Member
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze
Location: Take your best guess

by DeepGaze » Post

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)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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.
A list of my mods can be found here.

i1abnrk
Member
Posts: 26
Joined: Sat May 11, 2013 03:20
GitHub: i1abnrk
IRC: i1abnrk
In-game: mervyncoll
Location: Wisconsin
Contact:

by i1abnrk » Post

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.

Locked

Who is online

Users browsing this forum: No registered users and 3 guests