Please Help Me with my own civilization(Noob)

Samsamqwq

Chieftain
Joined
Apr 1, 2016
Messages
7
So I created my own test civilization after this tutorial: http://forums.civfanatics.com/showthread.php?t=490901

After loading the mod I couldn't scroll in the civilization mod menu. I looked it up and I found that it means there is something wrong with the civ.
So I installed a mod called really advanced setup to play my civilization by force.
Both my unique palace and my unique renamed copy paste unit from the Kris Swordsman seem to work fine:). But when I load the civilization the loading screen is broken(view screenies). I couldn't find anything wrong in my log. But here it is anyway:
Spoiler :
[78330.906] columns StrategicViewType, TileType are not unique
[78330.906] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[78333.359] no such table: ContentPackage.LocalizedText
[78333.359] no such table: ContentPackage.LocalizedText
[78333.359] no such table: ContentPackage.LocalizedText
[78334.375] no such table: ContentPackage.LocalizedText
[78337.062] columns StrategicViewType, TileType are not unique
[78337.062] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[78338.078] no such table: ContentPackage.LocalizedText
[78338.093] no such table: ContentPackage.LocalizedText
[78338.093] no such table: ContentPackage.LocalizedText
[78343.703] Validating Foreign Key Constraints...
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78343.703] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.250] Failed Validation.
[78346.750]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 8530688 78080752
PageCache: 6 12
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 8108520 65180976
Scratch: 0 0

Largest Allocations:
Malloc: 262144
PageCache: 1172
Scratch: 6664

Prepared Statements:
Current: 6
------------------------------
[78346.781] Validating Foreign Key Constraints...
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78346.781] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78349.328] Failed Validation.
[78349.812]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 8531864 78080752
PageCache: 6 12
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 8109696 65180976
Scratch: 0 0

Largest Allocations:
Malloc: 262144
PageCache: 1172
Scratch: 6664

Prepared Statements:
Current: 6
------------------------------
[78386.640] Validating Foreign Key Constraints...
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78386.656] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[78389.218] Failed Validation.
[78389.718]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 8605704 78080752
PageCache: 7 13
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 8141448 65180976
Scratch: 0 0

Largest Allocations:
Malloc: 262144
PageCache: 1172
Scratch: 6664

Prepared Statements:
Current: 12
------------------------------
[78408.218] no such column: Type
[78408.218] In Query - select * from Natural_Wonder_Placement where Type = ? LIMIT 1
 

Attachments

  • why.JPG
    why.JPG
    71.1 KB · Views: 128
  • using really advanced setup.jpg
    using really advanced setup.jpg
    307.9 KB · Views: 54
  • SheogorathCiv.rar
    10.9 KB · Views: 32
If the setup screen is broken, you're civ is missing (at least) two uniques.

Nothing in the logs implies you've omitted (at least one) OnModActivated->UpdateDatabase entry ...

Edit: ... all of which are there ... ummmm ....
 
thanks for the quick reply. Maybe the palace doesn't count as UB? Because in game it has the changes I made, the same goes for the unit.
 
Your leader's trait is set to TRAIT_CREATIVE, but the trait you created is TRAIT_CREATIVE_BALLS_BALLS. There is an unused TRAIT_CREATIVE in the game, but it lacks a Description or ShortDescription - perhaps that's causing problems.
 
Ah I see that may be it. The err... rather creative name of my leaders trait is because I was annoyed that the trait creative seemed to be already taken by another civ. So I tried something else. I'll try correcting it right now. Thanks.

EDIT: HURRAY! It worked thanks. I would have never thought of this myself. Or maybe I would have but It would have taken a lot longer. Thank both of you again!
 
but it lacks a Description or ShortDescription - perhaps that's causing problems.
Beat me to it. Lua.log is complaining about a missing description for the trait. One to add to the list of "many ways to kill the setup screen" :lol:
 
