Dropping Off or Picking Up?

Hey Folks! Did a bit more work on pre-damaging derelicts today, and expanded inventory access a bit more on crew.

The pre-damaging so far has just been a matter of damaging tiles and punching holes. But I also wanted canisters and fuel tanks to be all or partially drained, so we wouldn't find ships with full tanks of everything.

Fortunately, draining these containers turned out to be a pretty simple affair. Everything I planned on affecting is considered "airtight," so filtering the list was easy. And furthermore, draining gas from containers was really easy since they each have a "delta" value that controls how much gas to add/remove next frame. I could sample the current gas amounts into a table of values, cut each by a random amount, and assign that table to the container's delta to be handled next frame. Voila! Drained container in 3 lines of code.

Fusion fuel tanks weren't much harder. All related fuel types are publicly listed in the Fusion class, and I could just iterate through each of those and decrement the tank's contents by random amounts.

Combined with damage, these should make the salvage value of derelicts a bit more plausible and interesting.

The other task I finished, and the bigger of the two, was to add the ability to drop items in a crew's inventory. Up until now, we could see what they carried in a plain text list in the UI, and they had access to these items when doing interactions. We could also manually order them to pick up items. However, we could not tell them to drop an item (e.g. if we had some loot we wanted to drop off on our ship).

So I changed the inventory UI to instead be a list of item widgets, with an image, name, and drop button for each. You can see it in today's screenshot. And clicking the drop button causes the crew to immediately interrupt themselves, look for a clear spot on the floor around them, and deposit the item there. We can therefore pick items up and drop them off with manual controls!

Ideally, we could tell the crew to loot something, and they'd do these things automatically (potentially dropping them into our designated barter zone). But this is a start.

I may also tinker with the concept of dragging items around that are too big to carry. I might be able to rig up a node that follows the crew around at a distance when they walk, and when they are dragging something, I can just attach that item to that node. Then, I'd just need a way to initiate dragging (probably a context command on the item), and a way to stop dragging. (Maybe a context command on the item again? Or the dragging crew?)

This isn't strictly necessary to do looting, so if it turns out to be a lot of work, I might postpone it until the looting game loop is a bit more well-worn. But it was ten 'til five when I finished the item list UI, so I figured I'd reward myself with a fun task :)

Tags: Ostranauts

Comments

ra1's picture
ra1

Provide a "power suit". This would allow the player to carry one "heavy" item. The suit could be upgraded to carry heavier items over time.

While wearing the suit, the player would move slower, and may (accidentally) damage stuff if you walk into it.

Most power suits work poorly or not at all near reactors and other power sources/batteries (due to EMI).

dcfedor's picture
dcfedor

Yeah, a power loader is definitely in the cards. How else would players live out their Aliens fantasy? :)

Dan Fedor - Founder, Blue Bottle Games