Error regarding mod I created

Post Reply
User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Error regarding mod I created

by Midnight » Post

So recently I edited the code of one of my mods named new_biomes, and it started giving me an obnoxious error

User avatar
Blockhead
Member
Posts: 1548
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

I'm sorry to hear that, but the version of new_biomes on GitHub is only up to date for 22 January. So unless you provide the new version somewhere (like a git branch) and the error message, we can't really do much to help.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Well I haven't provided any information about the error cause and no the current version on github is alright, the actual problem is with my code lemme share

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post


minetest.unregister_biome("grassland_under")

minetest.register_biome({
name = "grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 50,
humidity_point = 35,
})

minetest.register_biome({
name = "underground_grassland",
node_stone = "new_biomes:glowing_dirt",
node_cave_liquid = {"default:river_water_source"},
node_dungeon = "new_biomes:glowing_dirt",
node_dungeon_stair = "new_biomes:gdwg",
y_max= -29000,
y_min = -31000,
vertical_blend = 10,
heat_point = 50,
humidity_point = 35,
})

minetest.register_decoration({
name = "new_biomes:plain_floor",
deco_type = "simple",
place_on = {"new_biomes:glowing_dirt"},
sidelen = 16,
fill_ratio = 10,
biomes = {"underground_grassland", "underground_deciduous_forest"},
y_max = -29000,
y_min = -30910,
decoration = "new_biomes:gdwg",
place_offset = -1,
flags = "all_floors,force_placement",
})

minetest.unregister_biome("taiga_under")

minetest.register_biome({
name = "taiga_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 25,
humidity_point = 70,
})

minetest.register_biome({
name = "underground_taiga",
node_stone = "new_biomes:glowing_dirt",
node_cave_liquid = {"default:river_water_source"},
node_dungeon_stair = "new_biomes:gdws",
node_dungeon = "new_biomes:glowing_dirt",
y_max = -29000,
y_min = -31000,
heat_point = 25,
humidity_point = 70,
})

minetest.unregister_biome("snowy_grassland_under")

minetest.register_biome({
name = "snowy_grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 20,
humidity_point = 35,
})

minetest.register_biome({
name = "underground_snowy_grassland",
node_stone = "new_biomes:glowing_dirt",
node_dungeon = "new_biomes:glowing_dirt",
node_dungeon_stair = "new_biomes:gdws",
node_cave_liquid = {"default:river_water_source"},
y_max= -29000,
y_min = -31000,
vertical_blend = 10,
heat_point = 20,
humidity_point = 35,
})

minetest.register_decoration({
name = "new_biomes:cold_floor",
deco_type = "simple",
place_on = {"new_biomes:glowing_dirt"},
sidelen = 16,
fill_ratio = 10,
biomes = {"underground_snowy_grassland", "underground_taiga"},
y_max = -29000,
y_min = -30910,
decoration = "new_biomes:gdws",
place_offset = -1,
flags = "all_floors,force_placement",
})



Now for some reason the underground_snowy_grassland does generate but the dirt cover over it is new_biomes:gdwg so this is causing some no plantation and ore deposits which were supposed to generate in there

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

screenshot_20240206_150418.png
screenshot_20240206_150418.png (472.68 KiB) Viewed 428 times

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Midnight wrote:
Tue Feb 06, 2024 09:57
screenshot_20240206_150418.png
Ignore the lighting part well cuz its the engine bug

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Hello anybody here, I unfortunately want some advice on how to fix this problem, not a good coder need help?

Josselin2
Member
Posts: 101
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

Presumably this is your problem:

Code: Select all

fill_ratio = 10,
flags = "all_floors,force_placement",
These lines guarantee that a single decoration is placed on all possible surfaces, so there is nowhere to place other decorations like plants and ores.

You didn't post all of your code to github, as Blockhead suggested, so that is all the help you are going to get.

If this were my mod, I would start by adding these lines at the top of mapgen.lua:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
Then I would comment out every biome and decoration. Then I would uncomment each biome and decoration, one at a time, until the code stops behaving as expected.

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Josselin2 wrote:
Sun Feb 11, 2024 09:06
Presumably this is your problem:

Code: Select all

fill_ratio = 10,
flags = "all_floors,force_placement",
These lines guarantee that a single decoration is placed on all possible surfaces, so there is nowhere to place other decorations like plants and ores.

You didn't post all of your code to github, as Blockhead suggested, so that is all the help you are going to get.

If this were my mod, I would start by adding these lines at the top of mapgen.lua:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
Then I would comment out every biome and decoration. Then I would uncomment each biome and decoration, one at a time, until the code stops behaving as expected.
The thing is that only this particular biome is causing errors, but not any other biome all is working normal except for these lines. Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Also, these particular lines are the cause of errors, nothing other than them

Josselin2
Member
Posts: 101
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

Midnight wrote:
Sun Feb 11, 2024 10:28
Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming
Add those lines temporarily. Comment out other biomes/decorations temporarily. When you have fixed the problem, you can restore the old code.

Josselin2
Member
Posts: 101
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

You need to upload your code. No-one can fix code that they can't see.

Go to your github, click the "main" button in the top left, in the box type "new_biomes_test", and then upload the broken code to that branch. You can delete the broken branch when you don't need it any more.

User avatar
Midnight
Member
Posts: 151
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Josselin2 wrote:
Mon Feb 12, 2024 08:47
Midnight wrote:
Sun Feb 11, 2024 10:28
Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming
Add those lines temporarily. Comment out other biomes/decorations temporarily. When you have fixed the problem, you can restore the old code.
I think then I'll just copy the mapgen.lua file in my mod

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests