Pathpoint Info

It seems like someone's always on the newsgroup asking questions about pathpoints. Here's some of the UnrealScript for the ObjectPath class. It's very well documented and should answer a lot of questions. I'll be posting a full pathpoint tutorial *sometime* but I hope this will be helpful until then.

What you need to know about Pathpoints:

---Pathpoints will not work without an Objectpath actor

---The ObjectPath's advanced property bStatic must be set to False

---The Pathpoints must have the same tag as the Objectpath

---The mover that will follow the Pathpoints must have its tag set to the Objectpath's PathActorTag

---A trigger is needed, with its Event set to the Objectpath/Pathpoint tag.

class ObjectPath extends Keypoint;
// Allows an object to follow a defined path, by specifying // PathPoint nodes.

// Note: At least 4 PathPoints must exist. The first and last do not need speed/deltaU settings.

// Note: If there are N points to interpolate through, there must be in total N+2 points specified. Point 0 and Point N+1 are dummy control points, where Point 1-Point 0 is the initial direction of motion, and Point N+1 - Point N is the final direction of motion. The object will start at point 1 and end up at point N.

// Uses the Bernstein basis functions for Bezier interpolation: B0(u) = (1-u)^3
B1(u) = 3u(1-u)^2
B2(u) = 3u^2(1-u)
B3(u) = u^3

var() name PathActorTag; // The Tag of the actor which should be moved

var() bool bAlterPitch; // should the pitch of the actor be modified during movement

var() bool bAlterYaw; // should the yaw ...

var() bool bAlterRoll; // should the roll ...

var() rotator RAdjust; // Adjust the rotation of the object

//var() bool bLoopMotion; // The last PathPoint should lead to the first

var Actor PathActor; // what should be moved

var PathPoint Path[35]; // maximum 35 nodes in the path, hence 33 real positions

var int numPathNodes; // how many elements in the path array

var int curNode; // Which node are we at?

var float uValue; // Offset in the segment

var bool bTriggeredOnce; // Don't repeat the path if it's already played through

var bool bPlayedOnce; // Really don't play it again since it's already finished last time

var vector lastPosition; // Where the actor was in the most recent frame

var rotator lastRotation; // The orientation of the actor in the most recent frame