made first village configurable
parent
fa4ec836cc
commit
a4c6338cab
|
@ -28,6 +28,9 @@ mg_villages.REQUIRE_PRIV_FOR_TELEPORT = false;
|
||||||
-- if set to true, players cannot modify spawned villages without buying the house from the village first
|
-- if set to true, players cannot modify spawned villages without buying the house from the village first
|
||||||
mg_villages.ENABLE_PROTECTION = true;
|
mg_villages.ENABLE_PROTECTION = true;
|
||||||
|
|
||||||
|
-- the first village - the one the player spawns in - will be of this type
|
||||||
|
mg_villages.FIRST_VILLAGE_TYPE = 'medieval';
|
||||||
|
|
||||||
-- background image for the /vmap command
|
-- background image for the /vmap command
|
||||||
-- RealTest comes with a diffrent texture
|
-- RealTest comes with a diffrent texture
|
||||||
if( minetest.get_modpath('grounds') and minetest.get_modpath('joiner_table')) then
|
if( minetest.get_modpath('grounds') and minetest.get_modpath('joiner_table')) then
|
||||||
|
|
|
@ -15,7 +15,7 @@ mg_villages.road_node = minetest.get_content_id( 'mg_villages:road' );
|
||||||
|
|
||||||
minetest.register_node("mg_villages:soil", {
|
minetest.register_node("mg_villages:soil", {
|
||||||
description = "Soil found on a field",
|
description = "Soil found on a field",
|
||||||
tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt_side.png"},
|
tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png"},
|
||||||
drop = "default:dirt",
|
drop = "default:dirt",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=3, not_in_creative_inventory=1, grassland = 1},
|
groups = {crumbly=3, not_in_creative_inventory=1, grassland = 1},
|
||||||
|
|
|
@ -79,16 +79,17 @@ end
|
||||||
-- places a marker that allows players to buy plots with houses on them (in order to modify the buildings)
|
-- places a marker that allows players to buy plots with houses on them (in order to modify the buildings)
|
||||||
local function generate_building_plotmarker( pos, minp, maxp, data, param2_data, a, cid, building_nr_in_bpos, village_id)
|
local function generate_building_plotmarker( pos, minp, maxp, data, param2_data, a, cid, building_nr_in_bpos, village_id)
|
||||||
-- position the plot marker so that players can later buy this plot + building in order to modify it
|
-- position the plot marker so that players can later buy this plot + building in order to modify it
|
||||||
|
-- pos.o contains the original orientation (determined by the road and the side the building is
|
||||||
local p = {x=pos.x, y=pos.y+1, z=pos.z};
|
local p = {x=pos.x, y=pos.y+1, z=pos.z};
|
||||||
if( pos.brotate == 0 ) then
|
if( pos.o == 0 ) then
|
||||||
p.x = p.x - 1;
|
p.x = p.x - 1;
|
||||||
p.z = p.z + pos.bsizez - 1;
|
p.z = p.z + pos.bsizez - 1;
|
||||||
elseif( pos.brotate == 2 ) then
|
elseif( pos.o == 2 ) then
|
||||||
p.x = p.x + pos.bsizex;
|
p.x = p.x + pos.bsizex;
|
||||||
elseif( pos.brotate == 1 ) then
|
elseif( pos.o == 1 ) then
|
||||||
p.z = p.z + pos.bsizez;
|
p.z = p.z + pos.bsizez;
|
||||||
p.x = p.x + pos.bsizex - 1;
|
p.x = p.x + pos.bsizex - 1;
|
||||||
elseif( pos.brotate == 3 ) then
|
elseif( pos.o == 3 ) then
|
||||||
p.z = p.z - 1;
|
p.z = p.z - 1;
|
||||||
end
|
end
|
||||||
-- actually position the marker
|
-- actually position the marker
|
||||||
|
|
|
@ -35,8 +35,8 @@ mg_villages.villages_at_point = function(minp, noise1)
|
||||||
-- fallback: type "nore" (that is what the mod originally came with)
|
-- fallback: type "nore" (that is what the mod originally came with)
|
||||||
local village_type = 'nore';
|
local village_type = 'nore';
|
||||||
-- if this is the first village for this world, take a medieval one
|
-- if this is the first village for this world, take a medieval one
|
||||||
if( (not( mg_villages.all_villages ) or mg_villages.anz_villages < 1) and minetest.get_modpath("cottages") ) then
|
if( (not( mg_villages.all_villages ) or mg_villages.anz_villages < 1) and minetest.get_modpath("cottages") and mg_villages.FIRST_VILLAGE_TYPE) then
|
||||||
village_type = 'medieval';
|
village_type = mg_villages.FIRST_VILLAGE_TYPE;
|
||||||
else
|
else
|
||||||
village_type = mg_villages.village_types[ pr:next(1, #mg_villages.village_types )]; -- select a random type
|
village_type = mg_villages.village_types[ pr:next(1, #mg_villages.village_types )]; -- select a random type
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue