Shadowling
Chieftain
Can't find the delete button, ignore this one
.

g_eaPerson.gotoPlotIndex = -1
g_eaPerson.gotoEaActionID = -1
if g_bGreatPerson then
if g_eaPerson.eaActionID ~= -1 and g_eaPerson.eaActionID ~= eaActionID then --GP had a previous action that needs to be interrupted
InterruptEaAction(iPlayer, iPerson)
elseif not bTest and g_eaPerson.eaActionID == eaActionID then --this was an ongoing action that needs to be interrupted
InterruptEaAction(iPlayer, iPerson)
--ReappearGP(iPlayer, iPerson)
end
end
if not bTest then return false end --action cannot be done for some reason; GP will reappear for instructions (human or AI)
--add generic table tag effects here
if Do[eaActionID] then
if not Do[eaActionID]() then --this is the call to action-specific Do function if it exists
print("!!!! Warning: TestEaAction said OK but action specific Do function did not return a true value")
InterruptEaAction(iPlayer, g_iPerson)
return false --Warning! AI might go into infinite loop if Test keeps passing true (fail from Do only possible for DoMoveToPlot at this time)
end
end
if g_bGreatPerson then
--Memory for AI specialization
if g_eaAction.GPModType1 then
local memValue = 2 ^ (g_gameTurn / MOD_MEMORY_HALFLIFE)
local modID = GameInfoTypes[g_eaAction.GPModType1]
g_eaPerson.modMemory[modID] = (g_eaPerson.modMemory[modID] or 0) + memValue
if g_eaAction.GPModType2 then
local modID = GameInfoTypes[g_eaAction.GPModType2]
g_eaPerson.modMemory[modID] = (g_eaPerson.modMemory[modID] or 0) + memValue
end
end
end
if g_eaAction.StayInvisible then
g_unit:SetInvisibleType(INVISIBLE_SUBMARINE)
else
g_unit:SetInvisibleType(-1)
end
--Alt unit upgrades
if g_eaAction.UnitUpgradeTypePrefix then
local newUnit = g_player:InitUnit(g_int1, g_x, g_y)
MapModData.bBypassOnCanSaveUnit = true
newUnit:Convert(g_unit, true)
g_unit = newUnit --this will finish moves below; watch out because g_unitTypeID is no longer correct
g_player:ChangeGold(-g_int2)
end
--Effects on unit
if g_eaAction.DoXP > 0 then
g_unit:ChangeExperience(g_eaAction.DoXP)
end
if g_eaAction.DoGainPromotion then
g_unit:SetHasPromotion(GameInfoTypes[g_eaAction.DoGainPromotion], true)
end
--Finish moves
if g_eaAction.FinishMoves then
g_unit:FinishMoves()
end
if g_bGreatPerson then
g_eaPerson.gotoPlotIndex = -1
g_eaPerson.gotoEaActionID = -1
if g_eaPerson.eaActionID ~= -1 and g_eaPerson.eaActionID ~= eaActionID then --GP had a previous action that needs to be interrupted
InterruptEaAction(iPlayer, iPerson)
elseif not bTest and g_eaPerson.eaActionID == eaActionID then --this was an ongoing action that needs to be interrupted
InterruptEaAction(iPlayer, iPerson)
--ReappearGP(iPlayer, iPerson)
end
end
if not bTest then return false end --action cannot be done for some reason; GP will reappear for instructions (human or AI)
--add generic table tag effects here
if Do[eaActionID] then
if not Do[eaActionID]() then --this is the call to action-specific Do function if it exists
print("!!!! Warning: TestEaAction said OK but action specific Do function did not return a true value")
InterruptEaAction(iPlayer, g_iPerson)
return false --Warning! AI might go into infinite loop if Test keeps passing true (fail from Do only possible for DoMoveToPlot at this time)
end
end
if g_bGreatPerson then
--Memory for AI specialization
if g_eaAction.GPModType1 then
local memValue = 2 ^ (g_gameTurn / MOD_MEMORY_HALFLIFE)
local modID = GameInfoTypes[g_eaAction.GPModType1]
g_eaPerson.modMemory[modID] = (g_eaPerson.modMemory[modID] or 0) + memValue
if g_eaAction.GPModType2 then
local modID = GameInfoTypes[g_eaAction.GPModType2]
g_eaPerson.modMemory[modID] = (g_eaPerson.modMemory[modID] or 0) + memValue
end
end
if g_eaAction.StayInvisible then
g_unit:SetInvisibleType(INVISIBLE_SUBMARINE)
else
g_unit:SetInvisibleType(-1)
end
end
--Alt unit upgrades
if g_eaAction.UnitUpgradeTypePrefix then
local newUnit = g_player:InitUnit(g_int1, g_x, g_y)
MapModData.bBypassOnCanSaveUnit = true
newUnit:Convert(g_unit, true)
g_unit = newUnit --this will finish moves below; watch out because g_unitTypeID is no longer correct
g_player:ChangeGold(-g_int2)
end
--Effects on unit
if g_eaAction.DoXP > 0 then
g_unit:ChangeExperience(g_eaAction.DoXP)
end
if g_eaAction.DoGainPromotion then
g_unit:SetHasPromotion(GameInfoTypes[g_eaAction.DoGainPromotion], true)
end
--Finish moves
if g_eaAction.FinishMoves and g_unit then
g_unit:FinishMoves()
end
function AIInturruptGPsForLeadershipOpportunity(iPlayer) --TO DO: Make this better by selecting good leader for civ
local player = Players[iPlayer]
local capital = player:GetCapitalCity()
[COLOR="Red"]if not capital then return end[/COLOR]
[34218.453] EaMain: BlightPlot table: 5CC36140 5 47 0 true
[34218.453] EaMain: All target tests passed
[34218.453] EaMain: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 2)\EaMain\EaSpells.lua:2269: attempt to perform arithmetic on a nil value
local iW5, iH5 = Floor(iW/5), Floor(iH/5)
local iW5, iH5 = Floor(iW/5) + 1, Floor(iH/5) + 1
local dist = PlotDistance(x, y, x5*5, y5*5)
local dist = PlotDistance(x, y, (x5-1)*5, (y5-1)*5)
return g_playerNimbyGrids[iPlayer][Floor(x/5)][Floor(y/5)]
return g_playerNimbyGrids[iPlayer][Floor(x/5) + 1][Floor(y/5) + 1]
Thanks, i will apply the fix. Yep, reloading without exiting didn't seem to cause issues with Ea (though it did with other mods) but maybe i was just lucky. I expected errors to show up if a save doesn't load correctly (and in such situation, i would exit before loading), is there a risk of "silent errors"?.Also, I can see that you are loading a lot of games without exiting Civ5. Didn't seem to cause any problems for you here, but I'm pretty sure it does sometimes. And at the very top of your log it looks like you started the mod and then backed up (or something like that) causing a bunch of errors. Someday we'll sort this out, but for now treat such activities as potentially hazardous.
@Shadowling,
The CTD above is just that d*** Learn Spell popup CTD (sorry for the profanity). We never figure it out, but I think it may have fixed itself in v3 when I moved Learn Spell to an action rather than a promotion alternative. I clicked it 10 times in newest v3 build without crash, which is a good sign.
I confirm that selling or rendering slaves are fixed in patch i.@ls612, here's another hotfix that should fix Vinnz's errors from selling/rendering slaves.
Fixed for v3., I can't improve cinnabar.
Oh my! I just discovered what I think is a very big Civ5 bug (problem was noticed by tester way up this thread). All player modifiers for tech costs are only used for UI! They are not applied for actual tech discovery.
Sometimes Firaxis codes things in strange ways...I don't think so. Check out CvPlayerTechs::GetResearchCost and CvTeamTechs::GetResearchCost. Those look like they get everything.
Well, it's probably inaccurate for me to call it a "bug" for base Civ5. I suspect that #city penalty still works in Civ5. The bug was me expecting this calculation to occur in one place in the method named to do it. But the way they actually did it was to add the code twice, once in this method (used only for UI) and then separately in whatever code actually does the job.
Of course, the whole purpose of a method is to do something in one place so you only have to get it right once. My understanding is that the firm that coded healthcare.gov didn't know this which is why it was 500 million lines of code that didn't exactly do anything for a while.