WB CIVs placement function

It's still in AssignStartingPlots.lua, look for AssignStartingPlots:ChooseLocations(args) (search ""ChooseLocations" for some comments) and AssignStartingPlots:BalanceAndAssign(). There are a lot of other function used for the placement. For CS look for AssignStartingPlots:PlaceResourcesAndCityStates(), and the listed functions here.

Good luck.
 
Thinking of it, I'm not certain of this, but if it's not done there, it's not in one of the Lua file, so it could be done in the core game...
 
I dont think that it is AssignStartingPlots.lua.
I have added print("tag"); to all function in AssignStartingPlots.lua and start game on MB map. There was no result in FT. I'm not sure if it is because my mistake with debuger level or it is other function. I sow ambrox62 post in your map tread with info "[11315.734] WorldBuilderMapLoader: Map Generation - Adding Resources". I cant find WorldBuilderMapLoader.lua file? Do you know where i could find it?
 
Yep, now I remember it, and if my memory is correct this time, there's WorldBuilderRandomItems.lua which is called when the WB random map resource placement is checked, and I've hooked the map generation of YnAEMP in the goody hut function of MapGenerator.lua, because I hadn't found any other place to do it. (and so I need to check the random placement for goody hut for all the maps I use in YnAEMP)

So I believe WorldBuilderMapLoader is not available as a Lua file, it must be a function or file in the c++ code.
 
All of the map-generating functions are stored in the same folder afaik:

Program Files\Steam\steamapps\common\sid meier's civilization v\assets\Gameplay\Lua

There is no file which you mention, so probably it's in DLL.

It's strange that you didn't see any output from AssignStartingPlots.lua because many things you see in the console when it generates a new map should be produced by it.
 
All of the map-generating functions are stored in the same folder afaik:

Program Files\Steam\steamapps\common\sid meier's civilization v\assets\Gameplay\Lua

There is no file which you mention, so probably it's in DLL.

It's strange that you didn't see any output from AssignStartingPlots.lua because many things you see in the console when it generates a new map should be produced by it.

But i dont generate new map by map script. I want to use ready map prepared in WorldBuilder and start hotseat game on world map with TSL (true start location) but it is not possiable in current game because you cant use mods or scenarios in multiplayer mode :(.

I want to use this map:
Standard Earth Map (80x52)
ynaemp_cordiform.jpg


and correct random starting position to fixed TSL by this code:
Spoiler :


for player_ID = 0, GameDefines.MAX_MAJOR_CIVS + GameDefines.MAX_MINOR_CIVS - 1 do
local player = Players[player_ID];
if isValidPlayer(player) then
local CivName = player:GetName();
local CivName2 = "Washington";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(13,32);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Harun al-Rashid";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(49,16);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Montezuma";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(5,27);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Wu Zetian";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(60,35);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Ramesses II";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(44,16);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Elizabeth";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(34,34);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Napoleon";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(33,29);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Bismarck";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(39,32);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Alexander";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(42,23);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Gandhi";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(58,22);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Hiawatha";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(17,36);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Oda Nobunaga";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(60,45);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Suleiman";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(46,24);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Darius I";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(53,22);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Augustus Caesar";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(37,24);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Catherine";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(45,36);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Ramkhamhaeng";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(62,25);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Askia";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(32,14);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Pachacuti";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(14,12);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Isabella";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(32,24);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

CivName = player:GetName();
CivName2 = "Harald Bluetooth";
if CivName == CivName2 then
local playerStartPlot = Map.GetPlot(38,37);
player:SetStartingPlot(playerStartPlot);
end -- if civnamed

end -- ifvalid end
end -- for end



But I dont know where I could add it. I think that all function from WorldBuilderRandomItems.lua are initialized before random position placement. Do you have any ideas?

This game is not moders friendly for sure, it is not users friendly also. :mad:
 
in WB set the map to use random goody hut, then in MapGenerator.lua add your code at the start of the function AddGoodies(). Of course you'll have to remove the code if you want to use another map.
 
Yep, now I remember it, and if my memory is correct this time, there's WorldBuilderRandomItems.lua which is called when the WB random map resource placement is checked, and I've hooked the map generation of YnAEMP in the goody hut function of MapGenerator.lua, because I hadn't found any other place to do it. (and so I need to check the random placement for goody hut for all the maps I use in YnAEMP)

So I believe WorldBuilderMapLoader is not available as a Lua file, it must be a function or file in the c++ code.

OK its works wirh AddGoody(), thx you for inspiration.
 
Back
Top Bottom