.modinfo structure

Status
Not open for further replies.
Your changes have no effect because you are looking at a UI file: the data from within it is only for UI display to the player.

The relevant code would appear to be in AssignStartingPlots.lua:
Code:
    --Find Default Number
    MapSizeTypes = {};
    for row in GameInfo.Maps() do
        MapSizeTypes[row.RowId] = row.DefaultPlayers;
    end
    local sizekey = Map.GetMapSize() + 1;
    local iDefaultNumberPlayers = MapSizeTypes[sizekey] or 8;
    self.iDefaultNumberMajor = iDefaultNumberPlayers ;
    self.iDefaultNumberMinor = math.floor(iDefaultNumberPlayers * 1.5);
The xml table being accessed is the from the Gameplay rather than Configuration side of the database: C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data/Maps.xml

C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Maps\Utility\AssignStartingPlots.lua

I've tried changing the code there by hard-coding self.iDefaultNumberMinor to 20 and it made no difference--you can set it to a *lower* number and that seems to work, but I want to set it to a higher number. If you look above at:

self.iNumMinorCivs = PlayerManager.GetAliveMinorsCount();

PlayerManager seems to have already determined the maximum number of minor civs by that point, always to 1.5*number of players actually in the game.
 
Yeah, you're right. All that part of AssignStartingPlots is doing is getting the default values to use later for determination of luxury spreading and the like, apparently. None of the UI seem to allow you to set the number of city-states, and the game seems to determine the hidden * 1.5 in the game core and then just reports the number assigned based on the data sent out to the playermanager system after the numbers are determined.

I mean there are no sliders like there were in civ5 to set the number of city-states like there was for Advanced Set-up in Civ5.
 
Last edited:
I've tried changing the code there by hard-coding self.iDefaultNumberMinor to 20 and it made no difference--you can set it to a *lower* number and that seems to work, but I want to set it to a higher number. If you look above at:

self.iNumMinorCivs = PlayerManager.GetAliveMinorsCount();

PlayerManager seems to have already determined the maximum number of minor civs by that point, always to 1.5*number of players actually in the game.
A lower number seems to work because AssignStargingPlots does not open slots for CS, but it affects starting plots to the existing ones, and a CS (or major civ) in an open slot who does not have a starting plot will not have any units at the start of the game.
 
Your changes have no effect because you are looking at a UI file: the data from within it is only for UI display to the player.

The relevant code would appear to be in AssignStartingPlots.lua:
Code:
    --Find Default Number
    MapSizeTypes = {};
    for row in GameInfo.Maps() do
        MapSizeTypes[row.RowId] = row.DefaultPlayers;
    end
    local sizekey = Map.GetMapSize() + 1;
    local iDefaultNumberPlayers = MapSizeTypes[sizekey] or 8;
    self.iDefaultNumberMajor = iDefaultNumberPlayers ;
    self.iDefaultNumberMinor = math.floor(iDefaultNumberPlayers * 1.5);
The xml table being accessed is the from the Gameplay rather than Configuration side of the database: C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data/Maps.xml

C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Maps\Utility\AssignStartingPlots.lua

I updated the AssignStartingPlots.lua and that made no impact on the City States.
 
I updated the AssignStartingPlots.lua and that made no impact on the City States.
@PlotinusRedux pointed out my error in thinking this was where the 'override' was occuring. But it appears to be coming from the playermanager system which just seems to be hardwired to create 1.5x CS as there are Major Players actually within a game.

Posts 61, 62, and 63 wherein I am feasting a little on crow :lol:
 
No luck with ModArt, I have absolutly no idea on how to set it, and what to set in the first place ! an artdef file ?

At least for context I get an error in the log during my tests...
 
Anyone know if we're able to set a specific database update to only run if a specific ruleset is selected? I've a few tests but none successfully at this point. Would be sad if that was beyond the capabilities of the .modinfo file.
yes, I have 9 differents rulesets in YnAMP.
 
That's important to know, really. Civ5 did not actually care about column capitalizations. I think it also did not care about table-name capitalizations. I know at least it did not care whether you stated <LANGUAGE_EN_US> or the more conventional presentation of <Language_en_US>, but I don't remember that I ever tried any of the other tablenames.

<Row>, <Update>, <Replace>, <Delete> etc have always required correct upper/lower case usage

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

Or was the capitalization issue in the modinfo file? because that might act differently to actual xml files re case sensitivity.
 
Last edited:
That's important to know, really. Civ5 did not actually care about column capitalizations. I think it also did not care about table-name capitalizations. I know at least it did not care whether you stated <LANGUAGE_EN_US> or the more conventional presentation of <Language_en_US>, but I don't remember that I ever tried any of the other tablenames.

