How to determine the number and the sequence of in game portrait appearances
You will need to download this tool: http://www.twcenter.net/forums/showthread.php?t=438386 or use taw's esf 2 xml converter.
1. Use the attached xml_split.rb replacing the one in my tool or in taw's converter:
2. Convert esf2xml.
3. Open the PORTRAIT_ALLOCATOR and the xml of the culture you want changed. For every character you'll find 4 PORTRAIT_ALLOCATION like this one:
4. I think all are obvious now. Determine the pool limits(?) (here is 95-39) and the sequence (here is 89 85 59 etc.). repeat to all 4 instances of the character.
5. Save xml. When you are done with all cultures convert back xml2esf and you are done.
Attached are your xml files unchanged.
Ok, I tried that. I exported to XML, then I get a PORTRAIT_ALLOCATOR sub folder, with every factions.
I edited one (Russia for instance) and tried to change it, but then when I tried to convert back to esg, it generated a file with a time stamp "15:17" (but it is 20:12). And if I edit this new startpos with EsfEditor, it has not been changed.
What did I do wrong?
Hmm.. there are many thinks that might have happened. You did not receive any error message? Did you use my tool or plain taw's converter?
Anyway attached is the portraits in esf format. I changed only russia-culture generals using the sequence from 1 to 20.
I used your tool, with the modified file for split
No error message.
It generates an esf but un modified one.
I'm supposed to change the individual XML files, with only the portrait allocation for one faction?
Then it should use it and pack it together with the large xml to recreate the esf?
Another question. Here there is a sequence with 1-20. What happens if we reach 21? Does it cycle? Crash? or else??
If you use my tool: after esf2xml you'll find in XML Folder a PORTRAIT_ALLOCATOR folder and esf.xml (which holds the rest content of esf). Copy PORTRAIT_ALLOCATOR folder on your desktop, make your changes in the xml you like, copy back PORTRAIT_ALLOCATOR folder in XML Folder of S2C (menu XML Folder) replacing existing and execute xml2esf. When it will finish converting, it will ask you if you want to replace existing startpos with new one (it renames any esf you convert to startpos but this is not a problem you can rename it later if you want). Check the size of the new file and if it is about the same with input file that will be replaced, answer yes and you are done. If it has very small size or 0 then convertion failed due to an illegal change in XML(s).
I edited the XML directly in the PORTRAIT_ALLOCATOR folder. Why do I need to copy it to desktop?
I got a new startpos.esf, the size was not 0, but it did not contain my changes. As if it was build directly from esf.xml and ignored the PORTRAIT_ALLOCATOR folder
It needs the folder as well, or it won't be able to be rebuilt. Can you make other changes (you'll need to edit or restore xml_split.rb)? If not then probably you have this problem: http://www.twcenter.net/forums/showt...3#post11357613 Is the portrait allocator I send you working?I got a new startpos.esf, the size was not 0, but it did not contain my changes. As if it was build directly from esf.xml and ignored the PORTRAIT_ALLOCATOR folder
Last edited by Geronimo2006; May 03, 2012 at 12:26 PM.
Core i7 2600 @ 3.4ghz - NVIDIA GTX950 2GB
Ok, I tried again today.
I have an Shogun 2Converter\ESF folder, and again a ESF folder (so ESF\ESF).
I deleted everything from ESF\ESF, and tried to use Esf2Xml.
I get in the XML foler and esf.xml file, and a PORTRAIT_ALLOCATOR folder.
I edit Russia.xml from this folder, and then use Xml2Esf.
It says conversion is about to start, I click on OK.
Then very quickly I get a message "copy file" (because of startpos.esf), I select copy, then I get "Open file" window.
I don't know if I supposed to select something here.
I have a startpos.esf file, but it is always dated 01/05/2012 (date and time don't change), and my changes are not inside.
It looks like if the tool would just make a copy of this startpos.esf file and not modify it at all.
By the way, I tested your sample portraits, and it seems to be working. However, since the sequence is the same for all the entries (and I copied it for admiral), I have the same portrait for young/old generals. So I'd like to make the conversion work to be able to change it.
For some reason conversion from xml2esf fails. Did you tried to reinstall nokogiri as i suggested? Have you ever done a succesfull convertion with Taw's xml2esf? Anyway if there is not an alternative, make your changes in xml (you can find them also here) and send them over to convert them back to esf.