[MOD TOOL] Convert GSB Module files to and from CSV files

Hi GSB modders!

I’ve written a couple of small programs that you can use to convert a group of module data files into a Comma Separated Value (CSV) file that you can edit in spreadsheet software like Microsoft Excel, and then later convert the CSV file back into GSB module files.

The programs are written in the Python programming language, and so you’ll need a Python interpreter to run them. You can get one for free at http://python.org/download. The latest release of my tools requires at least Python version 3. Python interpreters are available for all major operating systems, so Wine and Parallels users are not left out!

To use the programs, unzip the attached file somewhere on your computer. There are two programs in the folder created, with supporting code in the ModuleTools subfolder.

  1. modules_to_csv.pyw - This program reads the module data from your GSB installation and writes the data into a Comma Separated Value file named “module_data.csv” in the current folder. Edit the file in a text editor (like Notepad) if you want to change where it reads from or writes too. You can also enable “filters” so that only certain kinds of modules get written out, though you may need to know a bit of Python to make your own.
  2. csv_to_modules.py - This program takes the the data from “module_data.csv” and dumps the data back into separate module files. Rather than overwriting the official game data, it writes the files into a folder named “Modules” which will be created under the current one. As with the previous program, you can edit the file to control the input and output locations.

Important: If you have installed GSB to a location other than the default, you will need to edit the file “config.py” in the “ModuleTools” folder with a text editor (like notepad). Near the top of the file there is a line listing the path the programs will use to find the GSB module files. Edit the line to point to the correct install location. For Impulse users benefit, I’ve included the installation folder it uses by default, with instructions for how to uncomment it.

All feedback is welcome! I know there are some rough edges, and I intend to update these tools as I work on a mod of my own. Please let me know if there’s anything you’d especially like to see. Better UI and error handling is in the pipeline, but after that anything goes.

Update: version 1.1 is out!

  • More streamlined package structure.
  • Now requires Python 3.x.
  • Much better column sorting (it puts all the weapon-related fields at the start).
    GSB Module Tools 1.1.zip (3.78 KB)

um… what attachment?

Ha. I forgot to attach it. Or rather, I attached it, decided I wanted to update something first, deleted the attachment and never uploaded the newer one.

I’ve edited the first post and the zip file should be attached now.

Umm… Are we talking about the same modules? Because under the data/modules all files there are just .txt files which you can open with your notepad and edit them directly.

Why convert them to CSV in order to edit them?

the csv conversion is, i believe mainly for comparison purposes (see the big ol’ thread in the main forum)

It can also be good for editing a bunch of modules at once. If I want to make 10 new weapon modules, it’s as easy as adding ten rows to a CSV file full of other weapons, then putting in the stats I want. You can easily copy and paste rows too, so it can be even less work if you’re only making small modifications.

These tools are not so much intended for regular players as they are for people who are making their own mods. I’m planning to work on one myself in the near future, and this was my first step.


I’ve packaged up a new version of my tools, and I updated the first post to point to it (and have proper instructions).

The front end of the new version is a bit simplified, as there are just two programs to run, and the internal files are in a sub-folder. The back end stuff has been updated a bit too, and there is now better sorting of the columns in the CSV file.

As always, feedback is appreciated!

First impression:
Seems quite handy, thankyou!