So if anyone ist still here that can help me, i have a new tasty and fresh problem.
I added a Lua script, in which I tried to add a random chance wether a monument or a wall should be placed in the city when it is founded. Yeah I know great idea as a noob.
The Lua log says that...
Spoiler :
[155919.281] Initializing Lua 5.1.4
[155974.421] InstalledPanel: Refreshing Mods
[155974.421] InstalledPanel: GetModBrowserListings()
[156037.968] Map Script: Generating Map
[156037.968] Map Script: Generating Plot Types (Lua Pangaea) ...
... Bla Bla (I had to many characters already)
[156039.062] Map Script: Fert/Plot: 1.8365384615385
[156039.062] Map Script: -
[156039.062] Map Script: Choosing start locations for civilizations.
[156039.062] Map Script: Map Generation - Choosing Start Locations for Civilizations
[156039.093] Map Script: Normalizing start locations and assigning them to Players.
[156039.093] Map Script: Player 0 of Civ Type CIVILIZATION_SHIVERINGISLES
[156039.109] Map Script: Player 1 of Civ Type CIVILIZATION_GERMANY
[156039.109] Map Script: Player 2 of Civ Type CIVILIZATION_POLAND
[156039.109] Map Script: Player 3 of Civ Type CIVILIZATION_INCA
[156039.109] Map Script: Player 4 of Civ Type CIVILIZATION_SONGHAI
[156039.109] Map Script: Player 5 of Civ Type CIVILIZATION_JAPAN
[156039.109] Map Script: - - - - - - - needs Coastal Start!
[156039.109] Map Script: -
[156039.125] Map Script: Player 6 of Civ Type CIVILIZATION_CHINA
[156039.125] Map Script: Player 7 of Civ Type CIVILIZATION_INDIA
[156039.125] Map Script: Player 8 of Civ Type CIVILIZATION_EGYPT
[156039.125] Map Script: Player 9 of Civ Type CIVILIZATION_ASSYRIA
[156039.125] Map Script: Player 10 of Civ Type CIVILIZATION_RUSSIA
[156039.125] Map Script: Player 11 of Civ Type CIVILIZATION_SWEDEN
[156039.125] Map Script: Civs with Coastal Bias: 1
[156039.125] Map Script: Civs with River Bias: 0
[156039.140] Map Script: Civs with Region Priority: 6
[156039.140] Map Script: Civs with Region Avoid: 3
Bla Bla...
[156060.000] ChooseIdeologyPopup: 963
[156060.000] ChooseIdeologyPopup: 994
[156060.562] AdvisorInfoPopup: Closing Advisor Info
[156060.562] Demographics: Dequeuing demographics
[156060.562] Demographics: Dequeuing demographics
[156083.968] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156095.250] TechPopup: stealingTechTargetPlayerID: -1
[156095.265] TechPopup: iValue: 0
[156096.453] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156096.703] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156096.953] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.125] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.281] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.406] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.531] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.687] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156097.843] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156098.062] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156098.281] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156098.562] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156098.765] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156098.890] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.046] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.171] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.312] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.453] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.578] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.703] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.859] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156099.984] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.109] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.218] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.375] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.515] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.625] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156100.781] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.296] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.421] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.578] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.703] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.828] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156102.968] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)
[156103.140] Runtime Error: C:\Users\Administrator\Documents\My Games\Sid Meier's Civilization 5\MODS\SheogorathCiv\Lua/AddBuildingCityFun.lua:12: attempt to index local 'PlayerSheo' (a nil value)

...I tried to index PlayerSheo but it's a nil value. But I thought I defined PlayerSheo with PlayerSheo = Players[iPlayer] or did I misunderstand something?
Here's the script:
Spoiler :

cheese = GameInfoTypes.BUILDING_MONUMENT
intestines = GameInfoTypes.BUILDING_WALLS
brain=math.random(1, 2)

Events.SerialEventCityCreated.Add(function(iPlayer)
local PlayerSheo = Players[iPlayer]
if PlayerSheo:IsEverAlive() then
if (PlayerSheo:GetCivilizationType()==GameInfoTypes["CIVILIZATION_SHIVERINGISLES"]) then
if (pCity:GetNumRealBuilding(cheese) < 0) and (pCity:GetNumRealBuilding(intestines) < 0) then
if brain==1 then
pCity:SetNumRealBuilding(cheese + 1)
print("adding 1 monument")
elseif brain==2 then
pCity:SetNumRealBuilding(intestines + 1)
print("adding 1 Wall")
end
end
end
end
end
)

Also would it even work with all the errors corrected? Or is there an easier way to achieve what I want?
 

Attachments

  • SheogorathCiv2.rar
    11.6 KB · Views: 29
or did I misunderstand something?

The signature for the SerialEventCityCreated event is
Code:
Events.SerialEventCityCreated.Add(function (hexPos, playerID, cityID, cultureType, eraType, continent, populationSize, size, fowState)
  ... 
end)
Rule 1 of programming - understand what you're dealing with ;)

BTW - for stuff like this, the best reference source are the game core UI files
 
Also, I don't see how this will ever be "true":
Code:
if (pCity:GetNumRealBuilding(cheese) < 0) and (pCity:GetNumRealBuilding(intestines) < 0) then
since a city will not have less than '0' copies of a building.

