Take Your Protein Pills and Put Your Helmet On
Well, we don't have any protein pills yet, but the helmet's getting there!
Today was all about the equipment system, and getting the game to handle equipping items into specific slots. I added some new features to items to define how they should affect a condition owner (CO) when installed in a slot. And to complete that system, a feature on COs that defines which slots they have.
So now, my crew have a slot called "helmet" defined. And the helmet item has a slot usage that looks something like this:
In English, this is saying that the helmet item can be equipped in the "helmet" slot, it will grand the "CONDHelmet01" list of conditions if equipped there, and it will replace the crew's helmet clothing sprite ("CrewHead") with "CrewHelmet03." Currently, CONDHelmet01 is just a 100% chance of "IsAirtight," but that's a placeholder until I figure out how to handle helmet stats/logic.
So far, this is partially working. In today's image, we see the helmet on the player near the top. There are still a few things to work out, though.
First of all, I'm just using a debug command to SlotItem() the helmet on the player. The final game will need something more versatile for the player to use. First instinct here is to right-click on an item lying on the ground, and choosing some sort of "equip" action on it. Which would send the currently-selected crew over there to retrieve it and equip it.
However, that has some hurdles to overcome. For one thing, the right-click menu is entirely composed of interactions, and I don't really have a way to equip items via interaction. Picking up, yes. Even giving or dropping is covered. But this is a really special case, in that you're not only picking-up the item, but putting it into a specific place.
Also, what about items that can be equipped in more than one place? Like held in the hand or worn? How does the user do that? Do they have a context menu item for each viable slot? Or is there a more generic "equip" button that opens a subsequent UI for choosing where?
Once I figure that out, there's also the reverse process to consider. How does one unequip an item? Currently, the only items on a crew are technically inside the crew, like Bender's compartment in his torso. A crew is a container, and picking up an item puts that item into the crew. This list of contents is then shown in a UI scroll area in the screen's lower right, where the user has a "drop" button next to each item.
It's crude, but did the job.
Now, however, we have more complexity to deal with. Do I remove the crew "container" and find another way to add items? In NEO Scavenger, creatures didn't have containers either, but rather slots which could have items attached to them, and said items could be containers. This still makes a lot of sense here, but I'd have to give the player some sort of UI access to these items. And I'm trying to avoid building an entire paper doll UI for this. At least for now, as it's a huge undertaking that would delay the ultimate task I'm trying to do here: add tools that can be used to salvaging a derelict.
Anyway, a lot to think about. But the cool thing is that once this works, we have a pretty major hurdle out of the way. It'll then be possible to add more slots and item effects just as easily as in NEO Scavenger, by simply adding some new lines to the data files.