Civilization trait not appearing in loading or diplomatic screen

ChrisWJN

Chieftain
Joined
Mar 12, 2019
Messages
43
Location
Canada
I use the same template for all civs that I make, and I've never had this issue before. Does anyone have any idea as to what potential missing code could cause this to happen?
 
As is always the case the first answer to such a question is: "Check Database.log and Modding.log for error-messages"
The second answer is always: "Without the mod to look at there is no good way to answer such a question other than the previous answer"
 
As is always the case the first answer to such a question is: "Check Database.log and Modding.log for error-messages"
The second answer is always: "Without the mod to look at there is no good way to answer such a question other than the previous answer"
I would've posted some of the code if I knew what to even post. I don't even know what the game references to display the traits in the diplo and loading screens. I know the LocalizedText is working because referencing it in the config section works fine. I don't see anywhere in my gamedefines that would affect what is displayed in the loading and diplo screens. I checked both log files and nothing seems to be out of the ordinary. What code would you recommend posting?
 
The mod itself. Zipped and attached to a forum post. Or else a link to a file sharing site where the mod can be downloaded if it is too large for the forum to accept as a zip attachment to a post.
 
Alright, I've archived the folder and uploaded it. Thanks for all the help.
 

Attachments

  • CWJN's Aldmeri Dominion.rar
    8.7 MB · Views: 84
Does it make a difference? What I uploaded has every file used to make the mod anyways, fully viewable. Regardless, here is the mod once compiled.
 

Attachments

  • CWJN's Aldmeri Dominion.rar
    13.4 MB · Views: 94
It's my understanding that the config file loaded as a FrontEnd Action is presumably the one which defines all the information displayed about the civ in those screens.

Leader_Config.sql
Code:
-----------------------------------------------
-- Players (Gathering Storm)
-----------------------------------------------

INSERT INTO Players (Domain, CivilizationType, CivilizationName, CivilizationIcon, CivilizationAbilityName, CivilizationAbilityDescription, CivilizationAbilityIcon, LeaderType, LeaderName, LeaderIcon, LeaderAbilityName, LeaderAbilityDescription, LeaderAbilityIcon, Portrait, PortraitBackground)
VALUES    (  
        -- Civilization
        'Players:Expansion2_Players', -- Domain
        'CIVILIZATION_WINGARDE', -- CivilizationType
        'LOC_CIVILIZATION_WINGARDE_NAME', -- CivilizationName
        'ICON_CIVILIZATION_WINGARDE', -- CivilizationIcon
        'LOC_TRAIT_CIVILIZATION_EMERALD_PARADISE_NAME', -- CivilizationAbilityName
        'LOC_TRAIT_CIVILIZATION_EMERALD_PARADISE_DESCRIPTION', -- CivilizationAbilityDescription
        'ICON_CIVILIZATION_WINGARDE', -- CivilizationAbilityIcon
      
        -- Leader
        'LEADER_ALPHONSE_II', -- LeaderType
        'LOC_LEADER_ALPHONSE_II_NAME', -- LeaderName
        'ICON_LEADER_ALPHONSE_II', -- LeaderIcon (Portrait)
        'LOC_TRAIT_LEADER_IMPERIAL_CONSOLIDATOR_NAME', -- LeaderAbilityName
        'LOC_TRAIT_LEADER_IMPERIAL_CONSOLIDATOR_DESCRIPTION', -- LeaderAbilityDescription
        'ICON_LEADER_ALPHONSE_II', -- LeaderAbilityIcon
        'LEADER_ALPHONSE_II_NEUTRAL', -- Portrait
        'LEADER_ALPHONSE_II_BACKGROUND' -- PortraitBackground
        );

-----------------------------------------------
-- PlayerItems (Gathering Storm)
-----------------------------------------------

INSERT INTO PlayerItems
        (Domain,                         CivilizationType,             LeaderType,             Type,                             Icon,                                 Name,                                     Description,                                 SortIndex    )
VALUES    ('Players:Expansion2_Players',    'CIVILIZATION_WINGARDE',    'LEADER_ALPHONSE_II',    'UNIT_WINGARDE_GREENCOAT',        'ICON_UNIT_WINGARDE_GREENCOAT',        'LOC_UNIT_WINGARDE_GREENCOAT_NAME',        'LOC_UNIT_WINGARDE_GREENCOAT_DESCRIPTION',        10        ),
        ('Players:Expansion2_Players',    'CIVILIZATION_WINGARDE',    'LEADER_ALPHONSE_II',    'UNIT_WINGARDE_LANZENREITER',    'ICON_UNIT_WINGARDE_LANZENREITER',    'LOC_UNIT_WINGARDE_LANZENREITER_NAME',    'LOC_UNIT_WINGARDE_LANZENREITER_DESCRIPTION',    20        ),
        ('Players:Expansion2_Players',    'CIVILIZATION_WINGARDE',    'LEADER_ALPHONSE_II',    'BUILDING_IMPERIAL_COLLEGE',    'ICON_BUILDING_IMPERIAL_COLLEGE',    'LOC_BUILDING_IMPERIAL_COLLEGE_NAME',    'LOC_BUILDING_IMPERIAL_COLLEGE_DESCRIPTION',    30        );
 
