Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

**UTILITY** New INI converter

The general place to discuss MOD''ing Freelancer!

Post Tue Mar 11, 2003 8:34 pm

**UTILITY** New INI converter

Before explaining what it is, it was only possible because Mario "Hcl" had posted a really good breakdown of the compressed INI file format. Thanks to him for his work. And also keep in mind that this software hasn't been tested beyond my own very basic unit testing. I've used it to export my freelander data directory to text format, modified values, then used it to convert all of the modified files back into the freelancer directory in binary format. It worked, the game loaded for me, but there could be bugs that my simple testing haven't uncovered.

With that said, my utility takes Hcl's conversion utility and goes a bit further. It can both read and write binary or text INI files. It can convert whole directories to->from text and binary, either direction, can operate recursively, etc...

I've used it like this: First thing first, I made a backup of all of the files under my Freelancer\Data folder. After that was done, I used the flini tool to extract all of the binary INI files from the Freelancer\Data folder to the c:\flmod folder.

The command line was:

flini /i:"c:\program files\microsoft games\Freelancer\Data" /o:c:\flmod /v /r

That reads all of the INI files under the Data directory and saves them in text format (the default output format is text) to c:\flmod. /v specifies verbose output so you can see the progress, and /r specifies to do all directories recursively. Also note the use of the quotes around the freelander directory. If your install path is in a directory with spaces, you'll have to enclose it in quotes.

Next, I edited some values, then ran:

flini /i:c:\flmod /o:"c:\program files\microsoft games\Freelancer\data" /b /v /r

That reads from my flmod directory, and writes the files back to the freelancer directory as binary (the /b argument).

This utility is written in C#, so it's going to require the .NET Runtime. You can install it by following one of the methods listed here. After that, go download the utility here. Extract it to whatever directory you like and that should be it.

I've already applied to set this up as a sourceforge project and hopefully add some developers to the project if it takes off. This ini converter is just one of the tools that I plan to integrate with a modding IDE that will also be housed under the same sourceforge project. I'll be sure to pass out the URL / project specifics when they approve the project.

If anyone has any comments, feedback, bugs, or ideas for this tool please let me know.
-Jon


Edited by - PumpkinEscobar on 11-03-2003 20:52:09

Edited by - PumpkinEscobar on 13-03-2003 06:18:25

Post Tue Mar 11, 2003 9:33 pm

Thanks!! This helped me out of a jam.

Post Tue Mar 11, 2003 9:56 pm

Forgot to mention, typing flini without arguments will print usage information. I've also added a /f commandline switch to force overwriting files. The default behavior is to skip the conversion process if the destination file is newer than the source. This is to make recursive conversions into directories only pick up changes.

I.e. in my example, I can edit one file in my c:\flmod folder, and then run one command:

flini /i:c:\flmod /o:"c:\program files\microsoft games\freelancer\data" /v /r /b

and it only picks up files that I've modified.

Post Wed Mar 12, 2003 2:00 am

Very nice modification of HCL's program. Good work. Ill download it and give it a shot..

Post Wed Mar 12, 2003 4:25 am

The program isn't working for me. I have the .NET Framework installed (although, right now I'm updating to SP 2 which apparently just came out) and this is the command I am using:

flini /i:C:\Games\Freelancer\Data /o:C:\Games\Freelancer\UCData /r /v /t

