joshmanisdabomb
Chieftain
- Joined
- Feb 27, 2017
- Messages
- 1
I'd like my SQL file to update the database only when the user has picked a value from my drop down box, which I've added under the Advanced Setup screen.
I've been trying for ages to use the criteria section provided in the ModBuddy, but I have no idea what keys and values need to go where. It's not very well explained.
Here's my InGameActions section in my .modinfo, where the SQL runs perfectly fine without the criteria:
Here's the drop down I have in the GameData:
And going back to the .modinfo file, here is various attempts of criteria I've been using:
Of course, only one of these were in there at one time, I've just been swapping them in and out.
Also, 'x0.25 Base Cost' is just a localized version of 'COST_BASE_TECH_X025', because I didn't know what else to try.
If someone could show me what I'm doing wrong or just explain how to use criteria properly, it would be greatly appreciated.
I've been trying for ages to use the criteria section provided in the ModBuddy, but I have no idea what keys and values need to go where. It's not very well explained.
Here's my InGameActions section in my .modinfo, where the SQL runs perfectly fine without the criteria:
Code:
<InGameActions>
<UpdateDatabase id="TYTUpdateDatabaseT025">
<Criteria>TYTCriteriaTech025</Criteria>
<File>SQLChanges/TYTT025.sql</File>
</UpdateDatabase>
</InGameActions>
Here's the drop down I have in the GameData:
Code:
<GameData>
<Parameters>
<Row ParameterId="TechnologyCostBase" Name="LOC_COST_BASE_TECH_NAME" Description="LOC_COST_BASE_TECH_DESCRIPTION" Domain="TechnologyCostBaseDom" DefaultValue="COST_BASE_TECH_X1" ConfigurationGroup="Game" ConfigurationId="COST_BASE_TECH" Hash="0" GroupId="AdvancedOptions" SortIndex="100"/>
</Parameters>
<DomainValues>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X025" Name="LOC_COST_BASE_X025_NAME" Description="LOC_COST_BASE_TECH_X025_DESCRIPTION" SortIndex="25"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X05" Name="LOC_COST_BASE_X05_NAME" Description="LOC_COST_BASE_TECH_X05_DESCRIPTION" SortIndex="50"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X075" Name="LOC_COST_BASE_X075_NAME" Description="LOC_COST_BASE_TECH_X075_DESCRIPTION" SortIndex="75"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X1" Name="LOC_COST_BASE_X1_NAME" Description="LOC_COST_BASE_TECH_X1_DESCRIPTION" SortIndex="100"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X125" Name="LOC_COST_BASE_X125_NAME" Description="LOC_COST_BASE_TECH_X125_DESCRIPTION" SortIndex="125"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X15" Name="LOC_COST_BASE_X15_NAME" Description="LOC_COST_BASE_TECH_X15_DESCRIPTION" SortIndex="150"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X175" Name="LOC_COST_BASE_X175_NAME" Description="LOC_COST_BASE_TECH_X175_DESCRIPTION" SortIndex="175"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X2" Name="LOC_COST_BASE_X2_NAME" Description="LOC_COST_BASE_TECH_X2_DESCRIPTION" SortIndex="200"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X25" Name="LOC_COST_BASE_X25_NAME" Description="LOC_COST_BASE_TECH_X25_DESCRIPTION" SortIndex="250"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X3" Name="LOC_COST_BASE_X3_NAME" Description="LOC_COST_BASE_TECH_X3_DESCRIPTION" SortIndex="300"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X35" Name="LOC_COST_BASE_X35_NAME" Description="LOC_COST_BASE_TECH_X35_DESCRIPTION" SortIndex="350"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X4" Name="LOC_COST_BASE_X4_NAME" Description="LOC_COST_BASE_TECH_X4_DESCRIPTION" SortIndex="400"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X45" Name="LOC_COST_BASE_X45_NAME" Description="LOC_COST_BASE_TECH_X45_DESCRIPTION" SortIndex="450"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X5" Name="LOC_COST_BASE_X5_NAME" Description="LOC_COST_BASE_TECH_X5_DESCRIPTION" SortIndex="500"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X6" Name="LOC_COST_BASE_X6_NAME" Description="LOC_COST_BASE_TECH_X6_DESCRIPTION" SortIndex="600"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X7" Name="LOC_COST_BASE_X7_NAME" Description="LOC_COST_BASE_TECH_X7_DESCRIPTION" SortIndex="700"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X8" Name="LOC_COST_BASE_X8_NAME" Description="LOC_COST_BASE_TECH_X8_DESCRIPTION" SortIndex="800"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X9" Name="LOC_COST_BASE_X9_NAME" Description="LOC_COST_BASE_TECH_X9_DESCRIPTION" SortIndex="900"/>
<Row Domain="TechnologyCostBaseDom" Value="COST_BASE_TECH_X10" Name="LOC_COST_BASE_X10_NAME" Description="LOC_COST_BASE_TECH_X10_DESCRIPTION" SortIndex="1000"/>
</DomainValues>
</GameData>
And going back to the .modinfo file, here is various attempts of criteria I've been using:
Code:
<ActionCriteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueContains>
<COST_BASE_TECH>COST_BASE_TECH_X025</COST_BASE_TECH>
</ConfigurationValueContains>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueContains>
<COST_BASE_TECH>x0.25 Base Cost</COST_BASE_TECH>
</ConfigurationValueContains>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueContains>
<TechnologyCostBase>COST_BASE_TECH_X025</TechnologyCostBase>
</ConfigurationValueContains>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueContains>
<TechnologyCostBase>x0.25 Base Cost</TechnologyCostBase>
</ConfigurationValueContains>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueMatches>
<COST_BASE_TECH>COST_BASE_TECH_X025</COST_BASE_TECH>
</ConfigurationValueMatches>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueMatches>
<COST_BASE_TECH>x0.25 Base Cost</COST_BASE_TECH>
</ConfigurationValueMatches>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueMatches>
<TechnologyCostBase>COST_BASE_TECH_X025</TechnologyCostBase>
</ConfigurationValueMatches>
</Criteria>
<Criteria id="TYTCriteriaTech025">
<ConfigurationValueMatches>
<TechnologyCostBase>x0.25 Base Cost</TechnologyCostBase>
</ConfigurationValueMatches>
</Criteria>
</ActionCriteria>
Of course, only one of these were in there at one time, I've just been swapping them in and out.
Also, 'x0.25 Base Cost' is just a localized version of 'COST_BASE_TECH_X025', because I didn't know what else to try.
If someone could show me what I'm doing wrong or just explain how to use criteria properly, it would be greatly appreciated.