I am confused. I unzipped the built mod and ran it. The Civ/leader ability appear on the loading screen and when I select myself to look at on the diplomacy screen by clicking on my own icon when playing as Ayrenn Arana Aldmeri so far as I am able to determine.

The text for LOC_CWJN_TRAIT_AYRENN_DESCRIPTION appears where it ought to. I am seeing this in both the FrontEnd and the InGame loading screens as well as on the Diplo screen
Code:
Happy cities gain +5%[ICON_PRODUCTION]Production. Ecstatic cities gain +15%[ICON_PRODUCTION]Production. All units can move through woods and jungle without movement penalties. Cannot establish domestic [ICON_TRADEROUTE]Trade Routes. International [ICON_TRADEROUTE]Trade Routes provide +1[ICON_FOOD]Food, +1[ICON_PRODUCTION]Production, and +1[ICON_SCIENCE]Science.
However:

  1. File BoringText.sql] appears to have a syntax error (most likely an accidently deleted comma or text-string delimiter) as evidenced by these errors in Database.log
    Code:
    [2930250.826] [Localization] ERROR: near "'en_US'": syntax error
    Which by its very nature is reporting an error with an SQL file, and the only close timestamp in Modding.log is
    Code:
    [2930250.825] LocalizedText - Loading Text/BoringText.sql
    [2930250.826] Warning: LocalizedText - Error Loading SQL.
  2. Database.log is reporting this error
    Code:
    [2930358.041] [Localization] ERROR: near "'en_US'": syntax error
    Which tracks to this timestamp in Modding log
    Code:
    [2930358.041] LocalizedText - Loading Text/BoringText.sql
    [2930358.041] Warning: LocalizedText - Error Loading SQL.
    Which would actually be the second time the file is enacted into the game's Localization Database (ie, the InGmeActions).
  3. Database.log is reporting this error
    Code:
    [2930363.217] [Gameplay] ERROR: near "where": syntax error
    Which tracks to this error-record in Modding.log
    Code:
    [2930363.217] UpdateDatabase - Loading Core/Resources.sql
    [2930363.217] Warning: UpdateDatabase - Error Loading SQL.
    This means the Resources.SQL must have the syntax error. We know in this case it is not an issue with a FrontEndActions file since the message-leader in Database.log is "[Gameplay]"
    • The code here is in fact not correct
      Code:
      update Resources 
      set Frequency = 3,
      where ResourceType = RESOURCE_FURS;
      The code ought to be
      Code:
      update Resources 
      set Frequency = 3
      where ResourceType = 'RESOURCE_FURS';
 
And oh btw [ICON_PRODUCTION] etc are incorrect.
Code:
[ICON_Science]
[ICON_Amenities]
[ICON_Housing]
[ICON_Faith]
[ICON_Culture]
[ICON_Production]
[ICON_Gold]
[ICON_Food]
As a General rule Yields and "Yield-Like" icon text strings use lower-case after the underscore. Whereas for resources and other game elements the convention of "[ICON_RESOURCE_MARBLE]" applies. In many cases this will not make any real difference, but in other cases the incorrect usage of upper/lower case will have an effect on how the game displays an in-game text string.
 
LOC_CWJN_TRAIT_AYRENN_DESCRIPTION works as normal, displaying in both the loading and diplo screens. However, LOC_CWJN_TRAIT_ALDMERI_DESCRIPTION does not show in the loading or diplo screens, even though it should.
 
Traits
Code:
insert into Types (Type, Kind)
values ('CWJN_TRAIT_ALDMERI_UNIT', 'KIND_TRAIT'),
	   ('CWJN_TRAIT_ALDMERI_IMPROVEMENT', 'KIND_TRAIT');


insert into Traits (TraitType, Name, Description)
values  ('CWJN_TRAIT_AYRENN', 'LOC_CWJN_TRAIT_AYRENN_NAME', 'LOC_CWJN_TRAIT_AYRENN_DESCRIPTION'),
  ('CWJN_TRAIT_ALDMERI_UNIT', 'Aldmeri Unit', 'Aldmeri Unit'),
  ('CWJN_TRAIT_ALDMERI_IMPROVEMENT', 'Aldmeri Improvement', 'Aldmeri Improvement'),
		('CWJN_TRAIT_ALDMERI', 'LOC_CWJN_TRAIT_ALDMERI_NAME', 'LOC_CWJN_TRAIT_ALDMERI_DESCRIPTION');
