Skip to content

Interactable Stations

Stations are physical places where carried salvage can be placed and acted on. The current station base class is:

AAndromedaItemStation

It implements the interactable interface and is inherited by:

AAndromedaScanner
AAndromedaTaggingBench
AAndromedaWarehouseZone

This base class exists because these objects share the same physical grammar:

empty station + carried acceptable item -> place item
occupied station + usable placed item   -> use station

Components

AAndromedaItemStation creates:

MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
SetRootComponent(MeshComponent);

PlacementPointComponent = CreateDefaultSubobject<USceneComponent>(TEXT("PlacementPoint"));
PlacementPointComponent->SetupAttachment(MeshComponent);

InteractableComponent = CreateDefaultSubobject<UAndromedaInteractableComponent>(TEXT("Interactable"));

The mesh is the visible station body. The placement point is where a carried item lands. The interactable component provides reusable prompt/event data, though the station actor itself implements the interface.

Placed Item State

The station stores:

UPROPERTY(Transient, BlueprintReadOnly, Category="Andromeda|Station")
TObjectPtr<AAndromedaSalvageItem> PlacedItem;

This is runtime state. It should not be authored into the Blueprint asset. When the player places an item, the station records it. When the player picks it back up, the carry component clears it through ClearPlacedItem.

The salvage item also stores its current station:

station PlacedItem -> item
item CurrentStation -> station

That two-way reference lets pickup clear station ownership cleanly.

CanInteract

The base station's CanInteract checks two possibilities:

return (HeldItem && CanAcceptItem(HeldItem)) || CanUsePlacedItem(InteractingPawn);

This is the core station rule:

If player is carrying an acceptable item, station can be interacted with.
If station has a placed item that can be used, station can be interacted with.
Otherwise no prompt appears.

Subclasses customize CanAcceptItem and CanUsePlacedItem.

Interact

Station interaction is ordered:

1. If player is carrying an item and station can place it, place it.
2. Otherwise, if placed item can be used, use the station.

This order matters. If the player is carrying an item and looking at an empty scanner, pressing E should place the item, not open an empty scanner UI.

Base Acceptance

The base station accepts an item only when:

candidate item exists
station has no placed item
candidate item is not processed

Derived stations add domain-specific rules:

Scanner: base acceptance is enough.
Tagging bench: item must already be scanned.
Warehouse zone: item must already be packaged.

Prompts

The base station has editable prompt text:

EmptyPromptText
PlaceItemPromptText
UseStationPromptText

Derived classes set defaults in constructors. For example, the scanner uses:

Place item on scanner
Run scanner
Scanner empty

Prompts are not the source of truth. They reflect CanInteract and current station state.