.modinfo structure

Status
Not open for further replies.
AFAIK, no, and it's frustrating to say the least...
 
Syntax for right display text in game is:

Code:
<GameData>
    <LocalizedText>
            <!-- Names -->
            <Row Tag="LOC_TCS_ABILITY_ARMOR_NAME" Language="en_US">
                <Text>Iron Armor</Text>
            </Row>
        <!-- Full description -->
            <Row Tag="LOC_TCS_ABILITY_ARMOR_DESCRIPTION" Language="en_US">
                <Text>+5 [ICON_Strength] Combat Strength from iron resource.</Text>
            </Row>
        <!-- Combat preview description -->
            <Row Tag="LOC_TCS_ABILITY_ARMOR_MODIFIER_DESCRIPTION" Language="en_US">
                <Text>{1_Amount} Combat Strength from armor.</Text>
            </Row>
    </LocalizedText>
</GameData>

I tested it on new ability for unit and battle preview in game was correct
 
Yep. And if you are replacing text rather than adding new ones, just replace Row with Replace.
 
Okay, I'm at a loss of why my mod isn't updating the database. It looks like everything is right. Here is the code for my ModInfo file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="36e88483-48fe-4545-b85f-bafc50ddfz48" version="1">
  <Properties>
    <Name>Victorian Civ</Name>
    <Stability>Alpha</Stability>
    <Teaser>Victorian Era Conversion of Civ 6</Teaser>
    <Description>Victorian era CIV VI</Description>
    <Authors>VictorianCiv</Authors>
  </Properties>
    <Components>
        <UpdateDatabase id="VICTORIAN_CIV_DB_UPDATE">
            <Items>
                <File>VictorianCiv_Routes.xml</File>
            </Items>
        </UpdateDatabase>
    </Components>
</Mod>

And here is the code inside VictorianCiv_Routes.xml

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edit 11/27/2016 VictorianCiv -->
<Routes>
    <Update>
        <Where RouteType="ROUTE_INDUSTRIAL_ROAD" />
        <Set MovementCost="0.2" />
    </Update>
    <Update>
        <Where RouteType="ROUTE_MODERN_ROAD" />
        <Set MovementCost="0.05" />
    </Update>
</Routes>

I can select the mod fine, but it doesn't actually update the road values. I'm at a loss why... what exactly do you have to do to make the update take place? I don't see anything in any logs either.
 
You have not defined VictorianCiv_Routes.xml as being a file that is part of the mod. You have merely referred to the filename in your <UpdateDatabase ... portion of the modinfo file.

You need:
Code:
	<Files>
		<File>VictorianCiv_Routes.xml</File>
	</Files>
<Files> should be listed as a table directly under <Mod ... just like <Components> and <Properties> are directly under <Mod ... >, so
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="36e88483-48fe-4545-b85f-bafc50ddfz48" version="1">
  <Properties>
    <Name>Victorian Civ</Name>
    <Stability>Alpha</Stability>
    <Teaser>Victorian Era Conversion of Civ 6</Teaser>
    <Description>Victorian era CIV VI</Description>
    <Authors>VictorianCiv</Authors>
  </Properties>
  <Files>
    <File>VictorianCiv_Routes.xml</File>
  </Files>
    <Components>
        <UpdateDatabase id="VICTORIAN_CIV_DB_UPDATE">
            <Items>
                <File>VictorianCiv_Routes.xml</File>
            </Items>
        </UpdateDatabase>
    </Components>
</Mod>
 
Hmmm, still not working after adding the Files entry. Is there a particular log file I can check to see what's failing?

Also, where does the SQLite DB file get updated? Does it update the Debug ones under the User\Cache directory? If so, how do you revert changes back when you unload a mod?

Trying to understand the overall file structure here.
 
I didn't notice this before:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edit 11/27/2016 VictorianCiv -->
<Routes>
    <Update>
        <Where RouteType="ROUTE_INDUSTRIAL_ROAD" />
        <Set MovementCost="0.2" />
    </Update>
    <Update>
        <Where RouteType="ROUTE_MODERN_ROAD" />
        <Set MovementCost="0.05" />
    </Update>
</Routes>
You need to wrap table <Routes> --- </Routes> in <GameInfo> -- <GameInfo> tags like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edit 11/27/2016 VictorianCiv -->
<GameInfo>
	<Routes>
		<Update>
			<Where RouteType="ROUTE_INDUSTRIAL_ROAD" />
			<Set MovementCost="0.2" />
		</Update>
		<Update>
			<Where RouteType="ROUTE_MODERN_ROAD" />
			<Set MovementCost="0.05" />
		</Update>
	</Routes>
