Trait for New Civ - lua help needed

Qarthadast

Chieftain
Joined
Aug 2, 2011
Messages
19
I want to create a new Trait for Carthage to revive Liberty for myself and to represent their political structure a bit more in the game. The idea is that every new city founded by Carthage becomes a puppet directly. As compensation for that quite huge disadvantage, the unhappiness from puppet cities AND population of puppet is only half the normal amount (1,5 from cities themselves and 0,5 per pop). Further, the science and culture surcharge by each new city is decreased by 50% aswell. As compensation for the disadvantage of recruiting units only in the Capital, hitpoints and strength of each puppet are increased by 50%. Moreover, the player should be enabled to change the focus of puppet cities (towards science focus e.g.).

Is that possible? Can sbd help me to create such a trait via lua?
 
every new city founded by Carthage becomes a puppet directly.
Detect the city being founded (population change event where the old pop is 0) and call SetPuppet(true) for the new city

the unhappiness from puppet cities AND population of puppet is only half the normal amount (1,5 from cities themselves and 0,5 per pop).
May be easier to add this as a trait (a la India's) and somehow double the unhappiness in the capital (although you can't add buildings with negative happiness this may not be possible)

the science and culture surcharge by each new city is decreased by 50% as well
This is a global, based on map size, for all players - it could be done by keeping track of science/culture per turn and calculating a refund - but it wouldn't be trivial.

hitpoints and strength of each puppet are increased by 50%.
Can be done by adding a hidden building that has these effects

change the focus of puppet cities (towards science focus e.g.).
Non-trivial as the DLL resets all puppet cities to gold focus at the end of the player's turn. So you'd have to remember the chosen focus for each city and then manually calculate the differences between gold focus and the (remembered) chosen focus for each city and add/subtract them at the start of each turn.

You may want to start with something simpler ;)
 
Thank you for your answer!

I should have added that I haven't the faintest idea of lua editing... In a moment of optimism combined with limited knowledge I thought that the creation of the lua file would be quite simple and sbd could write it in a minute and send it too me ;)
well, beati pauperes spiritu ;)
 
somehow double the unhappiness in the capital (although you can't add buildings with negative happiness this may not be possible)
As far as the unhappiness question, as discussed in a recent thread:
The way I figured out how to do this (non-dll) was to lower HappinessDefault in HandicapInfos for everyone (by up to 9). Then give that happiness back with hidden buildings in the capital. Then you can "add unhappiness" by taking away those buildings.
Not pretty, but it could work. You'd still need Lua though.
 
Limited to 9 though - and my current capital has a pop of 37, which would need to remove (37/2 + 3/2 =) 20 happiness
 
Back
Top Bottom