Civilopedia information dissappeared. [SOLVED]

Rayki

Chieftain
Joined
Nov 19, 2014
Messages
78
Location
Australia
Hey guys, I've attached a copy of my mod to this post as I need a bit of help with a problem I can't for the life of me work out.

At some point during additions I seem to have lost the Civilopedia history for both the Atreides sponsor/house and the units attached to that house. The Leader information all shows and information for every other house and unit shows up. It's only things attributed to The House Atreides excepting the leader.

I've gone over this stuff a 100 times if not 1000 and I can't seem to find the problem, I'm putting it down to inexperience at this point and hoping someone with a bit more time in the field can have a quick skim over and point out my noob mistake. :)

I can keep developing the mod without this fixed but hell it's a scar on my professionalism and I do not like that...Not at all...
 

Attachments

Appears to be a bug in the Civilopedia

The standard civs do NOT have unique units (they only use the Civilization_UnitClassOverrides to deny building alien units) so Firaxis have never hit this.

If you assign a civ a UU, the pedia tries to display an icon for it, but the icon atlas fields (IconAtlas and PortraitIndex) have been removed from the Units table - but the pedia code still thinks they're there

Code:
-- list of UUs
g_UniqueUnitsManager:DestroyInstances();
buttonAdded = 0;
for thisOverride in GameInfo.Civilization_UnitClassOverrides( condition ) do
	if thisOverride.UnitType ~= nil then
		[COLOR="red"][B]local thisUnitInfo = GameInfo.Units[thisOverride.UnitType];[/B][/COLOR]
		if thisUnitInfo then
			local thisUnitInstance = g_UniqueUnitsManager:GetInstance();
			if thisUnitInstance then
				 local textureOffset, textureSheet = IconLookup( [COLOR="red"][B]thisUnitInfo.PortraitIndex[/B][/COLOR], buttonSize, [B][COLOR="Red"]thisUnitInfo.IconAtlas[/COLOR][/B] );

The only reason the other Houses work, is because the unit overrides are incorrect (check the database.log file)

Code:
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "ECAZ_MILITIA" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "FENRING_CORSAIRS" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "HARKONNEN_TROOPERS" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "MORITANI_WARRIORS" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "RICHESE_GUARD" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "TLEILAXU_DANCERS" does not exist in Units
[10138.598] Invalid Reference on Civilization_UnitClassOverrides.UnitType - "VERNIUS_PATROL" does not exist in Units

as soon as you fix those to point to actual units, the pedia will stop working for all houses
 
BTW

Code:
DELETE FROM Civilizations 	
WHERE Type IN(
  'CIVILIZATION_RUSSIA',
  'CIVILIZATION_BRASILIA',
  'CIVILIZATION_AFRICAN_UNION',
  'CIVILIZATION_ARC',
  'CIVILIZATION_PAN_ASIA',
  'CIVILIZATION_KAVITHAN',
  'CIVILIZATION_FRANCO_IBERIA',
  'CIVILIZATION_POLYSTRALIA'
);

but personally I'd do this in XML

Code:
<GameData>
  <Civilizations>
   <Delete Type="CIVILIZATION_RUSSIA"/>
   <Delete Type="CIVILIZATION_BRASILIA"/>
   <Delete Type="CIVILIZATION_AFRICAN_UNION"/>
   <Delete Type="CIVILIZATION_ARC"/>
   <Delete Type="CIVILIZATION_PAN_ASIA"/>
   <Delete Type="CIVILIZATION_KAVITHAN"/>
   <Delete Type="CIVILIZATION_FRANCO_IBERIA"/>
   <Delete Type="CIVILIZATION_POLYSTRALIA"/>
  </Civilizations>

  <DeleteMissingReferences table="Civilizations" column="Type"/>
</GameData>

as you can then use the <DeleteMissingReferences> tag to tidy up all the related tables - and it's all then in one file
 
Whoward69: Mate you're a gem, I think I read something about that unitclassoverides but didn't understand what was meant, now it's all clear, along with a better way to code this stuff out and that is just priceless, gonna be making some changes. :D

So just a minor question now, is there a way to make unique units faction specific at all?

Edit: Nevermind noob question there, of course it would, just remove the unitclassoverides which attempt to replace the default unit with a unique unit, since the ones which spawn at game start are the defaults anyway it only needs to affect new units and therefore no classes need be over-written, just made unavailable by a null override. ;)

Edit: LoL to the other house units, I forgot I changed their unitclass back to marine to narrow it down to just one thing as I was sure it was a class problem that caused it, I was close...sorta. lol :)

BTW, it's all working now, and a little quicker too which surprised me, guess without all the errors and that little code refinement it's easier on the system lol. :)
 
Back
Top Bottom