Specialist bug CEP 3.6.2

timbuktu

Warlord
Joined
Aug 12, 2011
Messages
111
Location
Warszawa
I am unable to make citizen work as specialist.
http://speedy.sh/6YTEn/Casimir-III-0038-BC-2480.Civ5Save
These mods are active:
Communitas AI and Tools v 3.6.2
Communitas Enhanced Gameplay v 3.6.1
Communitas Interface v 3.6.1
Communitas Map v 1.3.2

Here you can see situation when 1 citizen is idle but when i click on specialist slot - nothing happens.
http://speedy.sh/hJeHP/2013-11-02-00001.jpg

After clicking on "Unemployed Citizens". You can see that wonders have disappeared.
http://speedy.sh/xAVkq/2013-11-02-00002.jpg

Here is LUA.log: http://speedy.sh/CDnZj/Lua.log
 
Is there any reason why these are not just attached to the post? I really dislike download sites, when they are not needed.
 
Don't know why but i can't attach lua.log :(
So there is only gamesave. Sorry for inconvenience.

Here is the part of lua which contains error:

[14617.687] CET_Events: UpdatePlotYields Start
[14641.671] CityView: FATAL Turn 38 City_GetSpecialistYield specialistID=nil
[14641.687] CityView: stack traceback:
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:60: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:41>
=(tail call): ?
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\YieldLibrary\YieldLibrary.lua:685: in function 'City_GetSpecialistYield'
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:1278: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:744>
=[C]: ?
=[C]: ?
[14641.687] Runtime Error: C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\YieldLibrary\YieldLibrary.lua:691: bad argument #2 to '?' (Key must be of type 'number' or 'string'.)
[14642.843] CityView: FATAL Turn 38 City_GetSpecialistYield specialistID=nil
[14642.843] CityView: stack traceback:
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:60: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:41>
=(tail call): ?
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\YieldLibrary\YieldLibrary.lua:685: in function 'City_GetSpecialistYield'
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:1278: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:744>
=[C]: ?
=[C]: ?
[14642.843] Runtime Error: C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\YieldLibrary\YieldLibrary.lua:691: bad argument #2 to '?' (Key must be of type 'number' or 'string'.)
[14643.750] CityView: FATAL Turn 38 City_GetSpecialistYield specialistID=nil
[14643.750] CityView: stack traceback:
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:60: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\Core\MT_LuaLogger.lua:41>
=(tail call): ?
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Tools\YieldLibrary\YieldLibrary.lua:685: in function 'City_GetSpecialistYield'
C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:1278: in function <C:\Users\Win7\Documents\My Games\Sid Meier's Civilization 5\MODS\Communitas AI and Tools (v 3)\Interface\Bugfixes\CityView.lua:744>
=[C]: ?
 

Attachments

  • Casimir III_0038 BC-2480.Civ5Save
    973.3 KB · Views: 68
This forum only accepts certain types of files, *.log is not one of them. To get around this you can either rename the file to lua.txt or, preferably, place all the files you want to post into a archive, like zip, 7z or rar.

I'll examine further once you provide the full log.

Are you fully patched with regard to Firaxis?

It does look like the rather annoying and recurring yield library bug that sometimes happens. A number of other posts with different incorrect outcomes, culture, science, gold etc. have been posted about this.

Thal has said he is investigating it further to see what can be done. It is in relation to the poor code used in the core game that handles these yields.
 
Thanks for guidance. Lua.log attached.
So, there are no way to fix it at the moment and we have to wait for Thal?
 

Attachments

  • Lua.rar
    3.2 KB · Views: 61
Ahh, yes and no.

There are ways to fix it, it is after all just code.:D
However, no one else on this forum has, so far, been able to nail down the fix.:cry:

So yes, when Thal get's back to it a fix will no doubt follow.

We can but wait.:mischief:
 
Thanks for guidance. Lua.log attached.
So, there are no way to fix it at the moment and we have to wait for Thal?

Do you own both G&Ks and BNW? Are you using the latest patch? Can you verify your local game cache through steam?

Is anybody else able to replicate this problem?
 
We are narrowing down the likely error.

Although the log points to line 691 in the YieldLibrary.lua the actual error may possibly be traced back to CityView.lua where the same function, City_GetSpecialistYield, is called.

It is proving to be quite elusive.
 
Yes, I own G&K and BNW (I play as Poland as you can see). Steam should keep my games up to date so I believe there are latest patch.
This error occurs when I try put a citizen in the artist slot at the palace.
 
Okay, so I was able to replicate the bug by unassigning citizens from their tiles. It seems like the city view screen bugs out when you have any unemployed citizen and will reset if you click on the city tile to reset the tile assignments.

I will look into this further but the palace should not have an artist slot and doesn't appear to have one in your screenshots.

EDIT: It seems like the game considers unemployed citizens to be a form of specialist which doesn't have an iSpecialistID(?) which is why the city view screen causes errors with the City_GetSpecialistYield function in the YieldLibrary.lua.
 
Hmm...
I don't think that is the case. Citizens do have an ID in the Specialists table, it is the first listed item. They have ID = 0.
I think the actual culprit is further along the chain.
 
Working on this project makes me feel like I'm spinning my wheels and going nowhere fast sometimes....

It looks like iSpecialistID was never defined in one of the functions in CAT/Interface/Bugfixes/CityView.lua line 1278:

PHP:
				-- build the tooltip for slackers
				local pSpecialistInfo = GameInfo.Specialists[slackerType];
				local specialistName = Locale.ConvertTextKey(pSpecialistInfo.Description);
				local ToolTipString = specialistName .. " ";						
				-- Culture
				local iCultureFromSpecialist = pCity:GetCultureFromSpecialist(iSpecialistID);
				if (iCultureFromSpecialist > 0) then
					ToolTipString = ToolTipString .. " +" .. iCultureFromSpecialist .. "[ICON_CULTURE]";
				end
				-- Yield
				for pYieldInfo in GameInfo.Yields() do
					local iYieldID = pYieldInfo.ID;
					local iYieldAmount = City_GetSpecialistYield(pCity, iYieldID, iSpecialistID);

The fix is to change that line to the following:
PHP:
					local iYieldAmount = City_GetSpecialistYield(pCity, iYieldID, pSpecialistInfo.ID);

The interesting thing about this bug is that the vanilla iSpecialistID is never defined in the function either. I followed the C++ functions and apparently the following the nil into a valid specialistID:

PHP:
int CvLuaCity::lGetSpecialistYield(lua_State* L)
{
	CvCity* pkCity = GetInstance(L);
	const SpecialistTypes eSpecialist = (SpecialistTypes) lua_tointeger(L, 2);
	const YieldTypes eYield = (YieldTypes) lua_tointeger(L, 3);

	const PlayerTypes ePlayer = pkCity->getOwner();

	const int iValue = GET_PLAYER(ePlayer).specialistYield(eSpecialist, eYield);

	lua_pushinteger(L, iValue);

	return 1;
}

So, yeah. And to top it all off, when I checked the CivUP CityView.lua file, it had this fix already.....
 
I applied the fix at line 1278 and it only helps to have unemployed citizens without error but I still can't make them specialists. Here is savegame and lua.log
 

Attachments

  • single.rar
    869.8 KB · Views: 60
With the greatest delight I attached cityview.lua
Thank You for helping!
 

Attachments

  • CityView.rar
    17.2 KB · Views: 58
I checked the file and you have applied the fix correctly.

Could you describe to me the exact step by step method you used to get this bug so I can replicate it? Have you experienced this issue across multiple saves and multiple different types of specialist slots?

Sorry about the extra work.
 
The simplest way I can descirbe: I start newgame and found a city, next enter to cityscreen and click to working citizen in order to have it unemployed. So far - no bug occurs. And now I want have the artist slot at the palace to be occupied so I click on it but nothing happens. I mean: there is still unemployed citizen and the slot remains empty. The same effect will be if I wait till second citizen comes up and with other kind of specialist ( I've checked for artist and scientist )
 
The palace doesn't have an artist slot. That's a Great Work of Art slot. To "work" that slot you need to:
1) research and build the Artist's Guild
2) work the artist specialist slots in the Guild
3) generate a great artist
4) Use the great artists to generate a great work of art
 
Top Bottom