Since I dislike the way that A* uses a grid-like system, I decided to use Perfect AI's algorithm (with modifications). However, since it's not written in Lite-C, I decided to do some converting. Curiously, the definition of the array, written like...
define max_nodes 300; // maximum number of nodes that can be used in this demo
define max_arrays 90000; // 300 x 300 (max_nodes * max_nodes)
Gave me the first errors. So I rewrote the variables like...
void max_nodes [300]; // maximum number of nodes that can be used in this demo
void max_arrays [90000]; // 300 x 300 (max_nodes * max_nodes)
This worked, but it gave me an error right away with this section
var node_to_player[max_nodes]; // distance from the node to the player
So I searched the forums and found that sometimes [] doesn't work, so I switched to (max_nodes). This worked, and I got all the way down to this.
index = j + i * (number_of_nodes + 1); // compute the correct index in the array
if (node_to_node(index) == 0) // if these nodes can't see each other
{
node_to_node(index) = 999999; // set a huge distance for the nodes that can't see each other
}
I changed the [index] to (index), but now the line setting it to 999999 gives me a syntax error no matter what? What am I doing wrong with converting this code? Any ideas regarding this would be nice.
PS. I'm posting a lot of topics atm; sorry for the inconvience.