ScythianBeastie
Chieftain
Merry Christmas to those who celebrate! 
I'm currently working on my first ever real mod (I'll provide details if anyone's interested.
)
I need to add a Feature to all Desert terrain tiles that don't already have Flood Plains or Oases.
I'm using ModBuddy to build my mod. I've already copied FeatureGenerator.lua and added it to my mod in Solution Explorer, and I set it to import into VFS. I've tested it, and Civ is building maps with my version of the LUA script.
However, my Feature never appears in even a single tile of my map -- and the oceans fill with ice, which is even stranger.
Something very odd is going on, and I'm not sure what.
This "spoiler" contains the code I'm using to set up the Feature:
<GameData>
<Features>
<Row>
<Type>FEATURE_SAGEBRUSH</Type>
<Description>TXT_KEY_FEATURE_SAGEBRUSH</Description>
<Civilopedia>TXT_KEY_CIV5_FEATURES_SAGEBRUSH_TEXT</Civilopedia>
<ArtDefineTag>ART_DEF_TERRAIN_DESERT</ArtDefineTag>
<Movement>1</Movement>
<InfluenceCost>2</InfluenceCost>
<AppearanceProbability>10000</AppearanceProbability>
<PortraitIndex>1</PortraitIndex>
<IconAtlas>TERRAIN_ATLAS</IconAtlas>
</Row>
</Features>
<Feature_TerrainBooleans>
<Row>
<FeatureType>FEATURE_SAGEBRUSH</FeatureType>
<TerrainType>TERRAIN_DESERT</TerrainType>
</Row>
</Feature_TerrainBooleans>
</GameData>
And this "spoiler" contains my text strings (just in case they're relevant somehow):
<Language_en_US>
<!-- Terrains and Features-->
<Row Tag="TXT_KEY_FEATURE_SAGEBRUSH">
<Text>Sagebrush</Text>
</Row>
<Row Tag="TXT_KEY_CIV5_FEATURES_SAGEBRUSH_TEXT">
<Text>Sagebrush is a near-ubiquitous component of eastern Oregon's deserts.</Text>
</Row>
</Language_en_US>
And this "spoiler" contains the changes I've made to FeatureGenerator.lua (changes should appear in red):
------------------------------------------------------------------------------
function FeatureGenerator:__initFeatureTypes()
self.featureSagebrush = FeatureTypes.FEATURE_SAGEBRUSH;
self.featureFloodPlains = FeatureTypes.FEATURE_FLOOD_PLAINS;
self.featureIce = FeatureTypes.FEATURE_ICE;
self.featureJungle = FeatureTypes.FEATURE_JUNGLE;
self.featureForest = FeatureTypes.FEATURE_FOREST;
self.featureOasis = FeatureTypes.FEATURE_OASIS;
self.featureMarsh = FeatureTypes.FEATURE_MARSH;
self.terrainIce = TerrainTypes.TERRAIN_SNOW;
self.terrainTundra = TerrainTypes.TERRAIN_TUNDRA;
self.terrainPlains = TerrainTypes.TERRAIN_PLAINS;
end
------------------------------------------------------------------------------
(... and then skip down to ... )
------------------------------------------------------------------------------
function FeatureGenerator:AddFeaturesAtPlot(iX, iY)
-- adds any appropriate features at the plot (iX, iY) where (0,0) is in the SW
local lat = self:GetLatitudeAtPlot(iX, iY);
local plot = Map.GetPlot(iX, iY);
if plot:CanHaveFeature(self.featureFloodPlains) then
-- All desert plots along river are set to flood plains.
plot:SetFeatureType(self.featureFloodPlains, -1)
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
if plot:CanHaveFeature(self.featureSagebrush) then
plot:SetFeatureType(self.featureSagebrush, -1)
end
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddOasisAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddIceAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddMarshAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddJunglesAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddForestsAtPlot(plot, iX, iY, lat);
end
end
------------------------------------------------------------------------------
I've fiddled with this for several hours now (experimenting with the order of UpdateDatabase entries, etc., etc.), but have had no luck.
Thank you for any assistance you can provide!

I'm currently working on my first ever real mod (I'll provide details if anyone's interested.

I need to add a Feature to all Desert terrain tiles that don't already have Flood Plains or Oases.
I'm using ModBuddy to build my mod. I've already copied FeatureGenerator.lua and added it to my mod in Solution Explorer, and I set it to import into VFS. I've tested it, and Civ is building maps with my version of the LUA script.
However, my Feature never appears in even a single tile of my map -- and the oceans fill with ice, which is even stranger.

This "spoiler" contains the code I'm using to set up the Feature:
Spoiler :
<GameData>
<Features>
<Row>
<Type>FEATURE_SAGEBRUSH</Type>
<Description>TXT_KEY_FEATURE_SAGEBRUSH</Description>
<Civilopedia>TXT_KEY_CIV5_FEATURES_SAGEBRUSH_TEXT</Civilopedia>
<ArtDefineTag>ART_DEF_TERRAIN_DESERT</ArtDefineTag>
<Movement>1</Movement>
<InfluenceCost>2</InfluenceCost>
<AppearanceProbability>10000</AppearanceProbability>
<PortraitIndex>1</PortraitIndex>
<IconAtlas>TERRAIN_ATLAS</IconAtlas>
</Row>
</Features>
<Feature_TerrainBooleans>
<Row>
<FeatureType>FEATURE_SAGEBRUSH</FeatureType>
<TerrainType>TERRAIN_DESERT</TerrainType>
</Row>
</Feature_TerrainBooleans>
</GameData>
And this "spoiler" contains my text strings (just in case they're relevant somehow):
Spoiler :
<Language_en_US>
<!-- Terrains and Features-->
<Row Tag="TXT_KEY_FEATURE_SAGEBRUSH">
<Text>Sagebrush</Text>
</Row>
<Row Tag="TXT_KEY_CIV5_FEATURES_SAGEBRUSH_TEXT">
<Text>Sagebrush is a near-ubiquitous component of eastern Oregon's deserts.</Text>
</Row>
</Language_en_US>
And this "spoiler" contains the changes I've made to FeatureGenerator.lua (changes should appear in red):
Spoiler :
------------------------------------------------------------------------------
function FeatureGenerator:__initFeatureTypes()
self.featureSagebrush = FeatureTypes.FEATURE_SAGEBRUSH;
self.featureFloodPlains = FeatureTypes.FEATURE_FLOOD_PLAINS;
self.featureIce = FeatureTypes.FEATURE_ICE;
self.featureJungle = FeatureTypes.FEATURE_JUNGLE;
self.featureForest = FeatureTypes.FEATURE_FOREST;
self.featureOasis = FeatureTypes.FEATURE_OASIS;
self.featureMarsh = FeatureTypes.FEATURE_MARSH;
self.terrainIce = TerrainTypes.TERRAIN_SNOW;
self.terrainTundra = TerrainTypes.TERRAIN_TUNDRA;
self.terrainPlains = TerrainTypes.TERRAIN_PLAINS;
end
------------------------------------------------------------------------------
(... and then skip down to ... )
------------------------------------------------------------------------------
function FeatureGenerator:AddFeaturesAtPlot(iX, iY)
-- adds any appropriate features at the plot (iX, iY) where (0,0) is in the SW
local lat = self:GetLatitudeAtPlot(iX, iY);
local plot = Map.GetPlot(iX, iY);
if plot:CanHaveFeature(self.featureFloodPlains) then
-- All desert plots along river are set to flood plains.
plot:SetFeatureType(self.featureFloodPlains, -1)
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
if plot:CanHaveFeature(self.featureSagebrush) then
plot:SetFeatureType(self.featureSagebrush, -1)
end
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddOasisAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddIceAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddMarshAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddJunglesAtPlot(plot, iX, iY, lat);
end
if (plot:GetFeatureType() == FeatureTypes.NO_FEATURE) then
self:AddForestsAtPlot(plot, iX, iY, lat);
end
end
------------------------------------------------------------------------------
I've fiddled with this for several hours now (experimenting with the order of UpdateDatabase entries, etc., etc.), but have had no luck.

Thank you for any assistance you can provide!
