Skip to content

Preserve a carried remainder when refilling a farm station

Section titled “Preserve a carried remainder when refilling a farm station”
  • Status: current.
  • Engine: ue6-main 61e2877e, Linux x86_64, Epic clang 23.1.5.
  • Context: Standalone UE6 BPVerse actor interactions with native C++ inventory and station stock.
  • Prerequisites: Game-instance subsystem bridge, one held item, a station with a capacity, and a refill interaction.

A four-portion scoop fills a station from six to eight. If the bridge consumes the carried actor after every successful pour, the other two portions disappear. Farm stock also needs to represent a chick’s half portion when that same station next receives a refill.

With a station capacity of eight and six already stocked, pick up a four-portion scoop and interact with the station. Try pouring again at the full station. Drop the scoop, pick it up, then pour it at a station with two free places. Check for a two-portion transfer on both successful pours and for the same item in hand after the first one.

Use the existing Verse interaction to check the carried kind and call the native subsystem. In the native operation:

  1. Check that the carry kind matches the station.
  2. Ask the station to add the quantity held. Return the accepted quantity, clamped to the station’s free space.
  3. Subtract that quantity from the held item. Destroy the item when the remaining quantity reaches zero.
  4. Keep both quantities numeric with fractional support. When a chick eats, deduct the actual half portion and use it to scale the needs gain.

In Coop Zero, the native transaction is in UCoopGameSubsystem::AddPortions. ACoopStation::AddPortions updates the station’s stock and fill mesh. UCoopCarryComponent::PourPortions updates the existing carried actor.

The station and held item move by the same signed amount during a synchronous bridge call. A full station returns zero and leaves the held item alone. Sharing the same numeric representation across stocking, carrying and consuming lets a free half-portion of capacity be refilled without rounding away food or water.

  • Evidence level: runs in packaged build.
  • How: Run the Step 08 proof commands in Coop Zero’s REPORT.md. The scripted interaction logs FEEDER_REFILLED feeder=8 added=2, POUR_REMAINDER item=scoop portions=2 and CARRY_PICKED_UP item=scoop portions=2. The same run logs chick meals with ration=0.5.
  • Date / by: 2026-11-25, Coop Zero Step 08.

The packaged fixtures drove the normal interaction handlers from the Development console. The tests cover the single-player farm. The shared jar and stock mutations have no network transport in this slice, and physical controller input awaits owner review.