Health issues

Sench

Chieftain
Joined
Jun 12, 2010
Messages
6
Trying my hand at some simple balance changes, namely how health affects yields.
Using the following to affect the yield values (as an example):
Code:
<GameData>
<HealthLevels_CityYieldModifiersPerPoint>
<Update>
<Where HealthLevelType="HEALTH_LEVEL_BONUS_PRODUCTION" />
<Set Yield="2" />
However, when attempting something similar with the brackets within which these bonuses apply, it doesn't work:
Code:
<GameData>
<HealthLevels>
<Update>
<Where Type="HEALTH_LEVEL_BONUS_PRODUCTION" />
<Set HealthStart="0" />
Not only does this not work, for some reason, this causes the yield adjustment (which works on its own) to be ignored, as well.
Possible conflict due to the same name? Though they are in different categories...

Also, is there a simpler way to overwrite integers in the game than using the <update> function?

EDIT: Nevermind, after I tried putting this into two different xml files, it worked just fine (even though it's in the one file in the game's data).
EDIT2: And then it stopped working again, for no apparent reason...
 
Trying my hand at some simple balance changes, namely how health affects yields.
Using the following to affect the yield values (as an example):
Code:
<GameData>
<HealthLevels_CityYieldModifiersPerPoint>
<Update>
<Where HealthLevelType="HEALTH_LEVEL_BONUS_PRODUCTION" />
<Set Yield="2" />
However, when attempting something similar with the brackets within which these bonuses apply, it doesn't work:
Code:
<GameData>
<HealthLevels>
<Update>
<Where Type="HEALTH_LEVEL_BONUS_PRODUCTION" />
<Set HealthStart="0" />
Not only does this not work, for some reason, this causes the yield adjustment (which works on its own) to be ignored, as well.
Possible conflict due to the same name? Though they are in different categories...

Also, is there a simpler way to overwrite integers in the game than using the <update> function?

EDIT: Nevermind, after I tried putting this into two different xml files, it worked just fine (even though it's in the one file in the game's data).
EDIT2: And then it stopped working again, for no apparent reason...

Try putting <Set HealthStart> and <Set Yield> in the same set of <HEALTH_LEVEL_BONUS_PRODUCTION> tags if you didn't try already. I think that may have been your problem.
 
Tried it, didn't work. HealthStart (and end) are defined in the HealthLevels table, whereas Yield is defined in the HealthLevels_CityYieldModifiersPerPoint table. That's probably why. Could try to alter that, but more trouble than it's worth imo...

Anyway, tried a different approach regarding yield bonuses, simply copying the default <row> structure. Worked just fine.
Tried separating the HealthLevels table into a different file using the same (core) format, seemed to work once, then stopped again. This is how it looks:
Code:
<GameData>
<HealthLevels>
<Row>
<Type>HEALTH_LEVEL_BONUS_PRODUCTION</Type>
<Help>TXT_KEY_HEALTH_LEVEL_BONUS_HELP</Help>
<HealthStart>0</HealthStart>
<HealthEnd>5</HealthEnd>
</Row>
</HealthLevels>
</GameData>
Again, a pretty much direct copy from the game core files (sans the integer values). No idea why it won't work, since it does for yields.

EDIT: Is it possible the problem is caused by the definition of HealthStart:
Code:
<Column name="HealthStart" type="integer" notnull="true" unique="true"/>
Specifically, it being marked as "unique"? Meaning, if the value equals another value from the table, it is ignored altogether?

EDIT2: Some testing points to the "unique" tag being the problem. Is there a way it can be removed?
 
EDIT: Is it possible the problem is caused by the definition of HealthStart:

Code:
<Column name="HealthStart" type="integer" notnull="true" unique="true"/>Specifically, it being marked as "unique"? Meaning, if the value equals another value from the table, it is ignored altogether?

EDIT2: Some testing points to the "unique" tag being the problem. Is there a way it can be removed?

Yep, because both the "HealthStart" and "Type" variables are flagged as unique, no row in the table can contain the same value for either of them as any other row in the table.

You can't stop these being unique variables, you just have to make sure that any rows your mod adds / changes end up with a unique value for them.

Code:
<GameData>
<HealthLevels>
<Row>
[B]<Type>HEALTH_LEVEL_BONUS_PRODUCTION</Type>[/B]
<Help>TXT_KEY_HEALTH_LEVEL_BONUS_HELP</Help>
[B]<HealthStart>0</HealthStart>[/B]
<HealthEnd>5</HealthEnd>
</Row>
</HealthLevels>
</GameData>
Again, a pretty much direct copy from the game core files (sans the integer values). No idea why it won't work, since it does for yields.

Here you're adding a new row to the table using a <row> command, but since there's already a row in the table containing "Type=HEALTH_LEVEL_BONUS_PRODUCTION" it causes an error, and there's already a (different) row in the table containing "HealthStart=0", which causes another error.

Code:
<GameData>
<HealthLevels>
<Update>
<Where Type="HEALTH_LEVEL_BONUS_PRODUCTION" />
[B]<Set HealthStart="0" />[/B]
Not only does this not work, for some reason, this causes the yield adjustment (which works on its own) to be ignored, as well.
Possible conflict due to the same name? Though they are in different categories...

Again, because "HealthStart" is a unique variable and the "HEALTH_LEVEL_PENALTY_GROWTH" row already contains "HealthStart=0", changing it to 0 in this row causes an error.

Whenever an xml file causes an error the game rejects that entire xml file when loading the mod, meaning any correct code in that file will not get implemented either.
 
Back
Top Bottom