Appending Data to Freelancer String .dlls
-
Howdy,
I’m in the process of building a mod that, for several reasons, has quite a lot of string and .xml entries that need to be entered into .dlls. I was planning to utilize Freelancer Mod Manager’s GENERATESTRRES and GENERATEXMLRES functions to inject the lot of them, but it appears that FLMM has a writing limit of less than 2000 entries. My team and I would rather not spend several months entering the data in by hand.
Consequently, would anyone be able to point me in the right direction regarding the functions for appending of data into Freelancer string tables?
-
There is a simple and effective technique that uses FLDev’s CSV Parser and which can do the job you’re looking for.
First, you need to create a spreadsheet in your favorite editor (I favor Google Spreadsheet for its sharing capabilities, but Excel does it fine). On the first line in the first column, put up a column name, say “Text”. Then, list all of your XML entries on the rows below.
Once that is done, save the file as a CSV file (comma-separated values file). If you tried opening it, you’d simply see a plaintext file with all of your data stored in a comma-based list.
Now, open up FLDev, load up your DLLs through the load Freelancer.ini option (that is so the IDs are properly referenced, as long as the DLL you want to put the IDs in is loaded the rest does not matter). Select the CSV file you’ve just saved, too, in the CSV Path group. Finally, select an Output folder (that’s optional, but I strongly recommend it) in the same tab. In the DLL Editor, make sure that if you select the DLL you want to dump your infocards into, you can browse through it without any error. Then, go in the CSV Parser tab, select your DLL in the list. Make sure the “Generate infocards/names” box is ticked. On the left pane, you should see a tree with all of your XMLs listed. On the right pane, you’ll have the Template Editor. For the current purposes, you don’t need much. Assuming the column name of your spreadsheet was “Text”, you would put:
{{Text::INFO}}
Once all of that is done, click on Generate from CSV and follow any onscreen instruction. When all is done, you should end up with an INI file and an updated DLL. The DLL should contain all the infocards you’ve listed in your spreadsheet, while the INI file will have all the IDs for each infocard, listed in the order they appear in in the spreadsheet, one per line.
Now of course, this is a basic example. You could add a second column named “Name” and change the template to:
{{Name}} = {{Text::INFO}}
Which would already help identifying which infocard is related to what by using the Name column as some sort of guideline (IE if the infocard is that of a gun, have the Name column store that gun’s name for reference purposes).
You can also decide to go away with certain redundant pieces of code, as such:
{{"<rdl><push>"%+%Text%+%"<para></para></push></rdl>"::INFO}}
Which would let you deal away with the repetitive code at the end and at the beginning of each XML entry, thus saving valuable space in the spreadsheet. You could even break up each XML entry in multiple parts if you wanted!
This is how I would do it, at least
-
The funny thing is, I actually remembered coming across FLDev from one of the 88 Flak downloads, found it, and started writing a new method in my program for generating the CSV in-between the original post and your response ^_^
But your additional instructions just made everything much easier. Thanks very much, FF.