Post your modding questions here

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

Re: Post your modding questions here

by DeepGaze » Fri Sep 26, 2014 21:07

I wish to make a Teleprompter of this concept: a command-controlled value decides weather the player lands at point one or point two but both points land you at base. for clarification see the image below
Image
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
Achilles
Member
 
Posts: 246
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles

Re: Post your modding questions here

by Achilles » Fri Sep 26, 2014 22:19

Nice Idea, but doesn't the Teleporter mod do more or less that, only you have to type in the coords of the position you wish to teleport to rather than place some sort of Teleporter receiver there...
 

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

Re: Post your modding questions here

by DeepGaze » Fri Sep 26, 2014 23:06

no I was meaning an automatic switch without having to mention the way each time. making a seamless transition
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
lag01
Member
 
Posts: 190
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Post your modding questions here

by lag01 » Fri Sep 26, 2014 23:21

stu wrote:hope it helps.

Thank you, it helps!
 

User avatar
rubberduck
Member
 
Posts: 487
Joined: Thu Feb 27, 2014 19:19
IRC: rbduck
In-game: rubberduck

Re: Post your modding questions here

by rubberduck » Sat Sep 27, 2014 10:43

question: is there a fuction to get the name of the node which is slected (which you would place when you click the left mouse botton)


i add 5 different nodes (same nodeboxes, different textures) and i have a function that places different nodes (one standing when pointing on ground and one wall-model that gets placed when placing on wall.

(at the moment i use 5 functions, they have the same code except for the code i needed for the 5 different nodes i use), that works but i have unnecessary code
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Sat Sep 27, 2014 12:07

OK, I am lost again :D
Today I tried add some schematics to map, but I failed.
I really dont know, what is wrong on these codes.

Init :
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
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
   if maxp.y < height_min or minp.y > height_max then
      return
   end
   local y_min = math.max(minp.y, height_min)
   local y_max = math.min(maxp.y, height_max)
   local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
   local pr = PseudoRandom(seed)
   local num_chunks = math.floor(chunks_per_volume * volume)
   local chunk_size = 3
   if ore_per_chunk <= 4 then
      chunk_size = 2
   end
   local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
   --print("generate_ore num_chunks: "..dump(num_chunks))
   for i=1,num_chunks do
      local y0 = pr:next(y_min, y_max-chunk_size+1)
      if y0 >= height_min and y0 <= height_max then
         local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
         local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
         local p0 = {x=x0, y=y0, z=z0}
         for x1=0,chunk_size-1 do
         for y1=0,chunk_size-1 do
         for z1=0,chunk_size-1 do
            if pr:next(1,inverse_chance) == 1 then
               local x2 = x0+x1
               local y2 = y0+y1
               local z2 = z0+z1
               local p2 = {x=x2, y=y2, z=z2}
               if minetest.env:get_node(p2).name == wherein then
                  minetest.env:set_node(p2, {name=name})
               end
            end
         end
         end
         end
      end
   end
end

minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("pokenodeschems:fake_air", "default:dirt_with_grass", minp, maxp, seed+21,   1/30/30/30,    1, -31000,  100)
end)

Schematics :
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
pokenodesschems = {}

local pokenodesschems_list = {
    { "Pokemon Center", "pkmncenter"},
    { "Pokemon Market", "pkmnmarket"},
    { "Pokemon Stadium", "pkmnstadium"},
}

for i in ipairs(pokenodesschems_list) do
    local builddesc = pokenodesschems_list[i][1]
    local build = pokenodesschems_list[i][2]

minetest.register_node("pokenodesschems:fake_air", {
        description = fake_air,
        tiles = {"fake_air.png"},
      is_ground_content = true,
      groups = {not_in_creative_inventory =1},
        on_place = function(itemstack, placer, pointed_thing)
            if pointed_thing.above then
                local file = io.open(minetest.get_modpath("pokenodesschems").."/schems/"..build..".we")
                local value = file:read("*a")
                file:close()
                local p = pointed_thing.above
                p.x = p.x - 5
                p.z = p.z - 2
                local count = worldedit.deserialize(pointed_thing.above, value)
                itemstack:take_item()
            end
            return itemstack
        end,
    })
end

minetest.register_abm({
    nodenames = {"pokenodesschems:pkmncenter"},
       interval = 1,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokenodesschems").."/schems/pkmncenter.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})