</GameInfo>
Errors of syntax within an xml or sql file added to the database will be reported in Database.log in the Documents\My Games\Sid Meier's Civilization VI\Logs folder.

The database after mods load will be Documents\My Games\Sid Meier's Civilization VI\Cache/DebugGameplay.sqlite and be opened by an SQL viewer program.
 
Hmmm, still not working after adding the Files entry. Is there a particular log file I can check to see what's failing?

Also, where does the SQLite DB file get updated? Does it update the Debug ones under the User\Cache directory? If so, how do you revert changes back when you unload a mod?

Trying to understand the overall file structure here.

In your XML file, the outer element needs to be <GameInfo> to tell it what database to update--i.e.:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edit 11/27/2016 VictorianCiv -->
<GameInfo>
  <Routes>
    <Update>
        <Where RouteType="ROUTE_INDUSTRIAL_ROAD" />
        <Set MovementCost="0.2" />
    </Update>
    <Update>
        <Where RouteType="ROUTE_MODERN_ROAD" />
        <Set MovementCost="0.05" />
    </Update>
  </Routes>
</GameInfo>

I really find it simpler to just use .sql files instead of .xml, where you could just use 2 lines:

Code:
UPDATE Routes SET MovementCost = 0.2 WHERE RouteType = "ROUTE_INDUSTRIAL_ROAD";
UPDATE Routes SET MovementCost = 0.05 WHERE RouteType = "ROUTE_MODERN_ROAD";

It does update the Cache\Debug*.sqllite files. It seems to rebuild them when you select/deselect a mod, and every time you restart Civ.
 
I don't think this has been reported before. This line
Code:
<ShowInBrowser>AlwaysHidden</ShowInBrowser>
in the aztec dlc is responsible for making it hidden. If you comment it out, it will show in additional content as any user mod.
 
I'm trying to add an envoy from .lua, using UserInterface since GameplayScripts is broken on reloads.

My problem is the Influence object returned by Players[playerID].GetInfluence() in the InGame context lacks the set methods such as ChangeTokensToGive(). I can read the number of tokens and print them out all day long but not change them.

However, the Influence object returned in the Tuner under the GameCore_Tuner context does have that method. So I tried changing my context from InGame to GameCore_Tuner in the .modinfo file, but then the .lua code never executes. I'm gathering GameCore_Tuner is only for use in the actual Tuner.

I'm new to Civ modding, is there any way to access the GameCore_Tuner version of the object from the InGame context using ContextPtr or some such?

I can see from the DLL disassembly there are only 2 versions of the Influence object, one with both the set and read methods and one with only the read methods. I suppose I could hack the DLL to make both instances the same and include it as a modded DLL, but that seems a bit extreme for what I'm wanting to do--not to mention I'd have to redo it every time they patched the DLL. Anyone have any better ideas? What I'd really like to do is change the points towards the next envoy rather than adding an envoy directly, but not even the tuner version has a set method for the points themselves.
 
The OP for .modinfo has a typo of "<Property>" for "<Properties>"--it should be the latter for all elements.

A quick glance at the parsing disassembly shows the following elements off the root:

Code:
    <Dependencies>
        <Mod id="" title="" />
    </Dependencies>
    <References>
        <Mod id="" title="" />
    </References>
    <Blocks>
        <Mod id="" title="" />
    </Blocks>

<Dependencies> may be broken, though, it looks like it may expect it to open with <Dependencies> and close with </Depends>, though I haven't analyzed it enough to be certain. There's definitely a "Depends" after "Dependencies" where it would be closing the element for all the others, though.

