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

Adding custom loading and diplomacy screens for a Civilization

Discussion in 'Civ6 - Modding Tutorials & Reference' started by Gedemon, Jan 27, 2017.

  1. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    Nope... Cleo is in the diplo screen as well, with Harald looking on.

    Like I said... bedtime now. I will revisit with fresh eyes tomorrow.
     
  2. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    Back at it... the lua seems to be loading. Here is the relevant part of the lua.log. The only part giving me pause is that it does not say Denmark_InGame.lua at the end of the InGame UI line.

    Code:
    InGame: Loading InGame UI - C:/Users/doms/Documents/My Games/Sid Meier's Civilization VI/Mods/Denmark/Data/Denmark/Denmark_InGame
    Name, Creation, Register Libs, Register Controls, Load, Show/Hide, Total
    Denmark_InGame, 1416, 152401, 1016, -15849, -20048, 118936
    I have checked repeatedly for spelling errors and such. My lua file is exactly the same as the one you gave (except for a commented out portion):

    Code:
    -- To get rid of default leader screens
    
    function HideLeaderHead()
        ContextPtr:LookUpControl("/InGame/DiplomacyActionView/LeaderAnchor"):SetHide(true)
    end
    
    function OnEnterGame()
        ContextPtr:LookUpControl("/InGame/DiplomacyActionView/LeaderAnchor"):RegisterWhenShown(HideLeaderHead)
    end
    Events.LoadScreenClose.Add(OnEnterGame)
    Yet, I still get the Cleo-Harald mixed diplo screen.

    PS I am getting an error in the Modding log and cannot see Denmark_InGame.xml being loaded in this section although it is loading in <Files>

    Code:
    [3882680.707] Status: Applying Component - DENMARK_CIV_Component
    [3882680.708] Status: Creating database save point.
    [3882680.708] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Agendas.xml.xml
    [3882680.708] Warning: UpdateDatabase - Error Loading XML.
    [3882680.708] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Buildings.xml
    [3882680.811] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Civilizations.xml
    [3882680.836] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Colours.xml
    [3882680.856] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Gossip.xml
    [3882680.861] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Leaders.xml
    [3882680.866] Status: UpdateDatabase - Loading Data/Denmark/Denmark_PlayerColours.xml
    [3882680.869] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Units.xml
    [3882680.875] Status: UpdateDatabase - Loading Data/Denmark/Denmark_GamePlay.xml
    [3882680.876] Status: Successfully released save point.
    [3882680.876] Status: Applied component to game.
    [3882680.877] Status: Applying Component - DENMARK_CIV_Import
    [3882681.125] Status: Applied component to game.
    [3882681.126] Status: Applying Component - DENMARK_CIV_Import
    [3882681.127] Status: Applied component to game.
    [3882681.127] Status: Applying Component - DENMARK_CIV_Text_Component
    [3882681.128] Status: Creating database save point.
    [3882681.128] Status: LocalizedText - Loading Data/Denmark/Denmark_Text.xml
    [3882681.157] Status: Successfully released save point.
    [3882681.157] Status: Applied component to game.
    [3882681.218] Status: Modding Framework - Finished Apply Components
    [3882681.218] Status: Applied all components of enabled mods.
    The StartUp log may have an error... I cannot really tell. It appears there is no START the InGame or Denmark_InGame section. Not certain what I should see here...

    Code:
    END    LuaContext::Initialize() id: 'TopOptionsMenu'
    START  LuaContext::Initialize() id: ''        parent: 'NULL'        Context: 'NULL'
    END    LuaContext::Initialize() id: 'Denmark_InGame'
    END    LuaContext::Initialize() id: 'InGame'
    START  LuaContext::Initialize() id: ''        parent: 'NULL'        Context: 'NULL'
    I am going to give the UseInterface component and id such as:

    Code:
    <UserInterface id="DENMARK_CIV_UserInterface">       
                <Properties>
                    <Context>InGame</Context>
                </Properties>
                <Items>
                    <File>Data/Denmark/Denmark_InGame.xml</File>
                </Items>
            </UserInterface>
    That may make things easier to track.
     
    Last edited: Jan 28, 2017
  3. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    The error in the Modding log was unrelated and I have corrected it ( a double xml.xml at he end of the Agenda file name.)

    The id being added shows that the UserInterface component is being applied (although there is no file name... not certain if there should be or not).

    Here is another copy of the log (the error hadn't been corrected as yet, but is irrelevant, I think):

    Code:
    [3885452.003] Status: Applying Component - DENMARK_CIV_Icons_Component
    [3885452.004] Status: Icons - Loading Data/Icons/DEN_Icons_Buildings.xml
    [3885452.004] Status: Icons - Loading Data/Icons/DEN_Icons_Civilizations.xml
    [3885452.004] Status: Icons - Loading Data/Icons/DEN_Icons_Leaders.xml
    [3885452.005] Status: Icons - Loading Data/Icons/DEN_Icons_UnitFlags.xml
    [3885452.005] Status: Icons - Loading Data/Icons/DEN_Icons_UnitPortraits.xml
    [3885452.005] Status: Icons - Loading Data/Icons/DEN_Icons_Units.xml
    [3885452.006] Status: Applied component to game.
    [3885452.006] Status: Applying Component - DENMARK_CIV_ModArt_Component
    [3885452.007] Status: ModArtLoader - Loading Denmark_Civilization.dep
    [3885452.007] Status: Applied component to game.
    [3885452.007] Status: Applying Component - DENMARK_CIV_Component
    [3885452.008] Status: Creating database save point.
    [3885452.008] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Agendas.xml.xml
    [3885452.008] Warning: UpdateDatabase - Error Loading XML.
    [3885452.009] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Buildings.xml
    [3885452.038] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Civilizations.xml
    [3885452.052] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Colours.xml
    [3885452.073] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Gossip.xml
    [3885452.075] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Leaders.xml
    [3885452.080] Status: UpdateDatabase - Loading Data/Denmark/Denmark_PlayerColours.xml
    [3885452.081] Status: UpdateDatabase - Loading Data/Denmark/Denmark_Units.xml
    [3885452.087] Status: UpdateDatabase - Loading Data/Denmark/Denmark_GamePlay.xml
    [3885452.088] Status: Successfully released save point.
    [3885452.088] Status: Applied component to game.
    [3885452.088] Status: Applying Component - DENMARK_CIV_Import
    [3885452.208] Status: Applied component to game.
    [3885452.208] Status: Applying Component - DENMARK_CIV_UserInterface
    [3885452.209] Status: Applied component to game.
    [3885452.209] Status: Applying Component - DENMARK_CIV_Text_Component
    [3885452.210] Status: Creating database save point.
    [3885452.210] Status: LocalizedText - Loading Data/Denmark/Denmark_Text.xml
    [3885452.213] Status: Successfully released save point.
    [3885452.213] Status: Applied component to game.
    [3885452.245] Status: Modding Framework - Finished Apply Components
    [3885452.245] Status: Applied all components of enabled mods.
    I feel I am at a dead end at the moment. Nice to find and correct an error that I did not know about though.
     
  4. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    OK my brain is finally working good again.

    There is clearly something missing if just trying to edit a already existing civ, In my case just trying to change the leader screen for roosevelt.
    I guess it is something to do with updating civilization_america but honestly I have other more pressing issues to deal with atm, and haven't messed with it much since my last post.

    I'm doing this as an exercise in a minimod that is literally only those 3 files, the modinfo file, and 3 art files, before I import the whole thing into a real mod. And with virtually exactly what you typed, it doesn't work.

    I checked on my dds file perhaps not having alpha or whatever (since my last post i have downloaded and installed plugins for paint.net and irfanview (i was previously just using gimp with plugins), and I remade both larger dds files appropriately, and still the exact same thing.

    To recap, I don't see Roosevelt in the loading screen, just the generic world map background, so I can confirm dom_blank is working yet dom_america is not, they are loaded in the exact same manner and syntax. america_scene is not working either, just all black, yet my lua is without a doubt working, because I don't see Cleopatra anymore....

    Very strange indeed.

    Firaxis should slap themselves for even saying this is the most moddable civilization yet. This was 10x easier in civ4.
     
  5. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    I feel your pain. It will be very moddable once I figure out what's wrong with my .lua loading. That's the only thing I haven't figured out. I am worried because Harald Bluetooth seems to be looking more and more lasciviously at Cleopatra as time goes on... he looks like a stalker.

    I have gone over and over the files. The only thing I can think of might be load order... I am going to jumble things up a bit and see.
     
  6. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    yea my eyes are burning I've looked at these same 3 files over and over lol.

    I merged this whole thing into my confederate civilization mod and still have the same issue with it as well... other than i see cleopatra where the scene would be on my first launch. I'm gonna see if i messed something up and can get her to disappear like i have in the minimod.

    edit: ok i got confederate civ mod exactly like the minimod now, no cleopatra, same issues.

    It occured to me, my lua is working, your images are working, maybe we do do some file swapping craig, between the 2 of us we have it working, but individually neither of us do.
     
    Last edited: Jan 29, 2017
    Craig_Sutter likes this.
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,921
    Location:
    France
    I've attached to the OP a small example mod with only 2 leaders (America & France), each with the same loading screen (Atlas from the Civ6 cover) and a specific diplomatic screen.

    It's working on my side (screens shown, Cleopatra and Theodore hidden), let me know for you.
     
  8. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    edit: lol I didn't read clearly you used the atlas at first

    Thanks a bunch!

    edit: I finally had my eureka moment lol
    Spoiler :





    It appears the entire time I was doing it right, my dds files still were not made correctly it appears. I could tell something was wrong when your images showed full previews in the file folder and mine were just showing little irfanview logo's.

    Its probably just easier to use your file and just paste over it using paint.net at this point (I just copied directly from a jpg pasted into your dds after I cropped it and it worked), until I go through some dds tutorial again, because it's been so long.
     
    Last edited: Jan 29, 2017
    Gedemon likes this.
  9. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    You likely either did not have an alpha layer... or you forgot to merge all the layers before saving to .dds.
     
  10. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    Yea its weird. I thought I only had 1 layer and added alpha but apparently alpha was not set to white or whatever the BG color was. Oh well, I have a few functional dds files now that I can just use as a template even if I never find an appropriate dds tutorial.
     
    Last edited: Jan 30, 2017
  11. ArcticOcean

    ArcticOcean Chieftain

    Joined:
    Jul 31, 2013
    Messages:
    31
    Location:
    Berlin
  12. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    that looks very nice indeed!
     
  13. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,299
    Location:
    Washington, DC
    So, in all honesty I didnt read all of this so I apologize if this has been addressed. But does this mean I could create a Byzantine civ, for example, using the wooden bust from the Viking scenario as the leader?

    Or to get more complicated, an Ottoman civ using the Andalus wooden bust from the Viking scenario while using the Janissary unit from the Poland scenario?
     
  14. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,049
    Location:
    London, UK
    Awesome work Gedemon. I had a feeling it must be possible after the last update and DLC.
     
  15. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,049
    Location:
    London, UK
    See the file Leaders.artdef in the VikingsScenario and the entry for LEADER_HARDRADA. This effectively stubs out the 3D artwork with nothing so that the FallbackLeaders.artdef is used instead.

    I've added a Leaders.artdef in my Hooves and Holy War submod to reinstate the 3D Hardrada so I'm assuming that the reverse would work OK.

    Edit: Seems like @ArcticOcean has already figured this all out. :goodjob:
     
    Last edited: Feb 1, 2017
  16. DavDarkelf

    DavDarkelf Chieftain

    Joined:
    Nov 28, 2016
    Messages:
    76
    Gender:
    Male
    Are there any good tutorials on creating dds files. On the loading screen my background image shows up fine. But the foreground image is showing a load of distorted lines.
    I'm almost certain it's how I created the dds file that is the problem.
     

    Attached Files:

  17. ArcticOcean

    ArcticOcean Chieftain

    Joined:
    Jul 31, 2013
    Messages:
    31
    Location:
    Berlin
    I'm using gimp with a DDS pugin here. (one layer only, no compression, default format an no mipmaps)
     
  18. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    Me also... make certain that all the visible layers are merged into one. And that you have an alpha channel.
    Paint.net also saves to DDS. But I find it less comfortable to use than Gimp.
     
  19. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,719
    Gender:
    Male
    Location:
    Seoul, South Korea
    I think in the Civ 5 utilities, there is a dds utility... it is for Civ 5 but might serve for Civ 6... not certain of that though.
     
  20. DavDarkelf

    DavDarkelf Chieftain

    Joined:
    Nov 28, 2016
    Messages:
    76
    Gender:
    Male
    Thanks
    I changed from using Paint.Net back to GIMP and the DDS plugin, switched to using a different image for my foreground leader and got it working.
    Also I had problems with some icons but solved that. I think using No Compression might have helped but really not sure. I've never been an artist so using GIMP etc is all new to me!
     

Share This Page