Éa III, Sword & Sorcery: Bugs/Crashes thread

The Caravan unit seems to always be locked with the tooltip: "You cannot construct this trade unit because there are no available land routes."
 
Lua error on Ea III 2d.
something about a nil value in blocked Buildings

Playing human Anaphora, around turn 65 (tried to play a few more turns, but the lua message popped up again).

And many thanks for this new phase!
 

Attachments

got a lua error on next turn. maybe its caused by another civ is loosing its capital city.

using ver 2d.
Lua error on Ea III 2d.
something about a nil value in blocked Buildings

Playing human Anaphora, around turn 65 (tried to play a few more turns, but the lua message popped up again).

And many thanks for this new phase!

These are both the same error. I am a bit concerned about how either of the values in question would be nil though, as they are initialized by hardcoding. I'll look into it further.
 
Ea III, version 2d
Harbours, harbours everywhere! Get them for free in every coastal city, not only those with natural harbour (if I remember correctly, a city next to a water tile with 4 adjacent land tiles?) Was playing as Skogr.

Also, here's the save where I'm at war with the civ, which capitol is Oloknir. I'm kind of besieging it. However, there's a great merchant of a third civ sitting in that city busy with (I presume) opening a trade route. Which is why, as it turns out, I can't attack the city - the game asks me if I want to declare war on that third civ, and if I say no, no attack is performed.
Also, for the moment I had no ruler, don't know if that matters.
The save file was not in the ModdedSaves/single folder, but in regular Saves.
 

Attachments

Ea III, version 2d
Harbours, harbours everywhere! Get them for free in every coastal city, not only those with natural harbour (if I remember correctly, a city next to a water tile with 4 adjacent land tiles?) Was playing as Skogr.

The code says 3 or more adjacent land plots to a water plot adjacent to the city. I don't know if that is intended or if it should be 4.
 
I see. Just checked the manual, it says "Any coastal plot with 4 or 5 adjacent land plots is a "natural harbor".

Anyway, right now it seems like almost every coastal city (except for those on a narrow peninsula) get a free harbour which means instant city connection. I guess this is more relevant to the balance issues though.
 
I see. Just checked the manual, it says "Any coastal plot with 4 or 5 adjacent land plots is a "natural harbor".

Anyway, right now it seems like almost every coastal city (except for those on a narrow peninsula) get a free harbour which means instant city connection. I guess this is more relevant to the balance issues though.

OK then, I'll change that in the code.
 
@Vinnz,

Just a question, was Lead Charge working for you in that game? There's an error in the log each time that might be preventing this from working.

@lis612, some fixes:

[198851.697] Runtime Error: C:\Users\Vincent\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 2)\EaMain\EaUnitCombat.lua:319: attempt to perform arithmetic on global 'tickStart' (a nil value)

Change tickStart to g_tickStart in EaMain\EaUnitCombat.lua:319

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


[200581.155] EaMain: C:\Users\Vincent\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 2)\EaMain\EaCities.lua:1263: attempt to index field 'blockedBuildingsByID' (a nil value)

Edit: ???!!! According to the log, the city Caer Sidi was captured and is now owned by Barbarians (player 63)! I did not think this is possible! I thought the dll headed this off somehow with the ransom mechanism.

Edit2: We need to understand (even in base Civ5) what happens when barbs reduce a city to 0 hp. I thought that the city was never captured. But the log here definitely shows CityCaptureComplete firing with barbs as new city owner. This is player 4's only city, so the dll kills all its units. The specific error comes during a PlayerCanConstruct check where iPlayer = 63. The mod doesn't expect barbs to own a city so a lot of things (like blockedBuildingsByID) aren't inited for them. But it may be that I just don't understand Civ5 operation. Do barbs own cities in Civ5? (maybe even briefly?)




The change below will fix the immediate symptom. But there are all kinds of things wrong with barbs owning a city. The mod code can't handle that now. How is this happening?

Change this:
Code:
	local eaPlayer = gPlayers[iPlayer]
	if not eaPlayer then return false end
	if eaPlayer.blockedBuildingsByID[buildingTypeID] then return false end
	return true

