OK, I remember more now (it's coming back slowly!)
There are two things involved here. First, is the "look ahead" ability to find the next appropriate waypoint. Secondly, there is the cost of travelling along a certain path. So you can have 100 different ways to get from A to B, and the "look ahead" will ensure you do it one waypoint at a time. The path cost will define which of the 100 different ways the AI will pick, taking the cheapest option.
You need another command, executed just once...
AI Update Waypoint visibility
This sets the maximum visibility from one waypoint to the next.
The figures are the waypoint distances. Now, I don't know what the default unit is - maybe it is 1, maybe it's 0 or 1000 - I don't know.
I also did some other quirky things to make Railrider work better. For example, I set the path cost to the point behind me to 10,000. Then it was too expensive to go back the same way you had come. My game was cars on railtracks, so backward movement had to be impossible.
This is the code, taken straight out of the game, that I used to randomise path/waypoint weightings to make the enemy less intelligent. That is, he didn't always take the shortest path because of the cost involved.
` Randomize the edge weightings to alter intelligence of computer
start = cDEBUGOBJECTS
randomize timer()
mb = nextMemblock()
AI Make Memblock From Waypoints mb,0
` Number of Waypoints
wp = memblock dword(mb,0)
edge = memblock dword(mb,4)
wpStart = 8 : wpEnd = wpStart + (wp * 12)
edgeStart = wpEnd + 1 : edgeEnd = get memblock size(mb)
wpIndex = 0
for n = wpstart to wpend step 12
r = rnd(10)
if r = 3
cost# = 100
write memblock float mb,n + 8,cost#
make object cone start, 3
position object start, memblock float(mb,n), 1, memblock float(mb,n+4)
inc start, 1
endif
inc wpIndex, 1
next n
if debug then dbgOut("Waypoint Costs Applied", str$(cnt))
AI make waypoints from memblock 0,mb
delete memblock mb