Installing Works, Old Part Cleanup, Airlock Fixes
Hey Folks! Pretty productive day, today. I managed to get part installation working, as well as some fixes and cleanup done.
It turns out I was actually pretty close to a working system yesterday. I just needed two things.
First, I needed to make sure the installation interaction kept track of the old vs. new installed item correctly. Second, I added a new field to interactions for "mode switching" the target instead of the subject. It was a pretty simple addition, and more of a convenience feature, but it meant the moment we swap the placeholder out and real (loose) object in, it can mode switch the loose object for the installed object right away, saving me a step.
With those in place, it worked! There was, however, a problem: I wasn't able to install a "loose" part back into it's original spot, since "loose" items have different placement rules than installed items. Loose items sit on the floor, for the most part, while installed items can go over walls, in the air, etc. This wasn't too hard to fix, either. I just changed interactions from having a boolean "install?" flag to a string instead. That string could specify the future part we were installing, so the ship editor could use those placement rules instead of the current loose item.
After a few minor fixes for selection, record-keeping, etc, I was able to uninstall a conduit junction from my ship, see things power down, then reinstall it at the same place and have power restored. Cool!
Once that was done, I added the same set of install/uninstall data for regular conduits. And I'll probably do the same for some other parts next.
However, there were a few other outstanding issues I wanted to tackle.
First, double-airlocks were causing trouble for pathfinders. And it turns out this was a simple bug. I was adding extra pathfinding penalties for open doorways that put the opposite airlock just out of reach, even thought he AI was right there next to it. Since open doors shouldn't really slow walking, I yanked the penalty, and all seems well again.
While I was in there, I also made the open airlock more visually clear, since it was hard to tell if open before.
There were also a few old parts that no longer made sense in the game. 4x1 conduits, 3x3 floors, 4x4 struts, and L-conduits. Since these were either too macroscopic or redundant, I removed them and patched-up the ship and station layouts that used them to instead use the more granular/up-to-date parts.
As of now, we're probably ready to continue making parts uninstall and install. Some additional features that might be useful here include:
- making uninstalled parts appear on the floor nearby instead of exactly where the installed version was (e.g. for disassembling items into multiple loot items)
- making sure uninstall/install actions can be gracefully interrupted and/or resumed.
- adding some new data for large parts that can be broken down into components and rebuilt again later from components. I.e. complex ship repairs!
We're starting to feel like a very early NEO Scavenger now, which is exciting. I can see myself spending longer amounts of time in-game looting, selling, fixing, and staying self-sufficient. This is a good sign!