minetest.register_abm({
    nodenames = {"pokenodesschems:pkmnmarket"},
       interval = 5,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokenodesschems").."/schems/pkmnmarket.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})

minetest.register_abm({
    nodenames = {"pokenodesschems:pkmnstadium"},
       interval = 1,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokenodesschems").."/schems/pkmnstadium.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})


If is here any other way(easy one), how to put structures to map by generating, please tell me.

EDIT:
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
15:40:21: ERROR[main]: ServerError: ...op\minetest-0.4.10\bin\..\mods\PKMNS\poke
schems\init.lua:42: attempt to concatenate global 'build' (a nil value)
15:40:21: ERROR[main]: stack traceback:
15:40:21: ERROR[main]:  ...op\minetest-0.4.10\bin\..\mods\PKMNS\pokeschems\init.
lua:42: in function <...op\minetest-0.4.10\bin\..\mods\PKMNS\pokeschems\init.lua
:41>
15:40:21: ERROR[main]:  ...Desktop\minetest-0.4.10\bin\..\builtin\game\register.
lua:348: in function <...Desktop\minetest-0.4.10\bin\..\builtin\game\register.lu
a:336>


This error I get when I use this code :

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
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
   if maxp.y < height_min or minp.y > height_max then
      return
   end
   local y_min = math.max(minp.y, height_min)
   local y_max = math.min(maxp.y, height_max)
   local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
   local pr = PseudoRandom(seed)
   local num_chunks = math.floor(chunks_per_volume * volume)
   local chunk_size = 3
   if ore_per_chunk <= 4 then
      chunk_size = 2
   end
   local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
   --print("generate_ore num_chunks: "..dump(num_chunks))
   for i=1,num_chunks do
      local y0 = pr:next(y_min, y_max-chunk_size+1)
      if y0 >= height_min and y0 <= height_max then
         local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
         local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
         local p0 = {x=x0, y=y0, z=z0}
         for x1=0,chunk_size-1 do
         for y1=0,chunk_size-1 do
         for z1=0,chunk_size-1 do
            if pr:next(1,inverse_chance) == 1 then
               local x2 = x0+x1
               local y2 = y0+y1
               local z2 = z0+z1
               local p2 = {x=x2, y=y2, z=z2}
               if minetest.env:get_node(p2).name == wherein then
                  minetest.env:set_node(p2, {name=name})
               end
            end
         end
         end
         end
      end
   end
end

minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("pokeschems:"..build, "default:dirt_with_grass", minp, maxp, seed+21,   1/30/30/30,    1, -31000,  100)
end)


pokeschems = {}

local pokeschems_list = {
    { "Pokemon Center", "pkmncenter"},
    { "Pokemon Market", "pkmnmarket"},
    { "Pokemon Stadium", "pkmnstadium"},   
}

for i in ipairs(pokeschems_list) do
    local builddesc = pokeschems_list[i][1]
    local build = pokeschems_list[i][2]

minetest.register_node("pokeschems:"..build, {
        description = builddesc,
        tiles = {"fake_air.png"},
      is_ground_content = true,
      groups = {not_in_creative_inventory =0},
        on_place = function(itemstack, placer, pointed_thing)
            if pointed_thing.above then
                local file = io.open(minetest.get_modpath("pokeschems").."/schems/"..build..".we")
                local value = file:read("*a")
                file:close()
                local p = pointed_thing.above
                p.x = p.x - 5
                p.z = p.z - 2
                local count = worldedit.deserialize(pointed_thing.above, value)
                itemstack:take_item()
            end
            return itemstack
        end,
    })
end

minetest.register_abm({
    nodenames = {"pokeschems:pkmncenter"},
       interval = 1,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokeschems").."/schems/pkmncenter.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})

minetest.register_abm({
    nodenames = {"pokeschems:pkmnmarket"},
       interval = 1,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokeschems").."/schems/pkmnmarket.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})

minetest.register_abm({
    nodenames = {"pokeschems:pkmnstadium"},
       interval = 1,
   chance = 1,
     action = function(pos)
          if pos then
               local file = io.open(minetest.get_modpath("pokeschems").."/schems/pkmnstadium.we")
               local value = file:read("*a")
               file:close()
               local p = pos
               p.x = p.x - 5
               p.z = p.z - 2
               local count = worldedit.deserialize(pos, value)
          end
     end,
})
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: Post your modding questions here

