This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting lots of units form the Hangar at once
So, in short I have a MekHQ campaign file that has a VERY LARGE roster of personnel and assets in the Hangar tab. My computer can no longer provide the RAM necessary to reliably load a file with 100,000's of personnel and 10,000's of hangar assets each time (I am tired of waiting for nearly 2 hours of loading a campaign file only for a dialog box to pop up saying not enough RAM to support, 3 out of every 4 tries) so I have made the decision to compartmentalize my file into several campaign files each about a regiment in size.

The only way I can see to do so is to open a copy of the original file and delete away all the other personnel and assets not belong to one specific regiment at a time and save the remainder as a new campaign file with that regiments name. This works and I am fine with it. (Trying to save a .mul file of each regiment via a deployment, or exporting .mul's doesn't carry over the names of full vehicle crew or infantry platoons and seems to add their rank to their name not separate the two out when reloading into a new campaign file.

The problem is (if I can get the main file to load given its size) I can easily delete personnel in bulk, but not units from the Hangar.

In the "Personnel" Tab you can use the GM feature to select multiple persons and delete them all at once with the "Remove Person" option. That brings up a dialog box and warns you only once "Do you really want to remove X personnel?"  "X" equaling the number of personnel selected. This works great.

In the "Hangar" Tab however f you select an asset or multiple assets and use the GM feature to "Remove Unit" then for EVERY unit that you had selected for removal a dialog box pops up one after another after another, asking "Do you really want to remove _____?" "_____" being the name of each unit in turn that was selected. This takes FOREVER! I tried it once so far just to clear away all other units to save one single RCT as its own file and it took me nearly a week having to delete over 17,600 other units. A second attempt to free another RCT as it's own file has been failing repeatedly due to the time it takes and power outages (winter conditions here) and corrupted saved files that won't reload.

Is there any way to mass delete units in an organized fashion if they are not deployed in a "Force?"

Is there any way that I could make a copy of MekHQ where I can disable that time crushing warning dialog box? I have looked for a way to disable it myself but I can't seem to find it! Just pointers to events.

That's a heck of a lot of units. We have have a dev that is looking into ways to improve performance but we need very large, very complex cpnx files. Would you be willing to share the file, any custom units?

It would allow us to look for optimizations for units that size, might be a short term fix but would help in the long term. If interested please open a ticket on the MekHQ tracker and link back to this post.
Thanks Hammer, I did post an open ticket on the MHQ Tracker concerning this topic and uploaded a slimmed version of my master file with around 34,000 personnel and 7,800 unit assets. That one only takes between 50 and 65 minutes to load on my machine. Smile

I am poking around again tonight in a copy of MekHQ 0.44.0 to try and find the coding for the "Do you really want to remove ____?" pop up dialog box for the Hangar tab but thus far no luck. I have only some very basic coding skills, but if I could find where that is and disable it in a copy of the program for now it would save me a lot of long hours trying to delete units one at a time rather than let the program delete large batches on its own.

Still no luck after another 12 hours without power and another hour of searching. I am opening the file in WordPad to view and a lot of the files look like random symbols.
I have now located some of the code for the particular offending dialog box in my situation. I just want the dialog box disabled.


¿À java/lang/Exception ÁO ¯à ÄÅ ÆO REMOVE Do you really want to remove  ? DISBAND (Do you really want to disband this unit 
Disband Unit? java/util/Vector

I have tried extracting and editing files from the .exe then adding an edited file back in to the .exe, and I have tried extracting all files from the .exe and reforming a new .exe but I just get corrupt file messages or messages asking me to extract files rather than running the .exe as an application even though it is set as one. I am trying my best but honestly am not entirely sure what I am doing. Any help would be greatly appreciated as it could save me weeks worth of time.
You don't modify the program by editing the binary file. You would need to modify the source code and compile it.
Ok, this is well beyond anything I have ever tried to do before. Sorry for my ineptitude, but I am clearly trying to work my way through this from scratch.

I have found out that I can use a program called "Dirty Joe Java overall Editor" to edit a "class" file and perhaps compile it back in to an archive?

Hopefully that sounds right?

Opening the file I can see the following but am not sure what I even need to edit?

As Neoancient mentioned you need to do this via the code and compile it.  I can say unless you got some coding experience this isn't going to be easy.

But if you are going to try you're best to start using Eclipse and give these sections a read on our wiki.


Also we will get to the RFE at some point.

You can at the code here -

But this is read only.
Alright, I read over those webpages and several other tabs there as well. A lot of it is "all greek to me" but I am trying to follow along. I downloaded eclipse and have it working but now am having trouble "cloning a git repository" as I don't know what to put in this screen as mine isn't the same:

From Website Instructions:
[Image: 68747470733a2f2f692e696d6775722e636f6d2f...706e673f32]

What I see in my Eclipse:
Couple of things, their is now a fix pending and will be in the next release (around Christmas/New Year) that will do this.

You pull the repo address from the green button -
Thanks, very much appreciated! Cool Heart

Possibly Related Threads…
Thread Author Replies Views Last Post
  Bomb Selection from the Hangar txsoldier94 12 2,926 06-14-2017, 04:00 PM
Last Post: txsoldier94
  campaign won't load after deleting a vehicle (GM mode) Cik 6 2,089 11-25-2014, 10:57 PM
Last Post: Cik
  Problems with mechs showing in Hangar But not in TO&E Mekslayer 14 4,498 09-01-2014, 04:23 PM
Last Post: ralgith
  Resolution of one scenario causes all mechs to become undeployed in hangar ralgith 1 1,142 01-07-2012, 04:28 AM
Last Post: Taharqa

Forum Jump:

Users browsing this thread: 1 Guest(s)