(solved)I cannot get my worldbuilder map to generate random resources (solved)

Craig_Sutter

Deity
Joined
Aug 13, 2002
Messages
2,773
Location
Calgary, Canada
I have been trying to recreate my mod of the Viking Age from civ 5 into 6. I have built a map based on that mod and set up the mod files. Everything appears to be working; however, the random resources are not being generated.

Here is the modinfo file:


Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="e9eee045-467d-47de-979b-becdb46d8fe7" version="1">
  <Properties>
    <Name>The Viking Age</Name>
    <Description>A scenario set during the Viking Age in Europe from the dark ages to the early medieval period.</Description>
    <Created>1744859577</Created>
    <Teaser>The wars of the Viking Age</Teaser>
    <Authors>Craig Sutter</Authors>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <Dependencies>
    <Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
    <Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="Expansion: Rise and Fall" />
    <Mod id="2F6E858A-28EF-46B3-BEAC-B985E52E9BC1" title="DLC: Vikings Content" />
  </Dependencies>
  <FrontEndActions>
    <UpdateDatabase id="Map_Configuration">
      <File>Configuration/Map_Configuration.sql</File>
    </UpdateDatabase>
    <UpdateText id="Map_Text">
      <File>Text/Map_Text.sql</File>
    </UpdateText>
  </FrontEndActions>
  <InGameActions>
    <UpdateDatabase id="Continents">
      <File priority="3">Configuration/Continents.sql</File>
    </UpdateDatabase>
    <UpdateText id="Continents_Names">
      <File priority="3">Text/Continents_Names.sql</File>
    </UpdateText>
    <UpdateText id="Map_Text">
      <File>Text/Map_Text.sql</File>
    </UpdateText>
    <AddGameplayScripts id="LoadMapScript">
      <File>Maps/The Viking Age.lua</File>
    </AddGameplayScripts>
  </InGameActions>
  <Files>
    <File>Configuration/Continents.sql</File>
    <File>Configuration/Map_Configuration.sql</File>
    <File>Maps/The Viking Age.Civ6Map</File>
    <File>Maps/The Viking Age.lua</File>
    <File>Text/Continents_Names.sql</File>
    <File>Text/Map_Text.sql</File>
  </Files>
</Mod>

The relevant file, I believe, is The Viking Age.lua... it is as follows:


Code:
include "MapUtilities"
include "ResourceGenerator"
-- ===========================================================================
function InitializeNewGame()

local resourcesConfig = MapConfiguration.GetValue("resources");
local startConfig = MapConfiguration.GetValue("start");-- Get the start config
local args = {
resources = resourcesConfig,
START_CONFIG = startConfig,?
};
local resGen = ResourceGenerator.Create(args);

local gridWidth, gridHeight = Map.GetGridSize();
AddGoodies(gridWidth, gridHeight);
AddLeyLines();?
end

LuaEvents.NewGameInitialized.Add(InitializeNewGame);

It seems to work as far as goody huts go and likely leylines as well (although a generated game does not show me those). I can see the huts though in firetuner.

Some other facts:
- the size is atypical being 80x135. In the map file itself, this is stated, as well as its being SIZE_HUGE.
- I have tried to associate the Worldbuilder map with Viking Map.lua in the map file, but it keeps reverting to Continents.lua. Nevertheless, in the Worldbuilder Map database, the Viking Map.lua does seem to be the one shown in Map attributes, so I have no idea why it reverts to Continents.lua.
-everything is working as expected otherwise... I have introduced some new continents and they show up. When I start a created game, selecting the viking map... it shows up as huge and starts as normal with goody huts generated and minor and major civilizations as expected. The only problem is no resources.
Since there are goodies, the Viking Map.lau seems to be working and I have seen no errors.

I have downloaded a fair number of maps as examples from this site and steam workshop; however, I cannot seem to find a mod that has both a worldbuilder map and generated resources.

If anyone can point me the way, it would be appreciated. The Mod is attached.

Thanks.
 

Attachments

Back
Top Bottom