(indeed, that is where I keep freelancer as oppossed to microsoft's retarded way of putting important stuff deep inside layers of directories)

The verbose output I get is basically tons of this:

DIRECTORY: ROOMS
DIRECTORY: LI03
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: LI04
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: LI05
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: MINERS
DIRECTORY: RH01
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: RH02
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: RH03
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: RH04
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: RH05
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: ST01
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: ST02
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: ST02C
DIRECTORY: ST03
DIRECTORY: ST03B
DIRECTORY: BASES
DIRECTORY: ROOMS
DIRECTORY: DLLS
DIRECTORY: BIN
DIRECTORY: EXE
DIRECTORY: 1033
DIRECTORY: UCDATA

The one thing of note is that it is reading UCDATA and 1033 which are both NOT in subdirectories of C:\Games\Freelancer\Data. I've also tried it with quotes, and all the different options... nothing seems to make a difference.

Post Wed Mar 12, 2003 4:39 am

Im having the same problems here, i cant get it to work.

Post Wed Mar 12, 2003 7:16 am

Hmm, try changing the source option to

/i:C:\Games\Freelancer\Data\*.ini

I'll look into the problem tomorrow morning and put a fixed version up and post here.

Post Wed Mar 12, 2003 7:39 am

Okay, I tried what you said and got this...

C:\Games\Freelancer\Bini>flini /i:C:\Games\Freelancer\Data\*.ini /o:C:\Games\Freelancer\UCData\ /r /v /t
DIRECTORY: data
cameras.ini
System.IO.IOException: Could not find a part of the path "c:\games\freelancer\ucdata\cameras.ini".
at System.IO.File.GetLastWriteTime(String path)
at FLini.FLini.ConvertFile(FileInfo fileInfo)
at FLini.FLini.ConvertDirectory(DirectoryInfo dirInfo, String sFileFilter)
at FLini.FLini.DoConversion()

So, I made a blank cameras.ini in the UCData directory and tried it again, it sucessfully outputted to cameras.ini but then when it went onto the next file it wasn't there so it errored there instead:

C:\Games\Freelancer\Bini>flini /i:C:\Games\Freelancer\Data\*.ini /o:C:\Games\Freelancer\UCData\ /r /v /t /f
DIRECTORY: data
cameras.ini
loading...done saving...done
concave.ini
System.IO.IOException: Could not find a part of the path "c:\games\freelancer\ucdata\concave.ini".
at System.IO.File.GetLastWriteTime(String path)
at FLini.FLini.ConvertFile(FileInfo fileInfo)
at FLini.FLini.ConvertDirectory(DirectoryInfo dirInfo, String sFileFilter)
at FLini.FLini.DoConversion()


Seems to me like you just need to change it so it automatically searchs for all the ini files in the directory specified (and subdirectories for recursive) and to create the file if it doesn't exist before trying to write to it.

Post Wed Mar 12, 2003 7:49 am

Slightly OT, I'm afraid.

Could someone explain to me what the big whoop is about C#? What benefits does it give over C/C++? I'm an ASM coder myself and detest the concept of forcing a user to DL a big (and .NET is BIG) file just to get one prog to run. I'm not critizing or flaming here, this goes back to VB which is particularly bad, even more so when the developer gets the urge to use MSI to install the app[1.

I just want to understand!

[1 Funniest was a 120K vb app (no names here) I saw once that included in the zip the following :

ms vb 60 runtimes
instmsia.exe
instmsiw.exe

Total was somewhere in the region of 10 megs!!! For a 120k app! LOL!

Post Wed Mar 12, 2003 9:18 am

doesn't work for me either, I have the same problem as the guy above who got the listing of a crapload of directories but nothing actually got created. I tried adding the *.ini at the end and it gave me an exception.

Post Wed Mar 12, 2003 10:27 am

Ok, I fixed it. I had missed something when I added the force option. Sorry for the trouble, but I've uploaded a new version to the same location mentioned in the first post. Give this one a shot and see if it works for you. Let me know if you have any other problems with it, I'd like to get any other bugs fixed soon so I can move on to some other tools.


And as for why people like C#, it's easy. It's familiar to people with C/C++ backgrounds but it's a higher level language and the language and runtime together provide a lot of things that C/C++ didn't.

20MB for the .NET Runtime isn't big these days. I can download it in less than 2 minutes. I know there are still people out there on 56K. They can download it in about an hour and 10 minutes or order a CD with the runtime on it for the cost of shipping.

Besides that, it's not like you have to download the Runtime once for every .Net application you download. Download the runtime once and that's it.

Post Wed Mar 12, 2003 11:07 am

Got the fix, it worked, thanks a lot, this is a really useful prog.

Post Wed Mar 12, 2003 11:15 am

Seems to be working for me, and I have freelacncer in C:\Games\Freelancer\

Post Wed Mar 12, 2003 12:22 pm

It doesn't work for me. It just closes after i run it.

Edited by - Aceria on 12-03-2003 12:33:31

Post Wed Mar 12, 2003 12:37 pm

Read above on the command line usage...


Actaully, when i first converted everything and then re-encoded, then the srever wouldn't even start. After reverting, and then only replacing certain dirs (equip and ship) it works. Could have been a fluke, dunno.

Return to Freelancer General Editing Forum