Skip to content

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::SetWalkAnimationPath 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::AnimationPath script: a one-shot animation; movement waits for it to finish; reverse = 1 plays it backwards.
path::AsyncAnimationPath script: a one-shot animation without stopping movement; flags as in path::Animation.
path::QueueWalkAnimationPath script: sets a one-shot animation for the next path segment; a = 1 means no blending, reverse = 1 plays it backwards.
path::AsyncWalkAnimationPath script: immediately starts the walk animation (the one set by path::QueueWalkAnimation, if any, otherwise the current one) without stopping movement.
path::AdjustAnglePath script: turns the actor to the angle of the current path point (at the end of the path, the last point).
path::EnableRotationPath script: 0 — the actor does not turn toward path points, 1 — it turns again.
path::DisableInterpolationPath script: the next animation starts without blending from the previous one.
path::WaitForAnimationPath script: movement along the path waits for the current one-shot animation to finish.
path::WaitForInterpolationPath script: movement waits for animation blending to finish.
path::DelayPath script: pauses the actor for ticks ticks.

Functions

path::SetWalkAnimation(string, ?int) → int

Classic: ActorSetWalkAnimation

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

Classic: ActorAnimation

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

Classic: ActorAsyncAnimation

Path script: a one-shot animation without stopping movement; flags as in path::Animation.

path::QueueWalkAnimation(string, ?int, ?int, ?int) → int

Classic: ActorQueueWalkAnimation

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

Classic: ActorAsyncWalkAnimation

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

Classic: ActorAdjustAngle

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

Classic: ActorEnableRotation

Path script: 0 — the actor does not turn toward path points, 1 — it turns again.

path::DisableInterpolation() → int

Classic: ActorDisableInterpolation

Path script: the next animation starts without blending from the previous one.

path::WaitForAnimation(?string) → int

Classic: ActorQueueWaitForAnimation

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

Classic: ActorQueueWaitForInterpolation

Path script: movement waits for animation blending to finish.

path::Delay(int) → int

Classic: ActorDelay

Path script: pauses the actor for ticks ticks. Classic ActorQueueDelay is the same function (the same exe handler).