<Row>, <Update>, <Replace>, <Delete> etc have always required correct upper/lower case usage

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

Or was the capitalization issue in the modinfo file? because that might act differently to actual xml files re case sensitivity.
The capitalization issue was in the modinfo file...I didn't actually test column capitalization in a database file so it may still be the way Civ V was for all I know. :dunno:
 
All right, I'm running into another issue. I've attempted to create several different text files to correspond to different rulesets, like so:
Code:
<Components>
        <UpdateDatabase id="TCS_DEFAULT_COMPONENT">
            <Items>
                <File>Data/Default/BuffedYields_Default.xml</File>
                <File>Data/Default/Buildings_Default.xml</File>
                <File>Data/Default/Districts_Default.xml</File>
                <File>Data/Default/Policies_Default.xml</File>
                <File>Data/Default/Misc_Default.xml</File>
            </Items>
        </UpdateDatabase>
        <UpdateDatabase id="RULESET_ENHANCED">
            <Properties>
                <RuleSet>RULESET_ENHANCED</RuleSet>
            </Properties>
            <Items>
                <File>Data/Enhanced/GreatWorks_Enhanced.xml</File>
                <File>Data/Enhanced/Improvements_Enhanced.xml</File>
                <File>Data/Enhanced/Policies_Enhanced.xml</File>
                <File>Data/Enhanced/Units_Enhanced.xml</File>
                <File>Data/Enhanced/Misc_Enhanced.xml</File>
            </Items>
        </UpdateDatabase>
        <UpdateDatabase id="RULESET_COMPLETE">
            <Properties>
                <RuleSet>RULESET_COMPLETE</RuleSet>
            </Properties>
            <Items>
                <File>Data/Enhanced/GreatWorks_Enhanced.xml</File>
                <File>Data/Enhanced/Improvements_Enhanced.xml</File>
                <File>Data/Enhanced/Policies_Enhanced.xml</File>
                <File>Data/Enhanced/Units_Enhanced.xml</File>
                <File>Data/Enhanced/Misc_Enhanced.xml</File>
                <File>Data/Complete/Units_Complete.xml</File>
                <File>Data/Complete/UnitAbilities_Complete.xml</File>
            </Items>
        </UpdateDatabase>
        <LocalizedText id="TCS_DEFAULT_COMPONENT">
            <Items>
                <File>Text/Default_Text.xml</File>
            </Items>
        </LocalizedText>
        <LocalizedText id="RULESET_ENHANCED">
            <Items>
                <File>Text/Enhanced_Text.xml</File>
            </Items>
        </LocalizedText>
        <LocalizedText id="RULESET_COMPLETE">
            <Items>
                <File>Text/Enhanced_Text.xml</File>
                <File>Text/Complete_Text.xml</File>
            </Items>
        </LocalizedText>
    </Components>
The config file is set up correctly as I can select the different rulesets from the dropdown menu. However, the Complete_Text.xml file always loads regardless of which ruleset I select in addition to some (not all) of the entries in the other two text files. There are no other Database log errors. The Modding log shows this:
Code:
Status: Applying Component - TCS_DEFAULT_COMPONENT
[2455346.588] Status: Creating database save point.
[2455346.588] Status: UpdateDatabase - Loading Data/Default/BuffedYields_Default.xml
[2455346.596] Status: UpdateDatabase - Loading Data/Default/Buildings_Default.xml
[2455346.597] Status: UpdateDatabase - Loading Data/Default/Districts_Default.xml
[2455346.598] Status: UpdateDatabase - Loading Data/Default/Policies_Default.xml
[2455346.599] Status: UpdateDatabase - Loading Data/Default/Misc_Default.xml
[2455346.599] Status: Successfully released save point.
[2455346.599] Status: Applied component to game.
[2455346.600] Status: Applying Component - RULESET_ENHANCED
[2455346.600] Status: Creating database save point.
[2455346.600] Status: UpdateDatabase - Loading Data/Enhanced/GreatWorks_Enhanced.xml
[2455346.601] Status: UpdateDatabase - Loading Data/Enhanced/Improvements_Enhanced.xml
[2455346.602] Status: UpdateDatabase - Loading Data/Enhanced/Policies_Enhanced.xml
[2455346.604] Status: UpdateDatabase - Loading Data/Enhanced/Units_Enhanced.xml
[2455346.605] Status: UpdateDatabase - Loading Data/Enhanced/Misc_Enhanced.xml
[2455346.605] Status: Successfully released save point.
[2455346.605] Status: Applied component to game.
[2455346.605] Status: Applying Component - TCS_DEFAULT_COMPONENT
[2455346.606] Status: Creating database save point.
[2455346.606] Status: LocalizedText - Loading Text/Default_Text.xml
[2455346.608] Status: Successfully released save point.
[2455346.608] Status: Applied component to game.
[2455346.609] Status: Applying Component - RULESET_ENHANCED
[2455346.609] Status: Creating database save point.
[2455346.609] Status: LocalizedText - Loading Text/Enhanced_Text.xml
[2455346.610] Status: Successfully released save point.
[2455346.610] Status: Applied component to game.
[2455346.611] Status: Applying Component - RULESET_COMPLETE
[2455346.611] Status: Creating database save point.
[2455346.611] Status: LocalizedText - Loading Text/Enhanced_Text.xml
[2455346.612] Status: LocalizedText - Loading Text/Complete_Text.xml
[2455346.613] Status: Successfully released save point.
[2455346.613] Status: Applied component to game.
[2455346.650] Status: Modding Framework - Finished Apply Components
[2455346.650] Status: Applied all components of enabled mods.
So the ruleset database updates are loading as I want, but ALL of the localization updates are loading no matter which ruleset I select. Is this standard behavior?
 
