Readpass 3

Sephi

Deity
Joined
Jan 25, 2009
Messages
3,092
ok, I understand how to use it, when I have to push back a single string because getInfoTypeForString doesn't work since the other XML file isn't loaded yet.

But what do I do if I want to load a dynamic array and have to use one of the GC.getNumXTypes(), but the corresponding XML file hasn't been loaded yet ? I guess I could always create a new XML infos file type that is loaded after all others but it's not a nice solution.
 
I would read this thread, I successfully added some arrays that used readpass3's to CvBuildingInfos. I'd be willing to try to help you.
 
thanks Afforess. I knew someone must have done this before. The forum search for readpass3 wasn't quite revealing
 
Just posting so that I have a post in the thread and pay attention to it if bumped again with further questions :) Readpasses were a PITA to sort out, I hate to force anyone else to go through it unguided (even if sometimes my guidance may confuse as much as assist).

The quick answer for what I think you are asking though is that base Firaxis code never sends an array to pass3, they just shuffle the order of XML loading so that a single entry field is the pass3 option. In FF I added some functions to CvXMLLoadUtilityGet for pass3 work which make arrays much easier, though I tend to use them for lists instead as I find those slightly faster in most cases. Barring use of those, the important thing to note is that the variable you store the text strings in is a List, so doesn't need a size specified at all, and the array which you will EVENTUALLY have doesn't need to have a size specified until you are in pass3 and you now DO know the size of GC.getNumXInfo()
 
Top Bottom