How do I increase the # of natrual wonders on a map?

Zanthis

Chieftain
Joined
Jul 8, 2012
Messages
2
I am trying to increase the number of natural wonders that spawn on the map but my mod isn't working.

Spoiler :

<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 7/7/2012 7:18:12 PM -->
<GameData>
<Worlds>
<Update>
<Set NumNaturalWonders="14"/>
<Where Type="WORLDSIZE_LARGE"/>
</Update>
</Worlds>

</GameData>


I load the mod and start a game (map is large, pangea) but only 6 natural wonders are generated on the map.

This is my first attempt at modding, what am I doing wrong?
 
The XML values aren't used, the actual numbers of natural wonders are defined in AssignStartingPlots.lua, which follows the general design philosophy of this file - "Ignore XML, and do everything in LUA" ;) (It's changing lately, the placement rules of natural wonders were ported to XML, but when it comes to number of natural wonders and resource placement on random maps, the XML values are still igonred.)

See this thread.
 
Thanks! I changed the value in the .LUA and it worked!

Now I just need to figure out how to mod a LUA so I don't have to change the core game file...
 
Now I just need to figure out how to mod a LUA so I don't have to change the core game file...

Add a modified version of the lua file to your mod, and, in this file's properties in ModBuddy, set "Import into VFS" to true.
 
Add a modified version of the lua file to your mod, and, in this file's properties in ModBuddy, set "Import into VFS" to true.

Also, map generation scripts like AssignStartingPlots have one other special case; if you don't want to include a modified version of the full thing as a mod, you can create a custom Map script that overrides any one part of it, and the core game will smoothly replace ASP's version of an affected routine with yours. So in theory, you could create a modified version of the Continents script that always used all the natural wonders, and the resulting map wouldn't be incompatible with other mods that alter AssignStartingPlots.

If you want to see how this is done, look at the Lakes, Great Pains, or Highlands map scripts; those override various parts of AssignStartingPlots, using code like this:
Code:
------------------------------------------------------------------------------
function AssignStartingPlots:PlaceOilInTheSea()
	-- WARNING: This operation will render the Strategic Resource Impact Table useless for
	-- further operations, so should always be called last, even after minor placements.
	local sea_oil_amt = 5;
	local worldsizes = {
		[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = 1,
		[GameInfo.Worlds.WORLDSIZE_TINY.ID] = 1,
		[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = 2,
		[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = 2,
		[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = 3,
		[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = 3
	}
	local iNumToPlace = worldsizes[Map.GetWorldSize()];

	print("Adding Oil resources to the Sea.");
	self:PlaceSpecificNumberOfResources(self.oil_ID, sea_oil_amt, iNumToPlace, 0.2, 1, 4, 7, self.coast_list)
end
------------------------------------------------------------------------------
function AssignStartingPlots:GetMajorStrategicResourceQuantityValues()
	local uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 4, 4, 5, 6, 7, 8;
	return uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt
end
------------------------------------------------------------------------------
function AssignStartingPlots:GetSmallStrategicResourceQuantityValues()
	local uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 1, 2, 2, 2, 3, 3;
	return uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt
end
------------------------------------------------------------------------------

which override three of the subroutines used inside ASP. So do something similar for the part that sets the natural wonders, and you're good to go.
 
Back
Top Bottom