by Inocudom » Sat Sep 27, 2014 14:19

q9c9p, post: 1636, member: 260 wrote:Hello,
this is my first post in this community, being a linux user I like a lot the idea of an open source and free software game but lets cut to the chase.
Where should one look to create a multiple world mod with scaling, like multiverse for bukkit, to create for example the 9 rings of hell each that scale 1:3 from the precedent world?
Can i call from lua the main mapgen function?
Thank you for your time.
q9c9p

This person made this post in the Freeminer forums. Problem is, those forums are way too quiet. If someone with a solution is willing to post a reply there, it would be greatly appreciated. The place to post it can be found below:
http://forum.freeminer.org/threads/multiple-worlds.181/
 

Strikingwolf
New member
 
Posts: 3
Joined: Wed Sep 17, 2014 00:29
GitHub: Strikingwolf
IRC: Strikingwolf
In-game: Strikingwolf

Re: Post your modding questions here

by Strikingwolf » Sat Sep 27, 2014 17:19

I was wondering how I could require code in another mod and modulize it. For example I know how you would make regular code modular

functions.lua
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
 
local functions = {}

local function myFunction()
    --does stuff
end
functions.myfunction = myfunction

return functions

init.lua
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
local functions = require("functions")
functions.myfunction()

So how could I do this with a core mod or something of the sort?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Sat Sep 27, 2014 17:53

Try 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
-- module.lua
local m = { }

-- This is local, since it's stored into `m` (which is a local itself).
function m.do_something(foo, bar)
  return foo + bar
end

return m

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
-- init.lua
package.path = package.path .. ";" .. minetest.get_modpath("yourmodname").."/?.lua"

local mymodule = require("module")
local x = mymodule.do_something(1, 2)
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

Strikingwolf
New member
 
Posts: 3
Joined: Wed Sep 17, 2014 00:29
GitHub: Strikingwolf
IRC: Strikingwolf
In-game: Strikingwolf

Re: Post your modding questions here

by Strikingwolf » Sat Sep 27, 2014 17:58

kaeza wrote:Try 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
-- module.lua
local m = { }

-- This is local, since it's stored into `m` (which is a local itself).
function m.do_something(foo, bar)
  return foo + bar
end

return m

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
-- init.lua
package.path = package.path .. ";" .. minetest.get_modpath("yourmodname").."/?.lua"

local mymodule = require("module")
local x = mymodule.do_something(1, 2)

But that doesn't make the core mod kinda thing work right?
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sun Sep 28, 2014 09:09

Strikingwolf wrote:I was wondering how I could require code in another mod and modulize it. For example I know how you would make regular code modular
...
So how could I do this with a core mod or something of the sort?

The Minetest developers didn't go the full mile in terms of fully embracing Lua as a platform rather than just a language. You'll find that packages and requires aren't really setup to work right, and there are no mod paths or loaders setup for you or anything. Instead, Minetest uses static mod dependencies to order the loading of mods, and mods are expected to store all non-local functions and variables in global namespace tables based on their own names. The convention looks 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
-- This mod is named "parent"
parent = {}
parent.foo = function() ... end


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
-- This mod is named "child" and depends on "parent".
-- There is a line naming "parent" (without quotes) in this mod's depends.txt file.

-- Call parent's function:
parent.foo()


In order to keep code in another Lua file within the same mod (note that in this case you CAN return values like in your example), you can do something more 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
local MOD_NAME = minetest.get_current_modname()
local MOD_PATH = minetest.get_modpath(MOD_NAME)

local myModule = dofile(MOD_PATH .. "/myModule.lua")


While you COULD do the same thing with another mod's Lua files, there's no mechanism like 'require' that ensures the code is loaded only once, so you'll get duplicates (with multiple copies of state and/or overwritten globals) if you try it. Not a good idea. I was working on sort of a framework for "mod libraries" when I first started messing with Minetest, but I lost steam and put it on indefinite hold to work on other things. I was probably over-designing version logic in any case.
 

MaxPower
Member
 
Posts: 30
Joined: Wed Sep 24, 2014 17:25

Re: Post your modding questions here

by MaxPower » Sun Sep 28, 2014 11:05

What is the difference between
minetest.get_craft_recipe
and
minetest.get_all_craft_recipes
?

Does minetest.get_craft_recipe give the first recipe only?

