I encountered an interesting "bug" while testing and playing various things in Career mode. It isn't a show stopper, which is why I'm still releasing Mod v1.4 later, but it's good to be transparent about these things.
So, a bit of backstory first.
The mod is about bringing extra Mechs to the Battletech game experience, but it isn't just about putting extra Jsons in. The other part of the experience is to put together Mechs that look the part from available parts. And sometimes, that requires me to
steal parts from elsewhere, such as below:
Part of that was a long period of exploration and testing how parts fit together and how the system reacts to it, mostly during the BETA period. Generally speaking, I got it to a point where the
Skirmish part of things work decently enough. But at that point we didn't have a Campaign or a Career mode to test with.
So, around Mod v1.2, I put in the SQL statements for people who want to put the mechs into Campaign mode, which when Career came around in Btech v1.3, also worked for that. But that doesn't mean there weren't....
problems. One of which surfaced lately when I was playing around with my own toys in Career.
So the bug is this:
The preview image in the Mechbay is not static; it's actually reading your mech's Mechdef and putting together a "Live" model. This is triggered every time you look at a different Mech. However, the method used by the SimGame to render a Mech, and the method used by the tactical game to render a Mech in combat are
different.
Specifically, while the tactical game is willing to put up with stolen parts, the Mechbay one is
only expecting parts from the configured prefab base. And when it encounters something that I coded that
isn't from the prefab base? It literally draws a blank and spazz out, as above.
That's still not the bad part. Actually overall it's not terrible, since the data is fine, and you can actually trigger the refit and repair buttons on the front panel, but the initial null pointer can sort of snowball badly. After doing a refit, it can save the work order, but refuses to exit the panel properly, leading to what looks like a hang, or worse, an overlapping panel:
What's happening is that Mech configuration panel is overlapping with the Mechwarriors panel, which is somewhat problematic because the Mech config panel is blocking some UI elements. But generally speaking, you can still get the panels to reset properly by clicking a few times on the upper left "Back" arrow icon.
However, null pointers are fairly insidious. I am suspecting this null pointer in causing some memory issues further down the road, resulting in some crashes, including live locking when trying to load a map. But it is somewhat situational, and a restart generally clears the situation up, so it's not a show-stopper per se.
So to summarize, the way to get around this Campaign/ Career problem is as follows:
1. If you need to refit the mech, you might run into a problem where the confirmation of job panel seems to be unresponsive. If you have clicked once on Confirmed, just cancel; that should reset the panel. Check your work orders afterwards; your refit should be one task in there.
2. If your UI spazz out like above, click on the upper left "Back" arrow until it resolves.
3. If you are going into live lock, particularly when trying to load a mission, reload the client; the data is generally safe and the memory problem clears once the client has reset.
This doesn't apply to Skirmish, which appears to work as intended.
-----------
To the Devs, if any are reading: I'd like to appeal to change the method in the SimGame Mechbay to allow grabbing from other prefab bases that are declared in the VM; that opens up opportunities for mods like mine, and is more consistent with the tactical game. If not, that fixing the null pointer issue may resolve some of the memory issues/ livelock issues I'm encountering.