I suppose in some wierd concatenation of code-methods where some other mod places '-1' copies of a building within a city, it could happen, but I'm not even sure negative values in "iNumBuildings" for City:SetNumRealBuilding(iBuildingType, iNumBuildings) even works or not.

--------------------------------------------------------------------------------------------------

Which leads directly into the next issue, which is that this:
Code:
pCity:SetNumRealBuilding(intestines + 1)
is missing the required parameter for "iNumBuildings", which is just an example placeholder variable and needs to be an integer value telling the API how many copies of "iBuildingType" to place within the given city.

--------------------------------------------------------------------------------------------------

Which leads to the next issue: you are using variable "pCity" before it is even defined, so "pCity" will have a value of 'nil', and you will get an error for that once you get past the error for "PlayerSheo" having a nil value.
 
But shouldn't it work when I make it: PlayerSheo = Players[playerID]? Also thanks for the help everyone! Yeah and the thingy (pCity:GetNumRealBuilding(cheese) < 0) and (pCity:GetNumRealBuilding(intestines) < 0) replacing it with an == should work right?
 
But shouldn't it work when I make it: PlayerSheo = Players[playerID]? Also thanks for the help everyone! Yeah and the thingy (pCity:GetNumRealBuilding(cheese) < 0) and (pCity:GetNumRealBuilding(intestines) < 0) replacing it with an == should work right?
  1. With regard to "playerID":
    • Not if you don't change to:
      Code:
      Events.SerialEventCityCreated.Add(function(hexPos, playerID, cityID, cultureType, eraType, continent, populationSize, size, fowState)
      because if you leave it as:
      Code:
      Events.SerialEventCityCreated.Add(function(playerID )
      then you won't be fixing anything -- all you will be doing is shifting the problem from using variable "iPlayer" to variable "playerID".
    • The data that gets sent to a 'hook' event is based on position, so the data the game sends for "hexPos" will always be sent to the 1st variable in your list. In your original code, "iPlayer" was in the position for "hexPos" so you were trying to use the data for a HexPos as the player ID#. I can call the variables anything I want, but I must use the variables properly based on where I position them in my function() line.
    • I can do this:
      Code:
      Events.SerialEventCityCreated.Add(function(Hamburgers, Cheeseburgers, PizzaType, Pickles, Mustard, Mayonaisse, Ketchup, Whoppers, SesameSeeds)
      and so long as I follow through and do:
      Code:
      local pPlayer = Players[Cheeseburgers]
      everything will be fine because I am using the data from the second parameter (the player ID#) in the proper way. But it will very quickly get very confusing to read such a code, which is why we tend to always use either "iPlayer" or "PlayerID" for a parameter which we expect to pass to us the Player ID # of the affected player.
  2. With regard to "==" instead of "<": yes, this should fix that issue
 
Ahh now I get it. Thank you! I was already wondering why the would have two different "keywords" or something for the exact same purpose. Yes, YES, YEEES IT WORKS! Here's the script if interested:
Spoiler :
cheese = GameInfoTypes.BUILDING_MONUMENT
intestines = GameInfoTypes.BUILDING_WALLS


Events.SerialEventCityCreated.Add(function(Satan, playerID, cityID)
local PlayerSheo = Players[playerID]
local pCity = PlayerSheo:GetCityByID(cityID)
local iNumBuildings = 0
local brain=math.random(1, 2)
if PlayerSheo:IsEverAlive() then
if (PlayerSheo:GetCivilizationType()==GameInfoTypes["CIVILIZATION_SHIVERINGISLES"]) then
if (pCity:GetNumRealBuilding(cheese) == 0) and (pCity:GetNumRealBuilding(intestines) == 0) then
if brain==1 then
pCity:SetNumRealBuilding(cheese, iNumBuildings + 1)
print("adding 1 monument")
elseif brain==2 then
pCity:SetNumRealBuilding(intestines, iNumBuildings + 1)
print("adding 1 Wall")
end
end
end
end
end
)
 
And before you will get your code to work you will need to fix the issue of "pCity" never being defined.

Look here: Player.GetCityByID

At the bottom there are some practical examples as used by firaxis to get a "pCity" type of data for a city, even though they don't always name their variable specifically "pCity". Also, that bottom section tells you the file where Firaxis is using the quoted code.

You already have the "City ID#", given as part of the data sent to your function.
 
Sooo, is there any way that I can make another civ declare war on every civ else? My idea is to make a replacement for a great musician, who can select a feature or something like that, that affects the targeted civ when he is expended via a concert tour. I don't know it that is even remoteley possible though.
 
Top Bottom