ActionCriteria for conditional database updates

Michael Wagner

Chieftain
Joined
Oct 24, 2016
Messages
23
Hi, my plan was to add advanced game options to disable some victory conditions. E.g. to increase the StrategyConditions thresholds and prevent the victory condition buildings and adjust the legacy path texts.

My question is about the <ActionCriteria> section.
I currently just found <AgeInUse> and <RuleSetInUse> as Criterion to create a <Criteria>, which I could use as condition for a <ActionGroup>. Do you know other Criterions or ways for conditional updates of the database?

The schema-modding-10.sql file indicates more Criterion's and CriterionProperties:

Code:
-- Criteria
-- @CriteriaRowId is the unique id associated with the criteria.
-- @ModRowId is the specific mod associated with the criteria.
-- @CriteriaId is the user friendly identifier of the criteria.
CREATE TABLE Criteria(
  'CriteriaRowId' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  'ModRowId' INTEGER NOT NULL,
  'CriteriaId' TEXT NOT NULL,
  'Any' BOOLEAN NOT NULL DEFAULT 0,
  FOREIGN KEY ('ModRowId') REFERENCES Mods('ModRowId') ON DELETE CASCADE ON UPDATE CASCADE
);

-- Individual criterion of criteria.
-- @CriterionRowId is the unique id associated with the criterion
-- @CriteriaRowId is the criteria which the criterion is associated with.
-- @CriteriaType is the type of criterion.
CREATE TABLE Criterion(
  'CriterionRowId' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  'CriteriaRowId' INTEGER NOT NULL,
  'CriterionType' TEXT NOT NULL,
  'Inverse' BOOLEAN NOT NULL DEFAULT 0,
  FOREIGN KEY ('CriteriaRowId') REFERENCES Criteria('CriteriaRowId') ON DELETE CASCADE ON UPDATE CASCADE
);

-- Properties of a criterion.
-- @CriterionRowId is the criterion which the property is associated with
-- [USER=155399]@Name[/USER] is the name of the property.
-- @Value is the value of the property (as text).
CREATE TABLE CriterionProperties(
  'CriterionRowId' INTEGER NOT NULL,
  'Name' TEXT NOT NULL,
  'Value' TEXT NOT NULL,
  PRIMARY KEY ('CriterionRowId', 'Name'),
  FOREIGN KEY ('CriterionRowId') REFERENCES Criterion('CriterionRowId') ON DELETE CASCADE ON UPDATE CASCADE
);

If your interested, my current state is in this GitHub Repo: https://github.com/MSWagner/civ7-mod-victory-settings

But I currently only adjusted the advanced game option UI.
 
Seems there are those criterions:

Code:
AlwaysMet
NeverMet
ConfigurationValueMatches
ConfigurationValueContains
RuleSetInUse
CivilizationPlayable
LeaderPlayable
MapInUse
ModInUse
GameCoreInUse
GameModeInUse
AgeInUse
AgeEverInUse
AgeWasUsed

you'll find example of use of some of them in the civ6 modinfo files

like
Code:
        <Criteria id="Heroes_Mode">
            <ConfigurationValueMatches>
                <Group>Game</Group>
                <ConfigurationId>GAMEMODE_HEROES</ConfigurationId>
                <Value>1</Value>
            </ConfigurationValueMatches>
        </Criteria>

(those strings are in the civ7 exe, but I've not tested any of them, yet)
 
Thanks for your support, it worked with the ConfigurationValueMatches criterion (to change the victory and strategy thresholds depending on a boolean from the advanced settings)
 
Back
Top Bottom