Also, there is a "Priority" that can be associated with <File> under <Components> and <Settings>, though I haven't analyzed it enough to see if it's a child element or an attribute (I'd guess the latter), and I have no idea what it would do. It appears in the ComponentFiles and SettingFiles tables as an integer in Mods.sqlite--my best guess would be it is supposed to control the load order if for some reason you needed to do so.
 
Hi, i might need some help.

i have modified the Civilizations.xml file but it's not taken into account.

(added some bias and modified cities name)

here is my mod file:

Code:
<Mod id="08B8AACB-63EC-8E51-5086-24A939A317Ab" version="12">
  <Properties>
    <Name>My Mod</Name>
    <Stability>Alpha</Stability>
    <Teaser>My mod</Teaser>
    <Description>My great mod</Description>
    <Authors>Cyril PREISS</Authors>
    <ShowInBrowser>Show</ShowInBrowser>
    <EnabledByDefault>1</EnabledByDefault>
    <EnabledAtStartup>1</EnabledAtStartup>
  </Properties>
  <Dependencies />
  <References />
  <Blocks />
    <Components>

        <UpdateDatabase id="UPDATE_DATA">
            <Items>
                <File>Data/Civilizations.xml</File>
            </Items>
        </UpdateDatabase>
    </Components>
    
    <Files>
        <File>Data/Civilizations.xml</File>
    </Files>

</Mod>
 
@cyrilp,

This isn't causing your problem, but I'd delete these properties:

<ShowInBrowser>Show</ShowInBrowser> <-- This is the default so isn't necessary -->
<EnabledByDefault>1</EnabledByDefault> <-- This is going to turn the mod back on every time they restart, even if they turned it off -->
<EnabledAtStartup>1</EnabledAtStartup> <-- The actual property is <DisabledAtStartup>, and if set to 1 would turn the mod back off every time they restart, even if they had turned it on -->

Your problem is probably that you just copied Civilizations.xml, which is inserting rows. When you mod runs, those rows are already inserted, so trying to insert them again is failing. You'll need to include just the rows you want to change and use <UPDATE> or <REPLACE>.
 
Can you attach the Civilizations.xml file from in your mod ? (or better yet zip and attach the mod itself). I suspect I know the issue but would like to confirm.

i had just modified the xml file and @PlotinusRedux just explained that this is not working.

@cyrilp,

Your problem is probably that you just copied Civilizations.xml, which is inserting rows. When you mod runs, those rows are already inserted, so trying to insert them again is failing. You'll need to include just the rows you want to change and use <UPDATE> or <REPLACE>.

indeed this is what i did.

Could you give me the code i need to:

1: add bias:
<StartBiasTerrains>
<Row CivilizationType="CIVILIZATION_GERMANY" TerrainType="TERRAIN_GRASS_HILLS" Tier="1"/>
</StartBiasTerrains>

2:Replace city names: (i play with German leader but want the game to use french cities instead)
so i need to replace CIVILIZATION_FRANCE by CIVILIZATION_GERMANY in the cities name rows
and CIVILIZATION_GERMANY by CIVILIZATION_FRANCE

where should i write this ? in a Civilizations.xml file ?

Thanks
 
The OP for .modinfo has a typo of "<Property>" for "<Properties>"--it should be the latter for all elements.

A quick glance at the parsing disassembly shows the following elements off the root:

Code:
    <Dependencies>
        <Mod id="" title="" />
    </Dependencies>
    <References>
        <Mod id="" title="" />
    </References>
    <Blocks>
        <Mod id="" title="" />
    </Blocks>

<Dependencies> may be broken, though, it looks like it may expect it to open with <Dependencies> and close with </Depends>, though I haven't analyzed it enough to be certain. There's definitely a "Depends" after "Dependencies" where it would be closing the element for all the others, though.

Also, there is a "Priority" that can be associated with <File> under <Components> and <Settings>, though I haven't analyzed it enough to see if it's a child element or an attribute (I'd guess the latter), and I have no idea what it would do. It appears in the ComponentFiles and SettingFiles tables as an integer in Mods.sqlite--my best guess would be it is supposed to control the load order if for some reason you needed to do so.
Thanks !

Have you tried:

Code:
<Depends>
    <Dependencies>
        <Mod id="" title="" />
    </Dependencies>
    <References>
        <Mod id="" title="" />
    </References>
    <Blocks>
        <Mod id="" title="" />
    </Blocks>
</Depends>
?

Dependencies, Blocks and References where not working last time I tried them (I don't remember if it was before the patch), for the first two I'm not surprised because the Mods menu is very basic and don't handle that, but I was expecting References to be already used in the executable.
 
EnabledByDefault causes the mod to be turned on by default, but if you turn it off, it stays off when you exit and reload the game. I've experimented with and confirmed this with a personal "balance mod" I made for my own use. When I turn the mod off in the Additional Content menu it stays off until I turn it back on.

Just reconfirmed the behaviors:
  1. When the modinfo file is edited, this forces the mod to be turned on even if the mod was previously turned off. This is opposite to normal behavior.
  2. The mod stays off when turned off unless #1 occurs to auto-reassert the mod as being enabled
EnabledAtStartup which I want to say was originally part of the Aztec DLC's modinfo file, is now not in that file. Perhaps it never did anything, or perhaps it does not act as expected, or perhaps I just have an overactive imagination. I do have
Code:
<EnabledAtStartup>1</EnabledAtStartup>
in two mods but careful examination of the way the mods behave is making me start to think this may never have actually accomplished anything.
 
Last edited:
Status
Not open for further replies.
Back
Top Bottom