ChildAction - acrimi/Raven GitHub Wiki

ChildAction is an abstract action meant to be extended by actions that execute some logic against a child of triggering entity. It cannot be invoked or passed to an event handler directly, but instead provides a shared implementation of child filtering logic and ensure consistency in other actions.

The child will be searched for either through the entity's TransformComponent or a specified ChildLinkedComponent implementation, with optional filtering by the child's type and tag. If a child is found that satisfies the given criteria, the implementing action's execution logic will be invoked against it.

Configuration

The following parameters can be used to configure the action's behavior:

Key Type Description
type string The type of the child entity that should be targeted by the action
tag string The tag of the child entity that should be targeted by the action
linkedBy string The name of a component that implements ChildLinkedComponent. The target child will be determined by the value of the component's childId property, optionally filtered against type and tag if present.

Example:

"eventName": {
  "action": "[ExtendingAction]",
  "type": "fireball",
  "tag": "magicSpawn",
  "linkedBy": "CarryComponent"
}