Unknown

From DarkAI

AI MAKE WAYPOINTS FROM MEMBLOCK

This command replaces the container's existing waypoints with those from the memblock. You can choose to specify no edges and instead call the AI Update Waypoint Visibility command afterwards to update the links between the waypoints for use in path finding based on line of sight.

The structure of the memblock should be as follows:
Number of waypoints as DWORD (4 bytes)
Number of edges as DWORD (4 bytes)

Then for each waypoint:
X# as FLOAT (4 bytes)
Z# as FLOAT (4 bytes)
Cost# as FLOAT (4 bytes)

Then for each edge:
First Waypoint Index as DWORD (4 bytes)
Second Waypoint Index as DWORD (4 bytes)
Edge Cost# as FLOAT (4 bytes)

The cost for a waypoint defines the cost of moving through that waypoint when using it as a path, entities will attempt to avoid using higher cost waypoints if they increase the path cost too much and an alternative route is available. The default cost for all waypoints is 0, and must be a positive value.

Edges reference waypoints from the waypoint list above it, with index 0 being the first waypoint in the list. The edge is valid from the first waypoint to the second, but not the other way around. Therefore, if you want to define that the edge between two waypoints can be used in both directions you must define two edges, one going from the first waypoint to the second waypoint and the second edge going from the second waypoint to the first waypoint. The edge cost must always be at least the straight line distance between the two waypoints for the path finding to work correctly, but can be any number above this. Entities will avoid edges with a large cost where possible preferring the least cost path.

Syntax
AI Make Waypoints From Memblock Container Number, Memblock Number

Parameters
Container Number, The id of the container you want to fill with waypoints, must exist.
Memblock Number, The id of the memblock you want to use to use as source data.

Return
n/a