Amenity Question

SocialMechanic

Chieftain
Joined
May 11, 2019
Messages
97
Damn, I feel bad asking so many questions...
I'm trying to make two other stages of happiness, and the following code doesn't seem to be working:

Code:
<GameInfo>
   <Kinds>
       <Row Kind="KIND_HAPPINESS"/>
   </Kinds>
   <Types>
       <Row Type="HAPPINESS_EUPHORIC" Kind="KIND_HAPPINESS"/>
       <Row Type="HAPPINESS_ACTUALIZED" Kind="KIND_HAPPINESS"/>
   </Types>
   <Happinesses>
       <Replace>
           <Row HappinessType="HAPPINESS_ECSTATIC" Name="LOC_HAPPINESS_ECSTATIC_NAME" MinimumAmenityScore="3" MaximumAmenityScore="5" GrowthModifier="20" NonFoodYieldModifier="10" RebellionPoints="-1"/>
       </Replace>
       <Row HappinessType="HAPPINESS_EUPHORIC" Name="LOC_HAPPINESS_HAPPY_NAME" MinimumAmenityScore="6" MaximumAmenityScore="9" GrowthModifier="40" NonFoodYieldModifier="20" RebellionPoints="-1"/>
       <Row HappinessType="HAPPINESS_ACTUALIZED" Name="LOC_HAPPINESS_ECSTATIC_NAME" MinimumAmenityScore="10" GrowthModifier="80" NonFoodYieldModifier="40" RebellionPoints="-1"/>
   </Happinesses>
   <Happinesses_XP1>
       <Row HappinessType="HAPPINESS_EUPHORIC" IdentityPerTurnChange="12"/>
       <Row HappinessType="HAPPINESS_ACTUALIZED" IdentityPerTurnChange="24"/>
   </Happinesses_XP1>
</GameInfo>

What am I doing wrong? (note that I also have a text file with the <BaseGameText> necessary).
I've also tried it without the "<Update>" section and it still didn't work.
Also, I suppose it could have worked, but it just didn't visually show it was working through the display and/or tooltips

EDIT: I did some further investigation. Does this only work if I alter color names or something? Does the HAVE to be done in LUA?
 
Last edited:
Base game file Happinesses.xml :
Code:
<GameInfo>
	<Kinds>
		<Row Kind="KIND_HAPPINESS"/>
	</Kinds>
	<Types>
		<Row Type="HAPPINESS_REVOLT" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_UNREST" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_UNHAPPY" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_DISPLEASED" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_CONTENT" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_HAPPY" Kind="KIND_HAPPINESS"/>
		<Row Type="HAPPINESS_ECSTATIC" Kind="KIND_HAPPINESS"/>
	</Types>
    ….etc...….
Table "Kinds" requires every new row added to that table must have a unique designation for column "Kind". Your code here repeats what the game already has, therefore violates the uniqueness requirements of the "Kinds" table, and so nothing from within your file is implemented.
Code:
   <Kinds>
       <Row Kind="KIND_HAPPINESS"/>
   </Kinds>
Database.log will be showing a Uniqueness Constraint error for the mistake you made.

Before you can know whether the game will implement a new Happiness Type you first have to fix your databasing errors. XML and SQL are both Database languages, used to add new stuff or alter existing stuff in the game's database. Your code has to successfully be added into the game database before you can begin to test for whether or not the game will implement what you are attempting.

I've no idea whether the game's controlling DLL code is written to assume only the Firaxis supplied Happiness levels, or if it will accept new ones as I've never experimented with attempting to add new Happiness Levels.
 
Last edited:
I admit, I'm not totally sure what you are trying to tell me.
So, are you saying that I need to get rid of the follow section?
Code:
<Kinds>
       <Row Kind="KIND_HAPPINESS"/>
   </Kinds>
Because it repeats itself from the base file?
I just removed this and it still isn't working >.<

Also, I'm using ModBuddy and the Output below the coding section has never given me an error, so I'm not seeing these errors (if any).
 
Modbuddy dos not report code syntax errors. It only reports errors in creating files for the mod.

You need to look at the game's Database.log to find coding errors when you attempt to run your mod in-game. Database.log is at
Code:
~~ \Documents\My Games\Sid Meier's Civilization VI\Logs

And, yes, you need to get rid of the quoted section.
 
And this also is incorrect and fatal syntax
Code:
<Replace>
           <Row HappinessType="HAPPINESS_ECSTATIC" Name="LOC_HAPPINESS_ECSTATIC_NAME" MinimumAmenityScore="3" MaximumAmenityScore="5" GrowthModifier="20" NonFoodYieldModifier="10" RebellionPoints="-1"/>
       </Replace>
"Replace" is not a "wrapper" for "Row". Replace is used instead of Row. So the correct method would be
Code:
<Replace HappinessType="HAPPINESS_ECSTATIC" Name="LOC_HAPPINESS_ECSTATIC_NAME" MinimumAmenityScore="3" MaximumAmenityScore="5" GrowthModifier="20" NonFoodYieldModifier="10" RebellionPoints="-1"/>
 
LeeS, thats fantastic. Thank you for your help. It worked...
However, though the Amenities are working, the cities description page is malfunctioning (as in, the button to the left of the other buttons that gives you the detailed amenity layout).
The city detail thing is just completely blank >.<
 
Top Bottom