to this...
Code:
	local eaPlayer = gPlayers[iPlayer]
	if not eaPlayer then return false end
	if not eaPlayer.blockedBuildingsByID then
		print("!!!! ERROR: eaPlayer without blockedBuildingsByID", iPlayer, buildingTypeID) --who is this?
		return false
	end
	if eaPlayer.blockedBuildingsByID[buildingTypeID] then return false end
	return true
--see solution in post #114 below
 
Is there a specific trick to reactivate GP really busy doing 'sustained' action in a city? Like an Artist doing Performance or what it was called. To me the problem seems to be that these GP doing city duty are always the first ones to process their turn, so I never can move them. Clicking the 'disable last/automated action' button does not help like with other units.
It is not limited to city action actually. Even a Great general doing unit training outside city can be 'woken' only by moving the military unit away.
Could the order of turn processing be changed so that GP are last ones?

I also have the weird GP bug reported in the previous bug thread, where if a military unit is built before the 1st GP unit is received the GP is really messed up and can not perform any useful action. The next GP is ok though. The bug report mentions something like 'not enough memory' which is weird. I'll try to remember to activate the logging next time.
 
Change this:
Code:
	local eaPlayer = gPlayers[iPlayer]
	if not eaPlayer then return false end
	if eaPlayer.blockedBuildingsByID[buildingTypeID] then return false end
	return true

to this...
Code:
	local eaPlayer = gPlayers[iPlayer]
	if not eaPlayer then return false end
	if not eaPlayer.blockedBuildingsByID then
		print("!!!! ERROR: eaPlayer without blockedBuildingsByID", iPlayer, buildingTypeID) --who is this?
		return false
	end
	if eaPlayer.blockedBuildingsByID[buildingTypeID] then return false end
	return true

I made this change but immidiatly got a new error in eaplots.lua:993 from eamain.lua:242
 
Is there a specific trick to reactivate GP really busy doing 'sustained' action in a city? Like an Artist doing Performance or what it was called. To me the problem seems to be that these GP doing city duty are always the first ones to process their turn, so I never can move them. Clicking the 'disable last/automated action' button does not help like with other units.
It is not limited to city action actually. Even a Great general doing unit training outside city can be 'woken' only by moving the military unit away.
Could the order of turn processing be changed so that GP are last ones?
The human player GPs should not do anything until you press Next Turn. In fact, that's why you sometimes have to press Next Turn twice (which I can fix with some effort). It's a little hard to get used to stacked civilian units in Civ5 though. You have to click on the plot (not the flag) to cycle through multiple units on a plot. You should then get the GP with movement and available actions if you haven't already clicked Next Turn once.

Yeah, I know the 'disable last/automated action' doesn't work (or maybe isn't even there in some cases). I'll fix that. But moving or doing any other action will cancel previous action, so you should not get stuck like that. Try again and see if what I'm saying is true.

I also have the weird GP bug reported in the previous bug thread, where if a military unit is built before the 1st GP unit is received the GP is really messed up and can not perform any useful action. The next GP is ok though. The bug report mentions something like 'not enough memory' which is weird. I'll try to remember to activate the logging next time.
I've seen the "not enough memory" error before. But I did not make the connection to build order that you indicate. Is that replicable and/or have other players observed the same exact situation? Maybe that's a clue but it's hard to say when I don't understand the "out of memory" error...


I made this change but immidiatly got a new error in eaplots.lua:993 from eamain.lua:242
Weird how you guys uncover the same exact flaw at the same exact time. The real problem in both your game and Vinnz is that somehow barbs acquired a city (for Vinnz at turn ~60 iirc and for you at turn 224). That's going to cause a dozen or more errors that I can think of off the top of my head. The fix above is just the first of many.

What we need to figure out is if this is a normal Civ5 situation for barbs to own a city (even briefly). I did not think so, but maybe I'm wrong. If it's normal, then we'll just have to make the dozen or more changes in the mod to account for it. If it's not normal, then we need to figure out what we did to cause it, and fix that.

