entity, var nodes, var edges)
Creates an actor path with the given number of nodes and edges, and attaches the given entity to it.
entity - entity pointer
nodes - number of path nodes
edges - number of path edges
0 if the path could not be created, otherwise nonzero.
entity - is attached to the path.
- Actor paths (not to be confused with folder paths) are graphs of points (nodes) that are connected through lines (edges). Paths can be edited in the level through WED or created with this function. The attached entities can move along a path with the path_spline function.
- The edges are set up so that the first edge leads from point 1 to point 2, the next edge from point 2 to point 3 and so on. All nodes are set to (0,0,0) by default. Use the path_setnode and path_setedge functions for setting positions and further properties of nodes and edges.
The maximum number of paths can be set up through the max_paths variable (default = 100) before loading the level. The overall maximum number of path nodes and edges is 100 * max_paths. When more paths, nodes, or edges are created, path_create returns 0.
// create a path from 4 points, and let a sphere follow it
max_paths = 1;
me = ent_create(SPHERE_MDL,NULL,NULL);
my.flags |= LIGHT;
var distance = 0;
path_spline(me,my.x,distance += 20*time_step);
path_next, path_setnode, path_setedge, path_spline,