zaloglu2211
Chieftain
I want to do this but how i can? Please help me. Thx
Note:for Civ5 worldbuilder
Note:for Civ5 worldbuilder
You may be able to add over 22 civs if you have a dll that does so and you add them during game start using lua. You cannot add them directly to the map in worldbuilder
--found Denmark Cities
function FoundDenmark()
if Game.GetElapsedGameTurns() == 0 then
-- Set up Denmark Player
for iPlayer=0, GameDefines.MAX_MAJOR_CIVS-1 do
local pDenmark = Players[iPlayer]
if (GameInfo.Civilizations.CIVILIZATION_DENMARK.ID == pDenmark:GetCivilizationType()) then
pDenmark:Found(95, 10)
pDenmark:Found(88, 12)
pDenmark:Found(98, 7)
--print (pDenmark:GetName() ,"...is founding cities");
end
end
end
end
Events.SequenceGameInitComplete.Add(FoundDenmark)
http://forums.civfanatics.com/showthread.php?t=547479
local iNewPlayer = g_nextAvailablePlayerIndex
g_nextAvailablePlayerID = g_nextAvailablePlayerIndex + 1
local newCivInfo = GameInfo.Civilizations[newCivID]
local oldPlayer = Players[iOldPlayer]
local iTeam = iNewPlayer
--Get the proper leader for the new civ
local newLeaderID
for row in GameInfo.Civilization_Leaders() do
if newCivInfo.Type == row.CivilizationType then
newLeaderID = GameInfoTypes[row.LeaderheadType]
break
end
end
if not newLeaderID then
error("PlayerCivSwap: No leader for new civ type")
end
--Add new player here?
print("AddPlayer")
PreGame.SetTeam(iNewPlayer, iTeam)
Game.AddPlayer(iNewPlayer, newLeaderID, newCivID)
--Setup the new player in PreGame
PreGame.SetLeaderName(iNewPlayer, GameInfo.Leaders[newLeaderID].Description)
PreGame.SetCivilizationDescription(iNewPlayer, newCivInfo.Description)
PreGame.SetCivilizationShortDescription(iNewPlayer, newCivInfo.ShortDescription)
PreGame.SetCivilizationAdjective(iNewPlayer, newCivInfo.Adjective)
PreGame.SetPassword(iNewPlayer, "")
PreGame.SetCivilization(iNewPlayer, newCivID)
PreGame.SetLeaderType(iNewPlayer, newLeaderID)
PreGame.SetHandicap(iNewPlayer, oldPlayer:GetHandicapType())
PreGame.SetSlotStatus(iNewPlayer, SlotStatus.SS_COMPUTER)
PreGame.SetSlotClaim(iNewPlayer, SlotClaim.SLOTCLAIM_ASSIGNED)
print("GetSlotStatus = ", PreGame.GetSlotStatus(iNewPlayer))
local newPlayer = Players[iNewPlayer]
newPlayer:SetStartingPlot(oldPlayer:GetStartingPlot())
print("New player team is / should be= ", newPlayer:GetTeam(), iTeam)
print("Starting plot, old/new = ", oldPlayer:GetStartingPlot(), newPlayer:GetStartingPlot())
local oldCapital = oldPlayer:GetCapitalCity()
local newCity = newPlayer:InitCity(oldCapital:GetX()+3, oldCapital:GetY())
I use this code to found some Danish cities on a worldbuilder map. Mind you, I have Denmark as one of the civs existing on the map. There is likely more code needed to add a civilization not already included on the map... I am not certain how to do that, however, you may want to search the forums for some coding that brings in another player after the game loads.
Code:--found Denmark Cities function FoundDenmark() if Game.GetElapsedGameTurns() == 0 then -- Set up Denmark Player for iPlayer=0, GameDefines.MAX_MAJOR_CIVS-1 do local pDenmark = Players[iPlayer] if (GameInfo.Civilizations.CIVILIZATION_DENMARK.ID == pDenmark:GetCivilizationType()) then pDenmark:Found(95, 10) pDenmark:Found(88, 12) pDenmark:Found(98, 7) --print (pDenmark:GetName() ,"...is founding cities"); end end end end Events.SequenceGameInitComplete.Add(FoundDenmark)
Not knowledgable enough about how to do this... sorry. It would probably take a week of work for me to figure it out if I even could. Maybe searching google or for mods that do this might help you. Otherwise, one can only hope one of the lua gods intervenes from above .