Adding Happiness Penalties to buildings?

Silvermyr

Chieftain
Joined
May 15, 2019
Messages
22
As the title says, is there a way to add a happiness penalty/ unhappiness to a building? Or can you add a negative food count, so that the building "eats" food?
 
You can specify a negative value in Building_YieldChanges. It will work properly but it will be displayed a little funny on the city view and civilopedia.

Buildings cannot create negative happiness. <Happiness> and <UnmoddedHappiness> in table <Buildings> simply ignore negative numbers.
 
Buildings cannot create negative happiness. <Happiness> and <UnmoddedHappiness> in table <Buildings> simply ignore negative numbers.

This is one of the many quirks that DLL-VMC and VP fix, so if you're using a modded DLL you'll get the expected results
 
I added a negative value like this:

<Building_YieldChanges>
<Row>
<BuildingType>BUILDING_CUPWONDER</BuildingType>
<YieldType>YIELD_HAPPINESS</YieldType>
<Yield>-15</Yield>
</Row>
...
...
</Building_YieldChanges>

When I try it though, I don't get any unhappiness. Did I misunderstand your instructions, or is there something else wrong here? When you say "displayed a little funny", is this not what you meant, correct? Since this is not a display error from what I can see. I cannot see any unhappiness added while looking at the happiness tally while in-game.
 

Attachments

Unless you're using a modded DLL (think VP added it, I didn't), there is no such yield as YIELD_HAPPINESS
 
What I meant was relating to the Food 'hit' you mentioned. You can do as
Code:
<Building_YieldChanges>
    <Row>
        <BuildingType>BUILDING_CUPWONDER</BuildingType>
        <YieldType>YIELD_FOOD</YieldType>
        <Yield>-1</Yield>
    </Row>
</Building_YieldChanges>
The building would have an inherent negative food yield to it, but in the city view (for example) this will show as "+ -1" Food instead of "- 1" Food.

Neither Happiness nor Tourism are yields as understood by the game when using the games' regular DLL. So they cannot be used in any table that are X_YieldChanges, X_YieldModifiers, or X_YieldPerX
 
is there a way to add a happiness penalty/ unhappiness to a building?

Using a positive value with UnhappinessModifier works. It's a percentage and not direct unhappiness, but it's really the only way within the default DLL I can think of to cause unhappiness from buildings.
 
Using a positive value with UnhappinessModifier works. It's a percentage and not direct unhappiness, but it's really the only way within the default DLL I can think of to cause unhappiness from buildings.
Together with some Lua trickery (granting some dummy policies whenever the building is constructed) it would be possible to use the <ExtraHappiness>-tag in the <Policies>-table (using a negative value just as in the Fall of Rome Scenario).

(That being said, if going this route, I'd suggest to hook it up to GameEvents.PlayerDoTurn(..) instead, as this'll make it easier to handle cases where the building is removed for some reason)
 
You can also use UnhappinessMod in table Policies to give either a positive or negative effect. But you have to be careful granting policies to an individual player when using the game's standard DLL. An individual player having too many policies borks the policy selection pop-up for the human player. Hence why the Dynamic Policy Effects system I created requires the VMC DLL -- William applied DLL-Magiks and fixed the standard DLL poopiness with this regard.

UnhappinessModifier in table Buildings is a global % (it is what is used by the Forbidden Palace) as is as I recall UnhappinessMod in table Policies.
 
Back
Top Bottom