• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Example gameplay mod

I haven't seen precedence for Modifier Update so I just copy them, edit then and give them different id (creating brand new modifier that is edit of the original), then regularily update whatever references its id to the new one.
Could you give an example? I am struggling with updating GameEffects and RequirementArguments. I get a configuration error failed message.

XML:
<?xml version="1.0" encoding="utf-8"?>
<Database>
    <GameEffects>
        <Update>
            <Where id="TRAIT_TREASURE_TECH_PREREQ"/>
            <Set ProgressionTreeNodeType="NODE_TECH_EX_ASTRONOMY"/>
        </Update>
        <Update>
            <Where TargetType="MOD_TECH_EX_NO_OCEAN_OBSTACLE"/>
            <Set ProgressionTreeNodeType="NODE_TECH_EX_ASTRONOMY"/>
        </Update>       
    </GameEffects>
</Database>
 
@zoomer61
I cannot give examples as I dont have access to PC - wont have for couple days.

The problem, however, is that you cant combine Database and GameEffects. As in GameEffects tag is not a child of Database.

Separately you'd have a structure for Database changes like:
Code:
<Database>
    <TableName>
        <Update>
            <Where Column="VALUE" />
            <Set Column="VALUE" />
        </Update>
    </TableName>
</Database>

And separately you'd have a structure for GameEffects where you ADD NEW EFFECTS:
Code:
<GameEffects>
    <Modifier id="MYMOD_CIVIC_ATTRIBUTE" collection="COLLECTION_OWNER" effect="EFFECT_GRANT_ATTRIBUTE_POINT">
        <Argument name="Amount">1</Argument>
    </Modifier>
</GameEffects>

Now about UPDATING EXISTING EFFECTS. I have said in the post what I do (did before I changed my ways) and although not best practise, can be used for ease. You create new effect based on existing one (copy and paste from source XML) and change the id to something unique and change the value you wish to update. Then in Database update what uses the original effect into using yours.

Better practice has been explained by Solver and Riconatic on previous page which I mostly started using and recommend. They showcase how the GameEffects just creates multiple entries across multiple tables and is convinient way of creating new effects. When updating, you then simply update the one specific entry in the one specific table, using structure like the first one.

I wanted to try to concoct what your code should look like but it seems to me that you are not even updating effects. Replacing GameEffect with the table where those entries are should fix it but I dont have access to game files to verify. When you look at XML source it should show the table/column names clearly.
 
Back
Top Bottom