AW Arcaeca
Deus Vult
The following code...
...cause the lua.log to spew this out every single turn:
I'm not sure why it feels it necessary to print the same thing some several hundred trillion (not at all exaggerated ) times - it appears to be checking every single civ every turn. To top it all off, the game proceeds to crash after about 5 turns, and none of the logs yield any clue as to why.
And every turn? I know it's hooked into GameEvents.PlayerDoTurn, but shouldn't that variable "hasReceivedFreeBonuses" make so that the bonus is only set once?
Furthermore, this coding...
...for heaven knows why seems to make the game crash upon founding your first city. I don't actually know that for certain, but removing it from the load queue gave me that extra 5 more turns before crashing. Again, the logs yield no errors and I have no clue why. All this is supposed to do is provide a randomized yield each turn per city that has the civ's UB.
I'm playtesting with G&K, but I don't recall using any BNW functions...
Finally, upon selecting the newly built UU the game crashes. There nothing special about it; it has all the same stats as a scout and can do nothing special at the moment... database.log reveals no errors in accidental misspelling or anything... no lua attached to the unit. I can't figure it out. But the mod's not ready to go public yet, so if anyone would like to help me debug this, I can PM them the attachment. I'm just wondering if anyone has any ideas about why any of this is occurring.
Besides the incessant crashing, the civ works mostly fine at the moment.
TIA for any help possible,
AW
Spoiler :
Code:
-- LuaFile
-- Author: AW
-- DateCreated: 6/17/2014 4:55:33 PM
--------------------------------------------------------------
print("Lua File loaded.")
GameEvents.PlayerDoTurn.Add(
function(iPlayer)
hasReceivedFreeBonuses = false
if not hasReceivedFreeBonuses then
pPlayer = Players[iPlayer]
print("pPlayer identified")
if (pPlayer:IsEverAlive()) then
if (pPlayer:IsAlive()) then
print("pPlayer is alive; are they NEW_CIV_TYPE")
if (pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_NEW_CIV) then
print("pPlayer is alive; commence to add bonuses")
pPlayer:GetCapitalCity():ChangeFood(15)
print ('New Civ Type gets Bonus #1!')
pPlayer:GetCapitalCity():ChangeProduction(10)
print ('New Civ Type Gets Bonus #2!')
hasReceivedFreeBonuses = true
else
return
end
end
end
end
end)
Spoiler :
Code:
[40861.263] TurnProcessing: Hiding TurnProcessing
[40869.843] LuaFile: pPlayer identified
[40869.843] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40869.968] LuaFile: pPlayer identified
[40869.968] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.109] LuaFile: pPlayer identified
[40870.109] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.218] LuaFile: pPlayer identified
[40870.218] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.327] LuaFile: pPlayer identified
[40870.327] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.436] LuaFile: pPlayer identified
[40870.436] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.655] LuaFile: pPlayer identified
[40870.655] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40870.889] LuaFile: pPlayer identified
[40870.889] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.029] LuaFile: pPlayer identified
[40871.029] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.154] LuaFile: pPlayer identified
[40871.154] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.263] LuaFile: pPlayer identified
[40871.263] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.388] LuaFile: pPlayer identified
[40871.388] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.513] LuaFile: pPlayer identified
[40871.513] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.622] LuaFile: pPlayer identified
[40871.622] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.747] LuaFile: pPlayer identified
[40871.747] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.871] LuaFile: pPlayer identified
[40871.871] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40871.981] LuaFile: pPlayer identified
[40871.981] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.105] LuaFile: pPlayer identified
[40872.105] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.215] LuaFile: pPlayer identified
[40872.215] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.339] LuaFile: pPlayer identified
[40872.339] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.449] LuaFile: pPlayer identified
[40872.449] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.573] LuaFile: pPlayer identified
[40872.573] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.698] LuaFile: pPlayer identified
[40872.698] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.823] LuaFile: pPlayer identified
[40872.823] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40872.948] LuaFile: pPlayer identified
[40872.948] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.041] LuaFile: pPlayer identified
[40873.041] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.166] LuaFile: pPlayer identified
[40873.166] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.260] LuaFile: pPlayer identified
[40873.260] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.385] LuaFile: pPlayer identified
[40873.385] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.509] LuaFile: pPlayer identified
[40873.509] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.603] LuaFile: pPlayer identified
[40873.603] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.728] LuaFile: pPlayer identified
[40873.728] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.853] LuaFile: pPlayer identified
[40873.853] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40873.977] LuaFile: pPlayer identified
[40873.977] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.071] LuaFile: pPlayer identified
[40874.071] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.180] LuaFile: pPlayer identified
[40874.180] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.305] LuaFile: pPlayer identified
[40874.305] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.430] LuaFile: pPlayer identified
[40874.430] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.539] LuaFile: pPlayer identified
[40874.539] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.664] LuaFile: pPlayer identified
[40874.664] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.773] LuaFile: pPlayer identified
[40874.773] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40874.898] LuaFile: pPlayer identified
[40874.898] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.007] LuaFile: pPlayer identified
[40875.007] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.132] LuaFile: pPlayer identified
[40875.132] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.225] LuaFile: pPlayer identified
[40875.225] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.350] LuaFile: pPlayer identified
[40875.350] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.459] LuaFile: pPlayer identified
[40875.459] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.584] LuaFile: pPlayer identified
[40875.584] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.709] LuaFile: pPlayer identified
[40875.709] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.818] LuaFile: pPlayer identified
[40875.818] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40875.943] LuaFile: pPlayer identified
[40875.943] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40876.068] LuaFile: pPlayer identified
[40876.068] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40876.317] LuaFile: pPlayer identified
[40876.317] LuaFile: pPlayer is alive; are they NEW_CIV_TYPE?
[40876.317] LuaFile: pPlayer is alive; commence to add bonuses
[40876.317] LuaFile: New Civ Type gets bonus #1!
[40876.317] LuaFile: New Civ Type gets bonus #2!
And every turn? I know it's hooked into GameEvents.PlayerDoTurn, but shouldn't that variable "hasReceivedFreeBonuses" make so that the bonus is only set once?
Furthermore, this coding...
Spoiler :
Code:
print("Loading counts!")
GameEvents.PlayerDoTurn.Add(
function(iPlayer)
pPlayer = Players[iPlayer]
print("Identiftying iPlayer's cities.")
for pCity in pPlayer:Cities() do
if (pCity:IsHasBuilding(GameInfoTypes.BUILDING_UB)) then
print("City has UB. Proceed.")
local randomizer = math.random(1, 3)
-- 1 = faith
-- 2 = culture
-- 3 = production
if (randomizer == 1) then
pPlayer:ChangeFaith(1)
print("In city " .. pCity:GetName() .. " UB generates 1 faith.")
elseif (randomizer == 2) then
pPlayer:ChangeCulture(2)
print("In city " .. pCity:GetName() .. " UB generates 2 culture.")
else
pCity:ChangeProduction(2)
print("In city " .. pCity:GetName() .. " UB generates 2 production.")
end
else
return
end
end
end)
I'm playtesting with G&K, but I don't recall using any BNW functions...
Finally, upon selecting the newly built UU the game crashes. There nothing special about it; it has all the same stats as a scout and can do nothing special at the moment... database.log reveals no errors in accidental misspelling or anything... no lua attached to the unit. I can't figure it out. But the mod's not ready to go public yet, so if anyone would like to help me debug this, I can PM them the attachment. I'm just wondering if anyone has any ideas about why any of this is occurring.
Besides the incessant crashing, the civ works mostly fine at the moment.
TIA for any help possible,
AW