From 2b8f808605538c3241b3968e1a49989867de8165 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 1 Dec 2020 21:54:10 -0700 Subject: [PATCH] since I don't know when contentdb will accept the changed name for namegen, adding support for both names temporarily --- df_caverns/mod.conf | 2 +- df_caverns/underworld.lua | 18 +++++++++++++----- guide.md | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/df_caverns/mod.conf b/df_caverns/mod.conf index 6ff8691..2e93b73 100644 --- a/df_caverns/mod.conf +++ b/df_caverns/mod.conf @@ -1,4 +1,4 @@ name = df_caverns description = Adds vast underground caverns in the style of Dwarf Fortress, complete with underground flora in diverse biomes. Also adds stalactite/stalagmite decorations in the smaller tunnels. depends = default, subterrane, df_trees, df_mapitems -optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, name_generator, fireflies \ No newline at end of file +optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, name_generator, namegen, fireflies \ No newline at end of file diff --git a/df_caverns/underworld.lua b/df_caverns/underworld.lua index 57009c1..2d8a637 100644 --- a/df_caverns/underworld.lua +++ b/df_caverns/underworld.lua @@ -9,6 +9,14 @@ local bones_loot_path = minetest.get_modpath("bones_loot") local named_waypoints_path = minetest.get_modpath("named_waypoints") local name_generator_path = minetest.get_modpath("name_generator") +-- TEMP backwards compatibility for the change of name of the name_generator mod. Once it's updated in the contentDB, remove this and also the optional_depends +local namegenerator = nil +if not name_generator_path and minetest.get_modpath("namegen") and namegen and namegen.parse_lines and namegen.generate then + namegenerator = namegen +elseif name_generator_path then + namegenerator = name_generator +end + local hunters_enabled = minetest.get_modpath("hunter_statue") and df_underworld_items.config.underworld_hunter_statues local name_pit = function() end @@ -51,14 +59,14 @@ if named_waypoints_path then end named_waypoints.register_named_waypoints("puzzle_seals", seal_waypoint_def) - if name_generator_path then - name_generator.parse_lines(io.lines(modpath.."/underworld_names.cfg")) + if namegenerator then + namegenerator.parse_lines(io.lines(modpath.."/underworld_names.cfg")) name_pit = function() - return name_generator.generate("glowing_pits") + return namegenerator.generate("glowing_pits") end name_ruin = function() - return name_generator.generate("underworld_ruins") + return namegenerator.generate("underworld_ruins") end local underworld_ruin_def = { @@ -467,7 +475,7 @@ minetest.register_on_generated(function(minp, maxp, seed) mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_building_schematic, building.rotation) elseif building.building_type == "medium building" then mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, medium_building_schematic, building.rotation) - if named_waypoints_path and name_generator_path then + if named_waypoints_path and namegenerator then if not next(named_waypoints.get_waypoints_in_area("underworld_ruins", vector.subtract(building.pos, 250), vector.add(building.pos, 250))) then named_waypoints.add_waypoint("underworld_ruins", {x=building.pos.x, y=floor_height+1, z=building.pos.z}, {name=name_ruin()}) end diff --git a/guide.md b/guide.md index 16affc0..6eda6dc 100644 --- a/guide.md +++ b/guide.md @@ -200,11 +200,11 @@ The Magma Sea is not without its treasures, however. In the most infernal region ![There are older and fouler things than orcs in the deep places of the world](./df_caverns/screenshots/underworld.jpg) -The foundations of the world lie at -3100 meters, under a default configuration. The diggable rock of the world ends at a rippling layer of invulnerable Slade, a material of unparalleled density. There is a cavern layer at the seam between rock and Slade, however, as if the earth itself was reluctant to touch the strange matter below. The crevices of the ceiling have strange glowing rocks in them, producing a surprisingly bright ambience. Don't attempt to disturb those rocks. +The foundations of the world lie at -3100 meters, under a default configuration. The diggable rock of the world ends at a rippling layer of invulnerable Slade, a material of unparalleled density. There is a cavern layer at the seam between rock and Slade, however, as if the earth itself was reluctant to touch the strange matter below. The crevices of the ceiling have strange glowing rocks in them, producing a surprisingly bright ambiance. Don't attempt to disturb those rocks. There is no native life in the Underworld. It appears there once _was_, however. Occasional clusters of vacant buildings can be found, impossibly crafted from bricks of Slade and empty of any furnishings. Around those clusters of vacant buildings are fields filled with sealed pits lined with flawless Slade blocks. It is unclear whether these pits are as vacant as the buildings, though. The seals capping them are engraved with ancient words in lost tongues, but one phrase can be translated from the oldest known languages: "This Place is Not a Place of Honor." -Just as ominously, the ancient bones of long-dead warriors are scattered amidst the buildings. They contain loot for those willing to risk disturbing them. There are no traces of who - or what - they died fighting. +Just as ominously, the ancient bones of long-dead warriors are scattered amidst the buildings. They contain loot for those willing to risk disturbing them. There are no traces of who - or what - they died fighting, but their ancient sentinels still lurk nearby to guard them. ![Glowing pit](./df_caverns/screenshots/glowing_pit.jpg)