GoToTradeAction

Agent action that navigates the character to the trading table's outer spot. Finds the "Trading Table" in the scene, resolves its TradingArea, and delegates movement to a MoveToTargetAction.

Definition

Namespace: Paragon.Townskeep.AgentSystem Assembly: Townskeep.dll

public class GoToTradeAction : AgentAction

Inheritance: ActionAgentAction → GoToTradeAction

Remarks

GoToTradeAction is used in the agent's trade sequence to walk the character to the trading table before placing an item for trade. It follows the same sub-action composition pattern as GoToStoreAction and FollowPathAction.

Execution Flow

spinner

Variable Binding

The item field is marked [Variable], meaning it can be set from the ActionSequence variable system (e.g., by a preceding WanderAction that sets "Item"). However, item is not used in this action's execution — it is declared but only the trading table location matters for navigation.

Quick Lookup

Goal
How

Navigate to trading table

Add GoToTradeAction to an ActionSequence

Change the target table

Modify the scene object named "Trading Table"

Fields

Field
Type
Access
Description

item

Item

[Variable] private

Bound from sequence variables; not used in this action

table

Table

private

Cached reference to the "Trading Table"

tradingArea

TradingArea

private

The trading area of the table (provides OuterSpot)

moveAction

MoveToTargetAction

private

Sub-action for NavMesh-based movement

nextPosition

Vector3

private

Declared but unused in current implementation

Methods

OnBegin

Finds the "Trading Table" via FindObjectsByType<Table>, casts its Area to TradingArea, and creates + initializes a MoveToTargetAction.

OnExecute

Sets the move target to tradingArea.OuterSpot.position and awaits movement completion.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated