FindInInfoClass can't find all Enums.h .... Why?

xienwolf

Deity
Joined
Oct 4, 2007
Messages
10,589
Location
Location! Location!
I'm trying to work with the Feat System right now, and I am making some of the Feats be prereqs in the XML. Problem is, when I load the XML file it tells me that it cannot find my entry in the Infoclasses (even though the entry is correctly placed in the XML).


I've set up hundreds of new fields in the SDK, so I am certain I am doing things properly, but just to check I tried using a UnitType text key instead. Everything worked just fine and it looked up the unit in the info class and give me that INT value to carry around. This means that the issue is simply that the FeatTypes are never loaded up to be used in INT form (so (FeatTypes)iI means nothing). This is accurate with how I have seen them used thus far, always spelled out fully. But I would far rather carry an INT than a full String from the XML.


The question is: Does anybody know how to make it create the entries in the InfoClass system so that I can use FindInInfoClass("FEAT_CORPORATION_ENABLED") and whatnot?


EDIT: It looks like things might get loaded into Globals by read___InfoArray, being carried in m_pa___Info. Now, the variable is defined for Feats in CvGlobals.h, but is not used anywhere. And while all of the nice read____InfoArray functions exist, none are called from anywhere (So I cannot see what precisely loads pStream for the input). I am suspecting that some of this is .exe stuff, but really hoping to dodge it in some manner (though that might require that I write a XML/BasicInfos file to load the Feats from by the look of things, at least during that process it automatically creates the ability to find things in the Info Classes)

EDIT2: I wound up moving the Feats out into an XML file. Slightly more involved than I initially anticipated as I had to change how all of the calls back to [is/set]FeatAccomplished work. The benefit to this approach however was that I could easily attach a Description to each item in the Feat system so that the Prereqs can demonstrate what they require nicely. And of course I can now add Feats without having to re-compile the DLL again.
 
Top Bottom