
Forum



Some questions about AI vars etc
3 replies







another hint: use collision commands to analyze the terrain.
No i ahve not seen your Zombie Ai, but I'm gonna go check it out now

@DC:
Thanks for that, my mind is refreshend

I used this code to stop the AI from walking into water:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
previouspos = getplayery(0) if ( getplayery(0) == getwatery(0) +32 ) then 	goleft() 	if getplayery(0) < previouspos then 		goright() 	else 		goleft() end
But i guess the collisions woud work better, like just scan the entire terrain, and determin which of the pixels are an obstacle or just air.