But, assuming that it is normal, then here is the immediate fix for that error. At line 984 of EaMain/EaPlots.lua, change:
Code:
if iOwner ~= -1 then
to
Code:
if iOwner ~= -1 and iOwner ~= BARB_PLAYER_INDEX then
As I said above however, this is just going to move you on to another error (I think). But I'm not sure about that. Perhaps the barb city ownership is very brief and we just need to get past a couple mod-specific issues with that and then everything will be OK again.
--see solution in post #114 below

The Caravan unit seems to always be locked with the tooltip: "You cannot construct this trade unit because there are no available land routes."
You need to send a Merchant to the destination city to "open" the route. This should be reasonably clear if you open the Trade panel and look around (but yes, I know help texts need to indicate this better too).

Nice set of other issues though. I say "nice" because they look easy to fix. We'll work through these for v3. (Can someone remind me what embassies do in base Civ5? Is it just the relationship boost, or is that needed for open borders and so on...?)

The code says 3 or more adjacent land plots to a water plot adjacent to the city. I don't know if that is intended or if it should be 4.
I think this is a case of me changing my mind in the middle of coding something. I guess it should be minimum 4 so that it is at least a little bit rare.

Also, here's the save where I'm at war with the civ, which capitol is Oloknir. I'm kind of besieging it. However, there's a great merchant of a third civ sitting in that city busy with (I presume) opening a trade route. Which is why, as it turns out, I can't attack the city - the game asks me if I want to declare war on that third civ, and if I say no, no attack is performed.
Also, for the moment I had no ruler, don't know if that matters.
Yeah, we should note this one now as known issue: "3rd party civilian blocks attack". That'll take some dll work so probably a v3 fix.
 
No, they can't.

All they do when they get your city below 0 HP is take a bunch of gold.
This was my understanding too. Nevertheless, evidence from Lua.log is irrefutable. Barbs captured a city in your game and Vinnz's. (Sometimes I get the feeling you all are staging weird situations to cause errors ;). But I know that isn't really true...)

Maybe this is what happens if an AI civ doesn't have gold to pay the ransom. Barbs get the city and then (I assume) raze it to the ground. I think I remember not having ransom in one game a long time ago and immediately getting the Defeated screen, which would be consistent with this theory.


@Tuvok99, as I said above, I guess there might be more than a few errors from this situation. But if you are willing, keep posting them and I'll keep posting "fixes". No promises that we can save your game, but this helps us fix the mod anyway. If we can clear out all errors from barbs owning a city, then ls612 can package it all up in a hotfix.


Based on conversation here I suspect it wasn't a "normal" capture, which should never happen. It doesn't even involve a barb attack. It's probably some code in the mod that is initing a barb unit on the city. Will keep investigating...

Here's an error that needs fixing. It would cause above error although I'm not sure if it is the only way or the way it happened above. In EaMain/EaUnitCombat.lua line 155, change:
Code:
			local newUnit = player:InitUnit(unitID, city:GetX(), city:GetY() )
to:
Code:
			local newUnit = Players[city:GetOwner()]:InitUnit(unitID, plot:GetX(), plot:GetY() )
This seems unlikely to be the exact cause because it would have only arisen if AI civ had slavery and was undergoing revolt. But it's a needed fix anyway...

@ls612, there are a whole bunch of cases in EaBarbarians.lua where we might have spawned a barb on a city. I'm almost convinced now that this is the problem. Take a look if you can. (I gotta run now but I'll post individual fixes if I have time later...)

Edit: Not too likely to be in EaBarbarians.lua, as there were no undead or demon spawns in the affected Lua.logs, and all other barb spawns can only occur on or adjacent to an encampment (which could not have happened adjacent to the capitals affected in the Lua.logs). Should probably have some city tests in there anyway for safety.

I still think it is either a UnitInit or a SetXY that puts a barb unit on a city. Somewhere in the code. If we can't find it now, we should at least put print statements on all of these for hotfix e so we can see if that happened right before the barb city conquest.