/EDIT
I answered my own question and updated the wiki accordingly
 

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

Re: Post your modding questions here

by GunshipPenguin » Tue Sep 30, 2014 02:04

Hello everybody,

I'm working on a mod that requires a node very similar to bedrock in minecraft called "arenablock". Basically, it will be a node that only people with the "arenabuilder" privilege can place or destroy, otherwise it should be indestructible. So far, this is what I have.

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("battles:arenablock", {
   description = "Arenablock",
   tiles = {"arenablock.png"},
   groups = {cracky=1, oddly_breakable_by_hand=1},
   can_dig = function(pos, player)
      local can_access = minetest.check_player_privs(player:get_player_name(), {arenabuilder=true})
      return can_access
   end,
   after_place_node = function(pos, placer, itemstack, pointed_thing)
      local can_access = minetest.check_player_privs(placer:get_player_name(), {arenabuilder=true})
      if can_access == true then
         return
      else
         minetest.set_node(pos, {name="air"})
      end
   end,
})


And it works fine, the problem arises when you use my arenablock node with the TNT mod that is included in minetest_game as the TNT destroys the arenablock when it explodes. Looking at the code for the TNT mod, I see that it uses minetest.remove_node when it explodes to remove the nodes around it and simulate an explosion. My question is this: Is it possible to make arenablock not be destroyed by TNT explosions? I know that I could modify the TNT code so it doesn't destroy the arenablock, but I would prefer modifying my mod's code to make the arenablock immune to TNT explosions.

Thanks in advance for any help :)
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Post your modding questions here

by Sokomine » Tue Sep 30, 2014 02:23

GunshipPenguin wrote:I know that I could modify the TNT code so it doesn't destroy the arenablock, but I would prefer modifying my mod's code to make the arenablock immune to TNT explosions.

Take a look at how default:cloud is defined. It ought to be sufficient to give your block none of the groups that are relevant for digging. You might also want to ask about that in the TNT mod thread. It ought to remove no blocks that can't be digged. Of course you can't easily dig such blocks, priv nonwithstanding. A special tool might help you there. If you handle the digging about can_dig, players will be able to dig the block and slip through before the server sends the information that it can't be digged.
A list of my mods can be found here.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Post your modding questions here

by 4aiman » Tue Sep 30, 2014 07:50

GunshipPenguin, THANK YOU VERY MUCH!!! Honestly. You've just gave me an awesome idea! :)

Regards!
 

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

Re: Post your modding questions here

by GunshipPenguin » Tue Sep 30, 2014 18:27

Sokomine wrote:
GunshipPenguin wrote:I know that I could modify the TNT code so it doesn't destroy the arenablock, but I would prefer modifying my mod's code to make the arenablock immune to TNT explosions.

Take a look at how default:cloud is defined. It ought to be sufficient to give your block none of the groups that are relevant for digging. You might also want to ask about that in the TNT mod thread. It ought to remove no blocks that can't be digged. Of course you can't easily dig such blocks, priv nonwithstanding. A special tool might help you there. If you handle the digging about can_dig, players will be able to dig the block and slip through before the server sends the information that it can't be digged.


Hello, Thanks for the reply.

default:cloud is only in one group - not_in_creative_inventory and it still gets destroyed by TNT. Looking at this closely, I'm not sure if it's really possible to make a node that's immune to TNT explosions without editing the TNT code. Because of this, I'm going to try something completely different and ditch the arenablock idea. Thanks for your help and suggestions though!

4aiman wrote:GunshipPenguin, THANK YOU VERY MUCH!!! Honestly. You've just gave me an awesome idea! :)

Regards!


Awesome!
 

MaxPower
Member
 
Posts: 30
Joined: Wed Sep 24, 2014 17:25

Re: Post your modding questions here

by MaxPower » Wed Oct 01, 2014 13:54

GunshipPenguin wrote:Hello everybody,

And it works fine, the problem arises when you use my arenablock node with the TNT mod that is included in minetest_game as the TNT destroys the arenablock when it explodes. Looking at the code for the TNT mod, I see that it uses minetest.remove_node when it explodes to remove the nodes around it and simulate an explosion. My question is this: Is it possible to make arenablock not be destroyed by TNT explosions? I know that I could modify the TNT code so it doesn't destroy the arenablock, but I would prefer modifying my mod's code to make the arenablock immune to TNT explosions.


