[SDK] Adding a new Yield type?

Temrek

Chieftain
Joined
Jun 19, 2008
Messages
28
While I have experience with both C++ and game programming, I need help understand how the Civ IV SDK is structured. I wonder how I would go about adding a fourth yield type, I understand I need to add it in CvEnums.h but I am also sure that wont be enough. So can anyone point me in the right direction?
 
Haven't tried doing it yet myself, but that does seem to be about all that is required. Load routines for any Yields array automatically load all listed sub-elements, and it warns you with an assert if it tries to load more subelements than the number of defined Yield Types. So adding a yield type and another <iYield> where needed solves loading the base information.

You'd also have to define the character used to represent your new yield, and I am not seeing precisely where that is accomplished at. Most likely ArtDefinesMisc or some other XML area, if not just automatically fed from the Gamefonts.tga by placing it immediately after the other yields.
 
I found no xml file that seems to be related to yield types. I added a new yield type in the header file as well as the related cpp file, and the mod crashes when I load it.
 
Check out WoC then. I know that they have added some extra either Yields or Commerces. Reasonably certain it was yields. You should be able to search their code for all instances that refer to it and decode what to do.


Ideally, Commerces and Yields work almost the same way, so you could just search standard BtS for all cases of ESPIONAGE and do about the same thing for Yield.
 
I found no xml file that seems to be related to yield types. I added a new yield type in the header file as well as the related cpp file, and the mod crashes when I load it.

Look for Civ4YieldInfos in the Terrain folder. The file hasn't changed since vanilla, though, so you need to look in the vanilla folder (Warlords and BtS only include changed files).
 
Yes in the WoC we added both commerces and yields. They are not all doing something yet but they are in anyway. I can give a link to the SDK if you want to have a look. But for yields if you want them displayed graphically on a plot that is something else. I can not figure out a way to display more than 3 on a plot.

You can see what I tried.

http://forums.civfanatics.com/showthread.php?t=294112

And here is an image anyway.
 
Yes it does but the art is completely different and I don't know how it is done. In Colonization there is just a dds file like an atlas sort of.

But in Civ there is 3 NIF's that are linked to atlas sort of. One NIF displays when there is only one yield on a plot, the second displays when there are 2 on a plot, and the third displays for when there is 3 on a plot.

They are billboards in the NIF's. Somehow each of them knows how to count which yields it uses by moving 64 pixel blocks down the dds to whatever yield it needs. I can not figure out how to change that. If anyone can figure it out it would be great. I saw nothing in the SDK for this file as well.
 
I can not figure out how the billboard works or I would of done it already. I do not understand how each billboard knows how to pick the different yields I mean.
 
Top Bottom