Edit2: OK, I found it! The AI players are both casting Reanimate Dead. This gives them skeletons and zombies that randomly revert to hostile units -- i.e., they convert to barb player. The code does not guard against this happening in a city, so I'm pretty sure that's what's happening. Skeleton or zombie turns into a barb unit in the player's capital -> barb "conquers" capital -> many errors. The fix is in EaMain/EaUnits.lua line 459. Replace these two lines:
Code:
						Players[BARB_PLAYER_INDEX]:InitUnit(unitTypeID, x, y)
						plot:AddFloatUpMessage("Unbound dead has gone hostile!")
with these:
Code:
						if plot:IsCity() then
							local spawnPlot = GetRandomAdjacentPlot(plot)
							if spawnPlot then
								local newUnit = Players[BARB_PLAYER_INDEX]:InitUnit(unitTypeID, spawnPlot:GetX(), spawnPlot:GetY())
								newUnit:JumpToNearestValidPlot()
								newUnit[COLOR="Red"][S]()[/S][/COLOR]:GetPlot():AddFloatUpMessage("Unbound dead has gone hostile!")							
							end
						else
							Players[BARB_PLAYER_INDEX]:InitUnit(unitTypeID, x, y)
							plot:AddFloatUpMessage("Unbound dead has gone hostile!")
						end
 
Re Barb Cities, I'm inclined to do a DLL-side fix in the city capture code to ensure that barbs never end up with ownership of a city. This may take a bit of work

The other fixes will be rolled into hotfix e shortly.
 
Found error in my replacement code above. Look for red strike-out text.

Even if you fixed this for barb, it could come up for another player. I've done that before too (and fixed it), initing a player unit on an enemy city and accidentally "conquering" it.
 
Found error in my replacement code above. Look for red strike-out text.

Even if you fixed this for barb, it could come up for another player. I've done that before too (and fixed it), initing a player unit on an enemy city and accidentally "conquering" it.

I saw that too, but I'm probably going to implement a generalized fix in the DLL for this.

@all: Hotfix e is up. It doesn't contain the barb city fix, but it has all of the other fixes we have discussed in this thread.
 
@Vinnz,

Just a question, was Lead Charge working for you in that game? There's an error in the log each time that might be preventing this from working.

I don't get any Lua error message with this action. But I'm not sure if it's working... I explain :

The lead charge works consistently in my games, but not exactly as described in the game manual.
What I am experiencing : When I choose the lead charge action, and then choose the enemy unit to attack, the great warrior attacks the enemy unit and gives a +xx happiness to the allied unit on same tile. Then I can attack (manually) with the allied unit.
From the manual : I would expect the allied units to attack automatically just after the great warrior round.

Hope this can help.
 
On the autosave issue, there is a setting I think in config.ini (or maybe in playerSettings) that is something like "autosave_on_active_player_turn". I can't remember the exact name but something like that. (I don't have access to my modding computer for the next week.) Someone might try setting that to 1 to see if that fixes autosave. I remember playing around with that and I might have changed it on my computer.

I don't get any Lua error message with this action. But I'm not sure if it's working... I explain :

The lead charge works consistently in my games, but not exactly as described in the game manual.
What I am experiencing : When I choose the lead charge action, and then choose the enemy unit to attack, the great warrior attacks the enemy unit and gives a +xx happiness to the allied unit on same tile. Then I can attack (manually) with the allied unit.
From the manual : I would expect the allied units to attack automatically just after the great warrior round.

Hope this can help.
Yeah, that's broken for human player. The melee unit should follow with it's own attack automatically, about 0.5 sec later. I think ls612 got that into hotfix e.
 
Yeah, that's broken for human player. The melee unit should follow with it's own attack automatically, about 0.5 sec later. I think ls612 got that into hotfix e.
It's working with Ea III v2e when using keyboard to indicate the tile to attack (the GW attacks first and the unit follows automatically).
However I couldn't even initiate the GW attack with the mouse.

Another point: I'm not sure how building a (weave of Ea) temple is supposed to work? From my game, it's possible to build only on tiles without any resource but not necessarily within my borders.
 
Back
Top Bottom