Last edited:
All right, I'm running into a few more issues. First, for some reason my modpack will load, but has this error in the Database log:
Code:
ERROR: Database::XMLSerializer (Buildings_Default.xml): Cannot parse file.
I've tried replacing the file, but it simply won't load that single file.

Second, I've attempted to create several different text files to correspond to different rulesets, like so:
Code:
<Components>
        <UpdateDatabase id="TCS_DEFAULT_COMPONENT">
            <Items>
                <File>Data/Default/BuffedYields_Default.xml</File>
                <File>Data/Default/Buildings_Default.xml</File>
                <File>Data/Default/Districts_Default.xml</File>
                <File>Data/Default/Policies_Default.xml</File>
                <File>Data/Default/Misc_Default.xml</File>
            </Items>
        </UpdateDatabase>
        <UpdateDatabase id="RULESET_ENHANCED">
            <Properties>
                <RuleSet>RULESET_ENHANCED</RuleSet>
            </Properties>
            <Items>
                <File>Data/Enhanced/GreatWorks_Enhanced.xml</File>
                <File>Data/Enhanced/Improvements_Enhanced.xml</File>
                <File>Data/Enhanced/Policies_Enhanced.xml</File>
                <File>Data/Enhanced/Units_Enhanced.xml</File>
                <File>Data/Enhanced/Misc_Enhanced.xml</File>
            </Items>
        </UpdateDatabase>
        <UpdateDatabase id="RULESET_COMPLETE">
            <Properties>
                <RuleSet>RULESET_COMPLETE</RuleSet>
            </Properties>
            <Items>
                <File>Data/Enhanced/GreatWorks_Enhanced.xml</File>
                <File>Data/Enhanced/Improvements_Enhanced.xml</File>
                <File>Data/Enhanced/Policies_Enhanced.xml</File>
                <File>Data/Enhanced/Units_Enhanced.xml</File>
                <File>Data/Enhanced/Misc_Enhanced.xml</File>
                <File>Data/Complete/Units_Complete.xml</File>
                <File>Data/Complete/UnitAbilities_Complete.xml</File>
            </Items>
        </UpdateDatabase>
        <LocalizedText id="TCS_DEFAULT_COMPONENT">
            <Items>
                <File>Text/Default_Text.xml</File>
            </Items>
        </LocalizedText>
        <LocalizedText id="RULESET_ENHANCED">
            <Items>
                <File>Text/Enhanced_Text.xml</File>
            </Items>
        </LocalizedText>
        <LocalizedText id="RULESET_COMPLETE">
            <Items>
                <File>Text/Enhanced_Text.xml</File>
                <File>Text/Complete_Text.xml</File>
            </Items>
        </LocalizedText>
    </Components>