Unit
Code:
insert into Units (UnitType, Name, BaseSightRange, BaseMoves, Combat, RangedCombat, Range, Bombard, Domain, FormationClass, Cost, Description, CanCapture, TraitType, CostProgressionModel, PromotionClass, PrereqTech, PurchaseYield, Maintenance, ZoneOfControl, AdvisorType, StrategicResource)
values  ('CWJN_UNIT_GILDED_ARCHER', 'LOC_CWJN_UNIT_GILDED_ARCHER_NAME', '2', '2', '65', '75', '2', '0', 'DOMAIN_LAND', 'FORMATION_CLASS_LAND_COMBAT', '510', 'LOC_CWJN_UNIT_GILDED_ARCHER_DESCRIPTION', 1, 'CWJN_TRAIT_ALDMERI_UNIT', 'NO_COST_PROGRESSION', 'CWJN_PROMOTION_CLASS_ELF', 'TECH_CHEMISTRY', 'YIELD_GOLD', '4', 0, 'ADVISOR_GENERIC', 'RESOURCE_NITER');
Improvement
Code:
insert into Improvements (ImprovementType, Name, Description, Icon, PlunderType, PlunderAmount, Buildable, PrereqTech, TraitType, Housing)
values	('CWJN_IMPROVEMENT_BOSMER_CAMP', 'LOC_CWJN_IMPROVEMENT_BOSMER_CAMP_NAME', 'LOC_CWJN_IMPROVEMENT_BOSMER_CAMP_DESCRIPTION', 'ICON_CWJN_IMPROVEMENT_BOSMER_CAMP', 'PLUNDER_GOLD', '50', 1, 'TECH_ANIMAL_HUSBANDRY', 'CWJN_TRAIT_ALDMERI_IMPROVEMENT', '0');
Civilization
Code:
insert into	CivilizationTraits (TraitType, CivilizationType)
values ('CWJN_TRAIT_ALDMERI', 'CWJN_CIV_ALDMERI');

insert into	CivilizationTraits (TraitType, CivilizationType)
values ('CWJN_TRAIT_ALDMERI_IMPROVEMENT', 'CWJN_CIV_ALDMERI');

insert into	CivilizationTraits (TraitType, CivilizationType)
values ('CWJN_TRAIT_ALDMERI_UNIT', 'CWJN_CIV_ALDMERI');
The problem is that you have too much piled directly onto the same Trait that is directly attached to the civ, which confuses the code of the lua User Interface files that control what is displayed on the InGame loading screen and the diplomacy screen.

If you look at the way Firaxis does this to avoid these issues, Unique Units are usually assigned to a trait that is specific for the Unique Unit, Unique Buildings to a trait that is specific for that Unique Building, etc. These specific and "sandboxed" traits are then attached to the appropriate Leader or Civilization, in addition to the main trait of the Leader or Civilization.

Separating out the three "trait" elements into discreet traits for the Civilization main trait, the unit trait and the improvement trait solves the problem with the text for the main trait of the civilization not being displayed.

So far as I know there is no difference in the way the game implements actual gameplay between the two methods of attaching unique units, building, improvements, etc. -- it is entirely a User Interface issue.

You'll note I used the cheap and dirty method of directly stating the text in the 'Traits' table, but you'll probably want to add a proper LOC_KEY reference and rename the traits I used as you would want to conform more closely to the usual method for naming traits and whatnot that you usually use.
 
This doesn't really apply to the thread topic, but I've been plagued with this bug for quite a while.
It seems that when I build my mod in modbuddy, the game doesn't register the new version for some period of time, not entirely sure how long. Sometimes it's instant, sometimes it can be a few hours. I have no idea what causes it, it just started happening one day. Perhaps a bug with an update? Does this happen to anyone else?
 
I've never experienced that particular issue. Whenever I've built a new version of a mod it always seems to get instantly implemented when I then start the game and run the new version of the mod.

That being said, there are caching issues with Civ6 when one does not completely exit the game and essentially start with a new slate. But this usually only seems to apply to altering items that are enabled in the additional content menu and usually this has only seemed to apply on the pregame (ie, FrontEnd) side of the game. There do not appear to be any hidden files within the "Cache" directory where the Configuration, Gameplay, and Localization "debug" SQLite files are stored. But since these are merely copies of the actual databases used by the game, there are probably more files with cached data located in a normally inaccessible location. I have not attempted to determine which folder (if any) the "real" versions of the cache and the databases are held in, or even if there held in any folder as opposed to stored within the savegame file or some other type of file we as modders would never be able in a normal circumstance to access.

Be sure to always completely exit the game when operating in Modbuddy. Otherwise there's no real advice to offer other than manually navigating to the cache folder at
Code:
C:\Users\UserName\Documents\My Games\Sid Meier's Civilization VI\Cache
and deleting the three SQLite database files located there. You cannot hurt anything by doing so since they are always reconstructed anyway when the game is started up and when you start a new game or reload an existing save.
 
Top Bottom