Making a Trait that adds yields to buildings

Buildkirbyus

Trainee Modder
Joined
Dec 24, 2014
Messages
159
Location
University Wi-Fi
Hi all,
My new civilization's trait is planned to add production to all food producing buildings. How would i program this and add support for buildings that add food production? I suppose i would make it by making a dummy building but i'm kinda new to the modding community (and programming in general) so i would like help for this and balance suggestions too.
(you can see teasers of my civ from my avatar and my signature)
 
Make a dummy policy that does this and add the extra yields with the <Policy_BuildingClassYieldChanges> table, then use lua to give the civ the policy
 
If you want to make it dynamic to accomodate all buildings that add food, you could possibly do it with SQL. I know I once experimented with something that modified all resources that could be improved with mines that way, so I could cover mods that added new resources that were worked by mines. However, depending on build order you wouldn't catch mods loaded after yours, so there could be some issues there.

(Plus, it's been a while since I tried it so I'm not entirely certain how the SQL would go...)

If you're just starting out, the easiest solution may be to just try and cover the buildings that exist in the core game.
 
Now my question is- and this is if i can even do said thing, do i do a flat production bonus, which would be simpler but harder to balance, or a portion of food produced by the building into a flat production number?

EDIT:
Thinking about for at least the base growth buildings to have the Maintenance of the building equal the flat production gained.
I.E. Granary -> 1 :c5gold: = 1 :c5production:
Hospital -> 2 :c5gold: = 2 :c5production:
 
Top Bottom