• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

How to add a new user interface.

Human Crouton

Prince
Joined
Jul 27, 2011
Messages
441
I'm trying to make a new user interface for practice/future knowledge reasons.

All I want to do is add a black rectangle to the bottom center of the screen just so that I know how to add new user interfaces when I have time to brainstorm and mod during my vacation next month.

I've looked at the code of many mods that add user interfaces, and I know about the "AddUserInterfaces" option in Modbuddy, but I just can't get something as simple as a black rectangle to appear. I get an error that won't even allow the game to load it.

Any guidance appreciated. If I'm too vague, please ask for more details and I will answer.

I've been able to mod existing controls, and rules in the game, so I have a decent understanding. I just can't make a mod that adds a simple black box to the main screen.
 
what's in your lua/xml couple of UI files and what's the error message ?
 
Thanks for responding.

I left the question intentionally vague because I think it's more of a mod buddy process error than a coding one. I've been able to edit the xml and lua of mods made by other people, and I've made my own SQL mods, but I can't get my own user interface to work. I'm not sure if I'm missing a piece or file that I need to include to get the "AddUserInterface" InGame action to properly do its work.

But here the details of what I'm doing. This is xml file that I'm trying to test with. I'm basically just trying to get a blank image the size of the minimap to show up on the screen next to the minimap. I don't have any lua because this control doesn't do anything right now.

Code:
<?xml version="1.0" encoding="utf-8"?>
<Context>
    <Container    Size="300,200"        ID="MiniMap" Anchor="L,B"    Offset="500,0" ConsumeMouse="0">
        <Image ID="TestImage"     Anchor ="C,C" Texture="MiniMap_BG.dds"  Size="256,256" StretchMode="Fill" Sampler="Linear"/>
    </Container>
</Context>

I've included a screenshot of the error I get when trying to run this mod.
 

Attachments

  • 2018-06-16 13_04_10-Sid Meier's Civilization VI (DX11).png
    2018-06-16 13_04_10-Sid Meier's Civilization VI (DX11).png
    62.6 KB · Views: 185
check the modding/database logs for the real error message
 
Code:
[166042.279] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database

In the database log. I don't see the relevant tags in existing base game XML files like MinimapPanel.xml. Am I missing a file that applies these tags to my XML control?
 
MOSTLY SOLVED: My modinfo file looks like this

Code:
...
  <InGameActions>
    <AddUserInterfaces id="AddUserInterfaces">
      <File>UI/TestMap.xml</File>
    </AddUserInterfaces>
  </InGameActions>
....

When it should have a context tag in it like this:

Code:
...
  <InGameActions>
    <AddUserInterfaces id="AddUserInterfaces">
      <Properties>
        <Context>InGame</Context>
      </Properties>
      <File>UI/TestMap.xml</File>
    </AddUserInterfaces>
  </InGameActions>
...


I manually updated the modinfo file and it works fine in game now.My issue is getting it to apply that context tag when it compiles the modinfo in Modbuddy.
 
COMPLETELY SOLVED: Added custom property when adding the adding the AddUserInterface to In-Game Actions in Modbuddy.
 
Back
Top Bottom