Post your mapgen questions here (modding or engine)

Winter94
Member
 
Posts: 36
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

Re: Post your mapgen questions here (modding or engine)

by Winter94 » Sat Jan 11, 2020 17:30

So, I apologize in advance for my extreme level of ignorance, but I'm new to lua, and I taught myself a bit of C++ when modding Dwarf Fortress. I was working on a cool idea for a mod that adds realistic ores to the game, and I've fixed many errors, but I'm stuck. I have no idea what the error is telling me, really, and if someone could take a look at this and impart their wisdom, I would be greatly appreciative.
Link to my code:https://docs.google.com/document/d/1JcwB8mt_0APsDB3gdlgLon8N-ku6K2TCQOaD0cOR_Ww/edit?usp=sharing

Here's the error:

2020-01-11 11:08:00: ERROR[Main]: ModError: Failed to load and run script from C:\Users\XA-26483\Desktop\MINETEST\minetest-5.1.0-win64\bin\..\mods\realores\init.lua:
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:182: bad argument #7 to 'register_item_raw' (number expected, got string)
2020-01-11 11:08:00: ERROR[Main]: stack traceback:
2020-01-11 11:08:00: ERROR[Main]: [C]: in function 'register_item_raw'
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:182: in function 'register_item'
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:208: in function 'register_node'
2020-01-11 11:08:00: ERROR[Main]: ...ETEST\minetest-5.1.0-win64\bin\..\mods\realores\init.lua:1: in main chunk
2020-01-11 11:08:00: ERROR[Main]: Check debug.txt for details.
2020-01-11 11:08:00: ACTION[Main]: Server: Shutting down
2020-01-11 11:08:32: ERROR[Main]: Please choose a name!
 

Skamiz Kazzarch
Member
 
Posts: 117
Joined: Fri Mar 09, 2018 20:34
Location: la lojbaugag.
GitHub: Skamiz
In-game: Skamiz

Re: Post your mapgen questions here (modding or engine)

by Skamiz Kazzarch » Sat Jan 11, 2020 18:03

What is causing your issue is this:
Code: Select all
    groups = {"cracky=3, stone=1"},

It should be without the ""
Code: Select all
    groups = {cracky=3, stone=1},


After you fix that for all your nodes the next error you will see is complaining about this:
Code: Select all
minetest.register_craftitem("chunk_bismuthinite",
etc...

because of the missing modname preffix. Correctly should be like so:
Code: Select all
minetest.register_craftitem("realores:chunk_bismuthinite",
etc...


and lastly as a mater of style,
Code: Select all
minetest.register_node("realores:Magnetite", {

this looks odd since it is the first time ever I have seen uppercase in a node id. Just to be clear, this string is usualy never seen by the player, instead when they hover over the item they see the string assigned to 'description'.
 

MitchellMarquez42
New member
 
Posts: 2
Joined: Mon Jan 13, 2020 00:10

Re: Post your mapgen questions here (modding or engine)

by MitchellMarquez42 » Mon Jan 13, 2020 00:14

Hey,
Is there a way to make Biome dependent on the blocks generated/placed in a specific area, rather than the other way around? I'm new to coding but looking to make a 3d Terraria clone within Minetest.
 

User avatar
paramat
Developer
 
Posts: 3528
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Wed Jan 15, 2020 01:40

MitchellMarquez42,

That is not possible using only the Biome API, however ...

You can generate core mapgen worlds with no biomes by setting 'nobiomes' in the mapgen flag setting called 'mg_flags' (This is either a MT 5.0.1 or 5.1.0 feature, not sure which). Then the core mapgen will create a world of stone and water only.
Then you can write a mod that adds biomes to that stone world in any way you want, with biomes dependent on terrain.
 

MitchellMarquez42
New member
 
Posts: 2
Joined: Mon Jan 13, 2020 00:10

Re: Post your mapgen questions here (modding or engine)

by MitchellMarquez42 » Mon Jan 20, 2020 07:01

paramat wrote:MitchellMarquez42,

That is not possible using only the Biome API, however ...

You can generate core mapgen worlds with no biomes by setting 'nobiomes' in the mapgen flag setting called 'mg_flags' (This is either a MT 5.0.1 or 5.1.0 feature, not sure which). Then the core mapgen will create a world of stone and water only.
Then you can write a mod that adds biomes to that stone world in any way you want, with biomes dependent on terrain.

Thanks. Gotta try that...
 

Winter94
Member
 
Posts: 36
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

Re: Post your mapgen questions here (modding or engine)

by Winter94 » Fri Jan 24, 2020 21:02

Not sure if this is the right place to put this or not but it involves ores generating in the world, so... I'm using a custom version of the stone layers from underchallenge, and I'm trying to set up a table for ores/minerals. What have I done wrong with my table?
Code: Select all
underforge.minerals = {}

local mineral_table = { --name, desc, strata, rarity
   {"corundum",      "Corundum",         "gneiss",         10*10*10,},
   {"corundum",      "Corundum",         "mica",            10*10*10,},
   {"corundum",      "Corundum",         "schist",         10*10*10,},
   {"corundum",      "Corundum",         "pegmatite",      10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "diorite",         10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "pegmatite",      10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "phyllite",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "andesite",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "basalt",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "gabbro",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "andesite",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "dolomite",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "gneiss",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "diorite",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "granite",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "pegmatite",      10*10*10,},
   }

for i in ipairs (mineral_table) do
    local name      = mineral_table[i][1]
    local desc      = mineral_table[i][2]
    local strata   = mineral_table[i][3]
    local rarity   = mineral_table[i][4]

minetest.register_node("underforge:"..name){
   description   = desc,
   tiles      = '"strata..".png"^"ore_"..name..".png"',
   groups      = {cracky = 3, minerals = 1},
   drop      = "underforge:"..name.."_chunk",
   sounds      = default.node_sound_stone_defaults(),
   }

minetest.register_ore("underforge:"..name){
   ore_type      = "scatter",
   ore            = "underforge:"..name.."_in_"..strata,
   wherein         = "underforge:"..strata,
   clust_scarcity   = {rarity},
   clust_size      = 5,
   clust_num_ores   = 10,
   }

minetest.register_craftitem("underforge:"..name){
      description = S("Chunk of" ..desc ),
      groups = {rocks = 1, minerals = 2},
      inventory_image = "chunk_"..name..".png",
   }
end
 

User avatar
paramat
Developer
 
Posts: 3528
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Sat Jan 25, 2020 23:39

That is a general coding error, so offtopic here. You already have another thread for this, which also posts the error itself, so discussion should happen there.
 

Winter94
Member
 
Posts: 36
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

Re: Post your mapgen questions here (modding or engine)

by Winter94 » Sun Jan 26, 2020 13:58

My bad, I'll start keeping it confined to the 'Noob here, needing help...' thread that I made for this problem.
 

Previous

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest