Minimal map script requirements?

frutiemax

Warlord
Joined
Jan 19, 2015
Messages
118
Hello, I'm trying to do a custom map script. For now, I'd like to put ocean tiles and put the starting positions of major civs on the map, but it seems to be missing something... What is this Mods: Failed to create mods browser search context?

Here is my script:

Code:
include "MapEnums"
include "MapUtilities"
include "MountainsCliffs"
include "RiversLakes"
include "FeatureGenerator"
include "TerrainGenerator"
include "NaturalWonderGenerator"
include "ResourceGenerator"
include "CoastalLowlands"
include "AssignStartingPlots"

local g_iW, g_iH;
local g_iFlags = {};
local g_continentsFrac = nil;
local featureGen = nil;
local world_age_new = 5;
local world_age_normal = 3;
local world_age_old = 2;
local islands = {};

local iNumMajorCivs = 0;

-------------------------------------------------------------------------------
function GenerateMap()
    print("lol xd");

    
    g_iW, g_iH = Map.GetGridSize();
    g_iFlags = TerrainBuilder.GetFractalFlags();

    --fill map with ocean
    print("Flooding map with ocean - PASS 1");
    for i = 0,(g_iW*g_iH)-1,1 do
        pPlot = Map.GetPlotByIndex(i);

        if(pPlot ~= nil) then
            TerrainBuilder.SetTerrainType(pPlot,g_PLOT_TYPE_OCEAN);
        else
            print("Plot is nil!");
            return;
        end
    end

    --put starting positions
    iNumMajorCivs = PlayerManager.GetAliveMajorsCount();

    --put players at center
    local playerCoordY = g_iH/2;
    local playerCoordX = g_iW/2;
    local plotFound = false;

    print("Generating starting coordinates for major civs");
    for j = iNumMajorCivs-1, 0, -1 do
        local player = Players[j];
        plotFound = false;

        for iX = 0, g_iW -1 do
            for iY = 0, g_iH - 1 do
                local index = (iY * g_iW) + iX;
                pPlot = Map.GetPlotByIndex(index);

                if(pPlot == nil) then
                    print("plot is nil!");
                    return;
                end

                if(pPlot:GetX() == g_iW/j and pPlot:GetY() == playerCoordY) then
                    print("Setting starting plot!");
                    player:SetStartingPlot(pPlot);
                    plotFound = true;
                    break;
                end
            end

            if(plotFound == true) then
                break;
            end
        end
    end

    for j = iNumMajorCivs-1, 0, -1 do
        --StartPositioner.MarkMajorRegionUsed(j);
    end

    print("Start positioner function?");
    --StartPositioner.DivideMapIntoMajorRegions(iNumMajorCivs, 0, 0);

    print("DONE");
end

Here is the Lua.log output:

Code:
DebugHotloadCache: GameDebug initialized!
Error opening/reading where=, file=C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Binaries\Win64Steam\TunerGameRandomEvents.lua
Test: Test.LUA loaded!
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
AdvancedSetup: There are 6 participating players.
AdvancedSetup: Building Game Setup
AdvancedSetup: Player Count Changed
AdvancedSetup: There are 6 participating players.
AdvancedSetup: Player Count Changed
AdvancedSetup: There are 6 participating players.
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
AdvancedSetup: Hiding Game Setup
Error opening/reading where=, file=C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Binaries\Win64Steam\TunerGameRandomEvents.lua
LoadScreen: true
LoadScreen: false
LoadScreen: false
LoadScreen: true
LoadScreen: true
GenerateRandomMap: Map Seed = -1452271072
Map Script: lol xd
Map Script: Flooding map with ocean - PASS 1
Map Script: Generating starting coordinates for major civs
Map Script: Setting starting plot!
Map Script: Start positioner function?
Map Script: DONE
LoadScreen: OnLoadGameViewStateDone
Mods: Failed to create mods browser search context!
Test: Test.LUA loaded!
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
 
Top Bottom