Modding Traits

Potatish

Chieftain
Joined
May 2, 2004
Messages
99
Modding traits is simple enough, if you just want to change free promotions, experience, or commerce yields. However, I'm not quite sure how to edit the traits to make them give extra attributes to buildings.

For instance, I'm designing a trait for some key leaders (Saladin is one of them) that will add a science boost to all educational buildings. I'm guessing I'd have to edit the Schema and some C++ files to make a <CommerceTraits> tag in the BuildingInfos, though I'm not quite sure.

Any help would be largely appreciated.
 
Yes that what you'll need to do. You might put the new tag and data in the TraitInfos or in BuildingInfos and then load the info into a player level array of building commerce bonuses (may have to create that) then just have the City processBuilding functions use those values.
 
Yeah, that's quite a bit of work, so I'm taking a shortcut and making a Scientific trait which is very similar to Creative, as it adds +2 beakers per city and increases the construction speed of Observatories and Laboratories.

However, I've run into a problem. Adding this trait alone as made the game slow down considerably... Turns that used to take only a second are now taking close to six. Any ideas on what might alleviate this? -----Edit: Never mind, the problem was that I had 100,000 maximum trade routes, and that was screwing up the load times. It's back where I had it at 1,000, and is working smoothly.
 
Top Bottom