The id of the path is mppath I believe, and the index can be retrieved from the object moving along the path, for example, enemy.path_index.
The local variable path_position can be used to find the position you are on within the path. This can be a problem though if the path is calculated each step, as the variable would stay extremely low until the path is finished.
Here is a basic explanation of how my attempted method works:
Whenever the enemy is close to each other, the function mp_potential_path would execute. If they aren't close together, then mp_grid_path is used.
It works for a bit, then my game freezes. I have no idea how to fix it either
I'm sorry that I really can't help you, since I myself don't know how to retrieve the node coordinates.
These functions might help though:
path_exists(ind) Returns whether a path with the given index exists.
path_get_name(ind) Returns the name of the path with the given index.
path_get_length(ind) Returns the length of the path with the given index.
path_get_kind(ind) Returns the kind of connections of the path with the given index (0=straight, 1=smooth).
path_get_closed(ind) Returns whether the path is closed or not.
path_get_precision(ind) Returns the precision used for creating smoothed paths.
path_get_number(ind) Returns the number of defining points for the path.
path_get_point_x(ind,n) Returns the x-coordinate of the n'th defining point for the path. 0 is the first point.
path_get_point_y(ind,n) Returns the y-coordinate of the n'th defining point for the path. 0 is the first point.
path_get_point_speed(ind,n) Returns the speed factor at the n'th defining point for the path. 0 is the first point.
path_get_x(ind,pos) Returns the x-coordinate at position pos for the path. pos must lie between 0 and 1.
path_get_y(ind,pos) Returns the y-coordinate at position pos for the path. pos must lie between 0 and 1.
path_get_speed(ind,pos) Returns the speed factor at position pos for the path. pos must lie between 0 and 1.
To get the name of a path the enemy is on, you can use path_get_name(enemy.path_index).
And to solve the length issue, you can use path_get_length.
I hope that helped