Rope Endpoint (Data Type)
Describes one end of a rope, and how that end is picked when the action runs, for the from and to fields of apoli:attach_rope. An endpoint resolves to either an entity, which the rope follows, or a fixed point in the world, which doesn't move, so the other end can't get further away than the rope's length, like a tether or leash.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
source | String | "self" | Where the endpoint comes from: self (the acting entity), target (the bi-entity target, which only resolves when the action runs as a bi-entity action), raycast (a ray cast from the actor's eyes) or position (a fixed point). |
distance | Float | 30.0 | For raycast, how far the ray reaches. |
entities | Boolean | false | For raycast, whether the ray can attach to an entity it hits. |
blocks | Boolean | true | For raycast, whether the ray can attach to a block it hits. With both entities and blocks on, the nearest hit wins. |
position | Array of 3 Float | optional | For position, the fixed [x, y, z] point in the world. |
The raycast source hits blocks by their collision shape, so it stops at glass, glass panes and iron bars. The apoli:raycast condition uses "shape_type": "visual" unless told otherwise, and a visual ray passes straight through those blocks. When a raycast condition decides whether to attach the rope, give it "shape_type": "collider" so both rays stop at the same block. Otherwise the condition fails on glass with nothing solid behind it, even though the rope itself would attach.
Examples
{
"source":"self"
}The acting entity.
{
"source":"raycast",
"entities":true,
"blocks":false,
"distance":20
}Whatever entity the actor is looking at within 20 blocks.
{
"source":"position",
"position":[
100.5,
64,
200.5
]
}A fixed anchor in the world.