1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[SOLVED!] Custom civilization lacks unique bonuses, background art, and icons

Discussion in 'Mod Creation Help' started by SpaceCommunist, Aug 25, 2017.

  1. SpaceCommunist

    SpaceCommunist Warlord

    Joined:
    Apr 11, 2016
    Messages:
    119
    Gender:
    Male
    Location:
    Malachor V
    Basically it's all in the title. I've been working on a civ but there are issues with both the civ's abilities and artwork. I'm using Josh's Custom Civ template as a reference. I'm fully aware that there are problems with the template itself, however, and have done what is suggested elsewhere to work around it - but more on that later.

    So I do actually use custom artwork for this mod (excluding the improvement, which, aside from not being able to build it as the civ's unique, has surprisingly been no trouble at all), but the only bit of it that shows up is the leader portrait (the image of the leader on the left-hand side of the screen when you select your civ/leader) and the leader's diplomacy image. Otherwise, there are either ?'s for the icons or just plain black screens elsewhere, despite having artwork dedicated towards them.

    As for the uniques themselves, I have them fully coded, and have managed to prevent any crash-to-main-menu bugs through development. But strangely, the custom civ doesn't actually have the uniques available to it at all - in the loading screen, below the DoM text, there's just...nothing. And the bonuses are available in-game either, understandably.

    I've checked the Database.txt, and this is all that comes up:

    I really don't know what else to do. Maybe one of y'all can figure out what the issue is?
     

    Attached Files:

  2. Toussaint10326

    Toussaint10326 Chieftain

    Joined:
    Jul 28, 2017
    Messages:
    84
    Gender:
    Male
    Location:
    United States
  3. Toussaint10326

    Toussaint10326 Chieftain

    Joined:
    Jul 28, 2017
    Messages:
    84
    Gender:
    Male
    Location:
    United States
    In fact, all you really need to do is replace your ModArt.xml with the one I provide with that template, and replace SCRN and SHIRA_CUSTOM with your tags.
     
  4. SpaceCommunist

    SpaceCommunist Warlord

    Joined:
    Apr 11, 2016
    Messages:
    119
    Gender:
    Male
    Location:
    Malachor V
    Thanks for the help so far.

    I created a new mod from scratch using that template, and so far it's been a "one step forward, two steps back" situation. I managed to get the icons and most of the other artwork functioning properly, however it's started crashing to the desktop during the loading screen. I have no idea if this has to do with the artwork (likely not, as I've done everything I can think of regarding it so that it should match perfectly with the code and the template) or the code itself.

    Speaking of which, the uniques still don't attach to the civilization. At all. And now I'm having to deal with crashes.

    Here's the Database.txt again:

    For simplicity's sake, I haven't changed the Unit/Building files (aside from removing the second Unit template altogether) and haven't added in the original Improvement file in any way. Yet, the same issues I had with my Improvement file (the "Uniques.xml" one) seems to appear again with Units.xml and Buildings.xml - specifically, that "Types" doesn't appear to exist (???). Furthermore, the same issue as in the first post's Database.txt report appears again, without any details to explain it: apparently some ModifierIds are just flat out failing with no explanation to them. The only ones I can think of are the ones for the Leader trait and the Civilization trait, both within the same file (GameDefines.sql). Yet, I've tinkered with them all I can, and still nothing changes.

    But now there's this new crash-to-desktop issue, and I haven't got a clue what to do about it.

    Here's a link to the current build.
     
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,633
    Location:
    Illinois, USA
    You are getting these errors
    Code:
    [499618.128] [Configuration] ERROR: no such table: Types
     [499618.128] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
     [499618.128] [Configuration]: In XMLSerializer while updating table Types from file Template_Buildings.xml.
     [499618.129] [Configuration] ERROR: no such table: Types
     [499618.130] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
     [499618.130] [Configuration]: In XMLSerializer while updating table Types from file Template_Units.xml.
    because the code within files Template_Buildings.xml and Template_Units.xml is wrong for the <FrontEndActions> (Configuration) database.

    Most of these templates I see floating around have this basic and fundamental file-usage error of attempting to load code that does not belong in the FrontEndActions database into the FrontEnd. While this does not actually hurt anything in nearly all cases it certainly kludges up the database.log file with meaningless error messages that inexperienced modders then attempt to chase down or are utterly confused by. It also teaches bad habits in that inexperienced modders might tend to believe anything can be chucked in anywhere that has an <UpdateDatabase> type of action in ModBuddy and the modinfo file. But this will cause a cascading error effect if you place something in the InGame or FrontEnd that does not belong there along with needed mod code that does belong in the database to which the file is being loaded.

    This file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Configuration\Data\Schema/AdditionalTables.sql lists every table and its correct columns for everything that belongs in a file loaded via a <FrontEndActions> <UpdateDatabase> action. Table "Types" does not appear within the list for the FrontEnd.

    This file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\Schema/01_GameplaySchema.sql lists every table and its correct columns for everything that belongs in a file loaded via a <InGameActions> <UpdateDatabase> action. Table "Types" does appear within the list for the InGame.

    In Database.log an error message with:
    [Configuration]: at the beginning
    means the file where the error occured was being loaded into the <FrontEndActions>​
    [Gameplay]: at the beginning
    means the file where the error occured was being loaded into the <InGameActions>​

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

    also for whatever reason your link to the current build won't allow me to get to the download without signing in to dropbox, which seems strange since I both have a dropbox account and you usually don't have to sign in to dropbox just to download a file (even though they try to get you to sign up for dropbox)
     
  6. SpaceCommunist

    SpaceCommunist Warlord

    Joined:
    Apr 11, 2016
    Messages:
    119
    Gender:
    Male
    Location:
    Malachor V
    That's weird what dropbox is doing. Not sure why that is, but hey, as long as it's able to be downloaded...

    So! With a bit of tinkering, I've gotten rid of the crash-while-loading problem. I believe the problem was related to the ART_LEADER_[name] file being referenced in the Leaders.artdef file, so I put in ART_LEADER_MONTEZUMA just as a backup in case the ART_LEADER_SC_TUSKALOOSA file doesn't work (which it does now, as it's referenced in GameDefines.sql).

    That only leaves one problem, which is the one that's consistently popped up in Database.txt. I took what you suggested, Lee, and removed the Buildings.xml and Units.xml out of the FrontEnd area, if only for the sake of cluttering up the area. Now Database.txt only shows the one final issue:

    As it stands, the ModifierId issue appears to be what's wrong here. The only place where I've consistently used Modifiers in all builds of the mod is GameDefines.sql, so I narrowed it down to two areas: the Leader trait and the Civilization trait. So with a bit of tinkering, I temporarily removed both traits' Modifiers and just left them as empty traits with no function. The problem disappeared and the uniques attached to the civ when I did that, confirming that the problem lies with them. I repeated this process again and only removed the Civilization trait's modifiers, and again the results were the same - the uniques attached to the civ just fine. For a third time I built the mod but added back the Civilization trait's modifiers, but this time, the above error appeared once again, confirming that this is in fact an issue with the Civilization trait's modifiers.

    Going from that, there's only one thing that makes the Civilization trait's modifiers stand out from the rest - in that I am using a custom modifier (the coding to create it is at the bottom of the GameDefines.sql file) to grant an adjacency bonus to districts based on adjacent terrain types (in this case, Hills). I based it off the coding used in Sukritact's Ethiopia mod (Ethiopia's civ bonus grants faith to City Centers based on adjacent Hills and Mountains) - and as far as I can tell, there's nothing different between the two codes that should make the custom modifier work in that mod and not mine.

    Once again, here's a link to the current build. To look for what I'm talking about in regards to the custom modifier, just CTRL+F "MODIFIER_SC_PLAYER_CITIES_TERRAIN_ADJACENCY" in Template_GameDefines.sql (the one in the Core Files, not Temporary Files).
     
  7. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,633
    Location:
    Illinois, USA
    You are attempting to use the same ModifierId in table Modifiers in more than one row, or you are trying to re-define one that is already assigned in the base game.

    And what I meant with re your dropbox link is that unlike normal you are not able to get past the opening page to the actual download. I think maybe your settings in dropbox are to not allow anyone but dropbox members to access the download. And I can't for the life of me remember what my dropbox password and stuff are since I never sign out, but the page I get does not recognize me as being signed in.
     
    Last edited: Aug 26, 2017
  8. SpaceCommunist

    SpaceCommunist Warlord

    Joined:
    Apr 11, 2016
    Messages:
    119
    Gender:
    Male
    Location:
    Malachor V
    That did the trick! Thank you both so very much for the help, now I'll finally be able to complete this project (and others) without any more major hiccups (at least, none that should be game-breaking :p). Plus, the bonuses for the civ (the ones I've coded in at least) are functioning just as I'd like them to!

    And on the dropbox issue, yeah I'll have to check and see if my sharing settings are locked to certain users. Last I checked it was public/free use, but things can always change I suppose.

    Once again, thank you both very much!
     

Share This Page