Field manual / Level editor
path — Path scripts
Path script (.pth) functions: they act on the path node's actor — not on host, and without an actor argument. In a project a location's walk paths (stairs, ladders, a plank: the route between two cells of the walk grid that the walk takes through the path's points) are path blocks inside its level block, in the location's paths.ogs: link — the start and end cells, points — PathPoint(x, y, angle, z) records (background x, y, the angle the walker turns to, the height), and its code in the block: fn OnNode(no, dir, walker) runs when an actor passes point no (dir 1 forward, 0 back). The engine reads the paths from these blocks only (not the game's .ap) and makes a path's object at its first point passed; the converter writes them of the level's <level>.ap and <path>.pth, the editor's Paths tool edits them.
level "01_port" {
path deska {
link = [182, 22, 189, 11];
points = [
PathPoint(x = 1460, y = 180, angle = 0.0, z = 135),
PathPoint(x = 1516, y = 92, angle = 0.0, z = 135),
];
fn OnNode(no, dir, walker) {
if (dir == 1 and no == 0) path::SetWalkAnimation("walk_footbridge");
if (dir == 1 and no == 1) path::SetWalkAnimation("walk");
}
}
}
Summary
path::SetWalkAnimation | Path script: the actor walks the rest of the path with this animation at its speed; a nonzero reverse plays it backwards (going down stairs). |
path::Animation | Path script: a one-shot animation; movement waits for it to finish; reverse = 1 plays it backwards. |
path::AsyncAnimation | Path script: a one-shot animation without stopping movement; flags as in path::Animation. |
path::QueueWalkAnimation | Path script: sets a one-shot animation for the next path segment; a = 1 means no blending, reverse = 1 plays it backwards. |
path::AsyncWalkAnimation | Path script: immediately starts the walk animation (the one set by path::QueueWalkAnimation, if any, otherwise the current one) without stopping movement. |
path::AdjustAngle | Path script: turns the actor to the angle of the current path point (at the end of the path, the last point). |
path::EnableRotation | Path script: 0 — the actor does not turn toward path points, 1 — it turns again. |
path::DisableInterpolation | Path script: the next animation starts without blending from the previous one. |
path::WaitForAnimation | Path script: movement along the path waits for the current one-shot animation to finish. |
path::WaitForInterpolation | Path script: movement waits for animation blending to finish. |
path::Delay | Path script: pauses the actor for ticks ticks. |
Functions
path::SetWalkAnimation(string, ?int) → int
Path script: the actor walks the rest of the path with this animation at its speed; a nonzero reverse plays it backwards (going down stairs).
path::Animation(string, ?int, ?int, ?int) → int
Path script: a one-shot animation; movement waits for it to finish; reverse = 1 plays it backwards. a = 1 means no blending into it, b = 1 no blending into the next one.
path::AsyncAnimation(string, ?int, ?int, ?int) → int
Path script: a one-shot animation without stopping movement; flags as in path::Animation.
path::QueueWalkAnimation(string, ?int, ?int, ?int) → int
Path script: sets a one-shot animation for the next path segment; a = 1 means no blending, reverse = 1 plays it backwards.
path::AsyncWalkAnimation(?int, ?int) → int
Path script: immediately starts the walk animation (the one set by path::QueueWalkAnimation, if any, otherwise the current one) without stopping movement. a = 1 means no blending into it, b = 1 no blending into the next one.
path::AdjustAngle() → int
Path script: turns the actor to the angle of the current path point (at the end of the path, the last point).
path::EnableRotation(int) → int
Path script: 0 — the actor does not turn toward path points, 1 — it turns again.
path::DisableInterpolation() → int
Path script: the next animation starts without blending from the previous one.
path::WaitForAnimation(?string) → int
Path script: movement along the path waits for the current one-shot animation to finish. The optional name only lets the queue continue in the same tick if it was exactly this animation that finished.
path::WaitForInterpolation() → int
Path script: movement waits for animation blending to finish.
path::Delay(int) → int
Path script: pauses the actor for ticks ticks. Classic ActorQueueDelay is the same function (the same exe handler).