The config file is set up correctly as I can select the different rulesets from the dropdown menu. However, the Complete_Text.xml file always loads regardless of which ruleset I select in addition to some (not all) of the entries in the other two text files. There are no other Database log errors. The Modding log shows this:
Code:
Status: Applying Component - TCS_DEFAULT_COMPONENT
[2455346.588] Status: Creating database save point.
[2455346.588] Status: UpdateDatabase - Loading Data/Default/BuffedYields_Default.xml
[2455346.596] Status: UpdateDatabase - Loading Data/Default/Buildings_Default.xml
[2455346.596] Warning: UpdateDatabase - Error Loading XML.
[2455346.597] Status: UpdateDatabase - Loading Data/Default/Districts_Default.xml
[2455346.598] Status: UpdateDatabase - Loading Data/Default/Policies_Default.xml
[2455346.599] Status: UpdateDatabase - Loading Data/Default/Misc_Default.xml
[2455346.599] Status: Successfully released save point.
[2455346.599] Status: Applied component to game.
[2455346.600] Status: Applying Component - RULESET_ENHANCED
[2455346.600] Status: Creating database save point.
[2455346.600] Status: UpdateDatabase - Loading Data/Enhanced/GreatWorks_Enhanced.xml
[2455346.601] Status: UpdateDatabase - Loading Data/Enhanced/Improvements_Enhanced.xml
[2455346.602] Status: UpdateDatabase - Loading Data/Enhanced/Policies_Enhanced.xml
[2455346.604] Status: UpdateDatabase - Loading Data/Enhanced/Units_Enhanced.xml
[2455346.605] Status: UpdateDatabase - Loading Data/Enhanced/Misc_Enhanced.xml
[2455346.605] Status: Successfully released save point.
[2455346.605] Status: Applied component to game.
[2455346.605] Status: Applying Component - TCS_DEFAULT_COMPONENT
[2455346.606] Status: Creating database save point.
[2455346.606] Status: LocalizedText - Loading Text/Default_Text.xml
[2455346.608] Status: Successfully released save point.
[2455346.608] Status: Applied component to game.
[2455346.609] Status: Applying Component - RULESET_ENHANCED
[2455346.609] Status: Creating database save point.
[2455346.609] Status: LocalizedText - Loading Text/Enhanced_Text.xml
[2455346.610] Status: Successfully released save point.
[2455346.610] Status: Applied component to game.
[2455346.611] Status: Applying Component - RULESET_COMPLETE
[2455346.611] Status: Creating database save point.
[2455346.611] Status: LocalizedText - Loading Text/Enhanced_Text.xml
[2455346.612] Status: LocalizedText - Loading Text/Complete_Text.xml
[2455346.613] Status: Successfully released save point.
[2455346.613] Status: Applied component to game.
[2455346.650] Status: Modding Framework - Finished Apply Components
[2455346.650] Status: Applied all components of enabled mods.
So the ruleset database updates are loading as I want (except for the one file which it's refusing to parse and I have no idea why), but ALL of the localization updates are loading no matter which ruleset I select. Is this standard behavior?

Anyone have any ideas about either of these issues?
As for the localized text files, I think I might know your issue.
You're doing it like this:

Code:
<LocalizedText id="RULESET_ENHANCED">
           <Items>
                <File>Text/Enhanced_Text.xml</File>
            </Items>
</LocalizedText>

Correct me if I'm wrong, but I believe you need to add this before <Items>
Code:
<Properties>
                <RuleSet>RULESET_ENHANCED</RuleSet>
</Properties>
 
As for the localized text files, I think I might know your issue.
You're doing it like this:

Code:
<LocalizedText id="RULESET_ENHANCED">
           <Items>
                <File>Text/Enhanced_Text.xml</File>
            </Items>
</LocalizedText>

Correct me if I'm wrong, but I believe you need to add this before <Items>
Code:
<Properties>
                <RuleSet>RULESET_ENHANCED</RuleSet>
</Properties>
Can you upload a copy of the actual Buildings_Default.xml file ?

You might have problems with the code within the file or your might have inadvertently gotten hidden characters attached to the file.

Also, check you did not accidently create a mismatch between the file name and the way the file is referrred to within the modinfo file (I did this a few times in Civ5 before I learned me better and it drove me crazy figuring out why my file wasn't even loading).
 
Can you upload a copy of the actual Buildings_Default.xml file ?

You might have problems with the code within the file or your might have inadvertently gotten hidden characters attached to the file.

Also, check you did not accidently create a mismatch between the file name and the way the file is referrred to within the modinfo file (I did this a few times in Civ5 before I learned me better and it drove me crazy figuring out why my file wasn't even loading).
I actually figured that out...I had a stray </Update> buried on line 543 or something. Thanks for offering to help though!
 
Just to be sure i didn't miss an important announcement (and because the discussion arose in another thread), did anybody manage to load Lua gameplay script when a game is loaded?
Last time i checked gameplay scripts only worked on newly created games but not after loading a saved game and nobody knew why or how to load them correctly with a saved game, VFS apparently ignored those when loading a game.
 
Status
Not open for further replies.
Back
Top Bottom