This http://dev.minetest.net/minetest.register_node#on_blast may or may not help you
 

MaxPower
Member
 
Posts: 30
Joined: Wed Sep 24, 2014 17:25

Re: Post your modding questions here

by MaxPower » Wed Oct 01, 2014 13:55

Is there a way to list all the registered nodes in LUA ?
 

jin_xi
Member
 
Posts: 165
Joined: Mon Jul 02, 2012 18:19

Re: Post your modding questions here

by jin_xi » Wed Oct 01, 2014 14:05

minetest.registered_nodes is a table of all registered nodes
 

MaxPower
Member
 
Posts: 30
Joined: Wed Sep 24, 2014 17:25

Re: Post your modding questions here

by MaxPower » Wed Oct 01, 2014 14:13

jin_xi wrote:minetest.registered_nodes is a table of all registered nodes


Cheers.

For some reason it is not on the dev wiki, will try this later and eventually add it to it.
 

benedict424
Member
 
Posts: 28
Joined: Thu Oct 02, 2014 06:24
IRC: ozwald
In-game: arimeikata

Ore Spawning

by benedict424 » Fri Oct 03, 2014 20:19

Question: How do I make an ore that spawns in the world?
Reason: I'm working on a mod that makes veriaty in pre-existing ores.
Who said that there are only four elements? I have Terra, Aqua, Ignus, Air, Ather, and Incognitus.
 

User avatar
lag01
Member
 
Posts: 190
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Ore Spawning

by lag01 » Fri Oct 03, 2014 20:55

benedict424 wrote:Question: How do I make an ore that spawns in the world?
Reason: I'm working on a mod that makes veriaty in pre-existing ores.


I myself don't know how to do this, but maybe you can check how they do it in moreores mod
 

benedict424
Member
 
Posts: 28
Joined: Thu Oct 02, 2014 06:24
IRC: ozwald
In-game: arimeikata

Re: Ore Spawning

by benedict424 » Fri Oct 03, 2014 21:48

lag01 wrote:
benedict424 wrote:Question: How do I make an ore that spawns in the world?
Reason: I'm working on a mod that makes veriaty in pre-existing ores.


I myself don't know how to do this, but maybe you can check how they do it in moreores mod


I think that it might be simpler to find the code in the game, but I also want to add support to moreores. It might be nessesary.
Who said that there are only four elements? I have Terra, Aqua, Ignus, Air, Ather, and Incognitus.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Post your modding questions here

by philipbenr » Sat Oct 04, 2014 02:19

Look at magpen.lua in default. It uses minetest.register_ore function. That one works really well.
 

benedict424
Member
 
Posts: 28
Joined: Thu Oct 02, 2014 06:24
IRC: ozwald
In-game: arimeikata

2 drops

by benedict424 » Sat Oct 04, 2014 07:26

How do I get a node, or and ore, to drop multiple things?
Who said that there are only four elements? I have Terra, Aqua, Ignus, Air, Ather, and Incognitus.
 

benedict424
Member
 
Posts: 28
Joined: Thu Oct 02, 2014 06:24
IRC: ozwald
In-game: arimeikata

Re: Post your modding questions here

by benedict424 » Sat Oct 04, 2014 07:27

philipbenr wrote:Look at magpen.lua in default. It uses minetest.register_ore function. That one works really well.


I've just seen that. Thanks.
Who said that there are only four elements? I have Terra, Aqua, Ignus, Air, Ather, and Incognitus.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Ore Spawning

by Hybrid Dog » Sat Oct 04, 2014 08:31

benedict424 wrote:Question: How do I make an ore that spawns in the world?

There's a page about generating ores in minetest.
http://dev.minetest.net/minetest.register_ore
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: 2 drops

by Hybrid Dog » Sat Oct 04, 2014 08:33

benedict424 wrote:How do I get a node, or and ore, to drop multiple things?

https://github.com/minetest/minetest_ga ... s.lua#L328
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

light-emitting entities

by RHR » Sat Oct 04, 2014 09:26

Is there any way to create light-emitting entities?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: light-emitting entities

by Krock » Sat Oct 04, 2014 09:35

RHR wrote:Is there any way to create light-emitting entities?

Nope.
*looks with big eyes on this idea* (idea with attached entities to make torches emitting light while holding in the hand)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

cron