Hello!
OK, I have 38 waypoints.
What I wan`t to achieve, is to get an object to pick a waypoint and head to it. When reached, it picks a new waypoint and so on.
My waypoints are ordered like this:
4-5,32
5-4,20
6-38
7-6
8-31,9
9-8,10
10-12,13,29,9
11-17,19,21,30,31,32,33
12-10,16
13-11,17,21
14-30,15
15-14,16
16-27,22,12,15
17-19,21,11,30,31,32,33
18-28,24,27,25
19-21,11,17,30,31,32,33
20-29,23,28,5
21-17,19,11,30,31,32,33
22-17,19,11,21
23-21,17,19,11
24-17,19,11,21
25-26,18
26-25,33
27-18,16
28-18,20
29-20,10
30-35,14
31-37,8
32-34,4
33-26,36
34-32,36,37
35-36,37,30
36-34,35,26
37-35,34,31
38-17,19,26
The first 3 are not needed.
The waypoint 4 is a limb number, and is also a number that defines a waypoint.
The numbers after the "-" represent the waypoints that the waypoint before the "-" can head to.
When I read in this file, I store the values in arrays. So, waypointx(4,2) will store the x position of the waypoint 32, because the waypoint 4 has 2 options, and option 2 or the waypoint 4 is the waypoint 32.
Firstly, am I doing this correctly?
Secondly, my AI isn`t working at all. If I set the last_waypoint to
17, the next_waypoint to
17 and the selection to
1, I know that the last waypoint visited is 17, and the next 19, because waypointx(17,1) is 19.
When it reaches 19, how can I figure out that I actually reached 19? How can I store the value 19 in the last_waypoint, if the array only returns the position of the waypoint, but not the number?
If I know that, it will help me a lot.
TheComet
Peachy, and the Chaos of the Gems
