Mass editing shipsection/weapon files

Moderator: Makail

Post Reply
MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Mass editing shipsection/weapon files

Post by MZ0125 » Mon Sep 21, 2020 9:17 am

Hi Guys,

Just wondering if anyone has any recommendations for mass editing .section/.weapon files? Especially if it can take a csv/spreadsheet file and editing
in specific values across multiple files?

I'm using Excel to calculate my data, thought about using VBA to make an editor of somesort, but haven't figured out how to load the files through the nodes yet, as it is not a standard XML file (I think?).

Anyway, thanks for all the help!

MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Re: Mass editing shipsection/weapon files

Post by MZ0125 » Mon Sep 21, 2020 11:28 am

NVD for the excel reading the files part. it is XML, it's just my shoddy VBA skill created some improper code and couldn't load the values properly. :googly: :googly: :googly:

I'm going to see if I can load more files, lol

MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Re: Mass editing shipsection/weapon files

Post by MZ0125 » Tue Sep 22, 2020 5:43 pm

Update 2: Basic load and write structure is completed!!! It is now able to load all main factions' .section files into the worksheet, and then write the changes to them!

Downsides include:
  • UI is a mess right now. Don't have time to work on that yet
  • haven't thoroughly tested it. just tried to modify some numeric value and did a full scale write. the game launches fine up to main menu
  • code logic is... working... definitely not NASA standard
  • no error detection, YET
Advantages include:
  • load all the single level nodes in the section files, and you can change them in a spreadsheet
  • good horizontal comparison and filtering of data
  • reads all stock files (890ish some files) in ~20s, writes all files in ~33s. on my comupter
Now here are the files
For backing up your .section files along with directory structure:
https://drive.google.com/file/d/1CRi34p ... sp=sharing

The Excel file
https://drive.google.com/file/d/1s2Acrt ... sp=sharing

Instruction:
  • Please download the file and use Excel to open it. Make sure Macro is enabled.
  • Find your game folder location
  • goto the Main Page sheet in the file, paste the full path into cell A2.
  • Make sure there is no backslash in the game folder full path, otherwise the code won't work.
  • Goto "Raw Data" sheet, hit load button. ignore the message about the workspace sheet, it's for future work
  • change the data to whatever legit value
  • hit write button and wait till complete
  • launch the game and enjoy!
What I'm planing is;
  • give you the ability to manipulate the numbers as you like, including using spreadsheet formulas
  • well, there is filter and sort now. haven't tested using formula to mass balance values
SERIOUSLY, Please let me know what you think about this!

Is there still anyone roaming the forum at all??? :(

MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Re: Mass editing shipsection/weapon files

Post by MZ0125 » Wed Oct 07, 2020 8:57 pm

Updated!

User avatar
Slashman
Posts: 2238
Joined: Sat Jul 21, 2012 1:39 am

Re: Mass editing shipsection/weapon files

Post by Slashman » Fri Oct 09, 2020 9:49 am

There should be at least a couple of people who this would interest. Rossinna-Sama being the first among them but I guess things are just a bit busy in his personal life right now. Sorry... :(
If you want a different perspective, stand on your head.

MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Re: Mass editing shipsection/weapon files

Post by MZ0125 » Sun Oct 11, 2020 3:25 am

Slashman wrote:
Fri Oct 09, 2020 9:49 am
There should be at least a couple of people who this would interest. Rossinna-Sama being the first among them but I guess things are just a bit busy in his personal life right now. Sorry... :(
Yeah... I sent him the link already. I'm just sad to see there is almost no new post on most of the sections...

MZ0125
Posts: 512
Joined: Tue Sep 22, 2009 8:02 am

Re: Mass editing shipsection/weapon files

Post by MZ0125 » Sun Oct 11, 2020 3:25 am

Update 2020-1017

Haven't worked on improving the UI yet. Finished prototyping the code for batch rewrite <ShipOptionGroups> into uniform options, still need to work on differentiating between special cases like shield command and single section units. Lack of uniformity in file naming pattern is really not helping to make this process easier. Maybe I will fix that first, lol.

Most of the work for this part is learning how to navigate the XML child nodes with VBA code.

Echo
Echo
Echo
Echo
Echo

Post Reply

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 3 guests